Skip to content

Commit 0bb74a0

Browse files
committed
Merge branch 'release/1.3.0'
2 parents db9e521 + dbb688c commit 0bb74a0

File tree

11 files changed

+506
-149
lines changed

11 files changed

+506
-149
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This extension provides some debbuging functionality for Magento.
44

55
Facts
66
-----
7-
- version: 1.1.1
7+
- version: 1.3.0
88
- [extension on GitHub](https://github.com/firegento/firegento)
99

1010
Description
@@ -16,11 +16,12 @@ This includes:
1616
- Check all installed modules for rewrite conflicts
1717
- Show all triggered events/observers
1818
- Show all log files in the Magento backend in "terminal-like" style
19+
- Show detailed system information in the backend
1920
- Provide logging interfaces for [ChromePhp](http://www.chromephp.com/), [FirePHP](http://www.firephp.org/) and [Firelogger](http://firelogger.binaryage.com/)
2021

2122
Requirements
2223
------------
23-
- PHP >= 5.2.0
24+
- PHP >= 5.3.0
2425

2526
Compatibility
2627
-------------
@@ -29,13 +30,13 @@ Compatibility
2930

3031
Installation Instructions
3132
-------------------------
32-
1. Install the extension via Magento Connect with the key shown above or copy all the files into your document root.
33+
1. Install the extension by copying all the extension files into your document root.
3334
2. Clear the cache, logout from the admin panel and then login again.
3435
3. You can now access all features over the the Tab "FIREGENTO" in the Magento backend
3536

3637
Support
3738
-------
38-
If you have any issues with this extension, open an issue on [GitHub](https://github.com/firegento/firegento/issues).
39+
If you have any issues with this extension, open an issue on [GitHub](https://github.com/firegento/firegento-debug/issues).
3940

4041
Contribution
4142
------------
@@ -52,4 +53,4 @@ Licence
5253

5354
Copyright
5455
---------
55-
(c) 2012 FireGento
56+
(c) 2013 FireGento

modman

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
src/app/code/community/FireGento/Debug app/code/community/FireGento/Debug
2-
src/app/design/adminhtml/default/default/layout/firegento_debug.xml app/design/adminhtml/default/default/layout/firegento_debug.xml
3-
src/app/design/adminhtml/default/default/template/firegento/debug app/design/adminhtml/default/default/template/firegento/debug
4-
src/app/etc/modules/FireGento_Debug.xml app/etc/modules/FireGento_Debug.xml
5-
src/app/locale/de_CH/FireGento_Debug.csv app/locale/de_CH/FireGento_Debug.csv
6-
src/app/locale/de_DE/FireGento_Debug.csv app/locale/de_DE/FireGento_Debug.csv
7-
src/app/locale/en_US/FireGento_Debug.csv app/locale/en_US/FireGento_Debug.csv
8-
src/lib/FireGento/ChromePhp lib/FireGento/ChromePhp
9-
src/lib/FireGento/FireLogger lib/FireGento/FireLogger
10-
src/lib/FireGento/FirePHP lib/FireGento/FirePHP
11-
src/firegento.php firegento.php
1+
src/app/code/community/FireGento/Debug app/code/community/FireGento/Debug
2+
src/app/design/adminhtml/default/default/layout/firegento_debug.xml app/design/adminhtml/default/default/layout/firegento_debug.xml
3+
src/app/design/adminhtml/default/default/template/firegento/debug app/design/adminhtml/default/default/template/firegento/debug
4+
src/app/etc/modules/FireGento_Debug.xml app/etc/modules/FireGento_Debug.xml
5+
src/app/locale/de_CH/FireGento_Debug.csv app/locale/de_CH/FireGento_Debug.csv
6+
src/app/locale/de_DE/FireGento_Debug.csv app/locale/de_DE/FireGento_Debug.csv
7+
src/app/locale/en_US/FireGento_Debug.csv app/locale/en_US/FireGento_Debug.csv
8+
src/lib/FireGento/ChromePhp lib/FireGento/ChromePhp
9+
src/lib/FireGento/FireLogger lib/FireGento/FireLogger
10+
src/lib/FireGento/FirePHP lib/FireGento/FirePHP
11+
src/firegento.php firegento.php
12+
src/skin/adminhtml/default/default/firegento/debug/ skin/adminhtml/default/default/firegento/debug/

src/app/code/community/FireGento/Debug/Block/Diagnostic/CheckEvents/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function _prepareColumns()
8585
'align' => 'left',
8686
'index' => 'location',
8787
'width' => '50%',
88-
'sortable' => true,
88+
'sortable' => false,
8989
'renderer' => 'firegento/diagnostic_renderer_paragraph'
9090
)
9191
);

src/app/code/community/FireGento/Debug/Block/Diagnostic/CheckSystem.php

Lines changed: 237 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,254 @@ class FireGento_Debug_Block_Diagnostic_CheckSystem
3333
extends Mage_Adminhtml_Block_Template
3434
{
3535
/**
36-
* Checks if one or more caches are active
37-
*
38-
* @return string Cache Message
36+
* @var Varien_Object
3937
*/
40-
public function checkCaches()
38+
protected $_system;
39+
40+
/**
41+
* @return FireGento_Debug_Helper_Firegento
42+
*/
43+
protected function _getHelper()
44+
{
45+
return Mage::helper('firegento/firegento');
46+
}
47+
48+
/**
49+
* @return Varien_Db_Adapter_Pdo_Mysql
50+
*/
51+
protected function _getDb()
52+
{
53+
return Mage::getSingleton('core/resource')->getConnection('core_read');
54+
}
55+
56+
/**
57+
* @return void
58+
*/
59+
protected function _construct()
60+
{
61+
$system = new Varien_Object();
62+
63+
/*
64+
* MAGENTO
65+
*/
66+
$magento = array(
67+
'edition' => Mage::getEdition(),
68+
'version' => Mage::getVersion(),
69+
'developer_mode' => Mage::getIsDeveloperMode(),
70+
'secret_key' => Mage::getStoreConfigFlag('admin/security/use_form_key'),
71+
'flat_catalog_category' => Mage::getStoreConfigFlag('catalog/frontend/flat_catalog_category'),
72+
'flat_catalog_product' => Mage::getStoreConfigFlag('catalog/frontend/flat_catalog_product'),
73+
'cache_status' => $this->_getHelper()->checkCaches(),
74+
'index_status' => $this->_getHelper()->checkIndizes()
75+
);
76+
$system->setData('magento', new Varien_Object($magento));
77+
78+
/*
79+
* SERVER
80+
*/
81+
82+
$server = array(
83+
'domain' => isset($_SERVER['HTTP_HOST']) ? str_replace('www.', '', $_SERVER['HTTP_HOST']) : null,
84+
'ip' => $_SERVER['SERVER_ADDR'],
85+
'dir' => Mage::getBaseDir(),
86+
'info' => php_uname(),
87+
88+
);
89+
$system->setData('server', new Varien_Object($server));
90+
91+
/*
92+
* PHP
93+
*/
94+
95+
$php = array(
96+
'version' => @phpversion(),
97+
'server_api' => @php_sapi_name(),
98+
'memory_limit' => @ini_get('memory_limit'),
99+
'max_execution_time' => @ini_get('max_execution_time')
100+
);
101+
$system->setData('php', new Varien_Object($php));
102+
103+
/*
104+
* MySQL
105+
*/
106+
107+
// Get MySQL Server API
108+
$connection = $this->_getDb()->getConnection();
109+
if ($connection instanceof PDO) {
110+
$mysqlServerApi = $connection->getAttribute(PDO::ATTR_CLIENT_VERSION);
111+
} else {
112+
$mysqlServerApi = 'n/a';
113+
}
114+
115+
// Get table prefix
116+
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
117+
if (empty($tablePrefix)) {
118+
$tablePrefix = $this->__('Disabled');
119+
}
120+
121+
// Get MySQL vars
122+
$sqlQuery = "SHOW VARIABLES WHERE `Variable_name` IN ('connect_timeout','wait_timeout')";
123+
$sqlResult = $this->_getDb()->fetchAll($sqlQuery);
124+
$mysqlVars = array();
125+
foreach ($sqlResult as $mysqlVar) {
126+
$mysqlVars[$mysqlVar['Variable_name']] = $mysqlVar['Value'];
127+
}
128+
129+
$mysql = array(
130+
'version' => $this->_getDb()->getServerVersion(),
131+
'server_api' => $mysqlServerApi,
132+
'database_name' => (string) Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname'),
133+
'database_tables' => count($this->_getDb()->listTables()),
134+
'table_prefix' => $tablePrefix,
135+
'connection_timeout' => $mysqlVars['connect_timeout'].' sec.',
136+
'wait_timeout' => $mysqlVars['wait_timeout'].' sec.'
137+
);
138+
$system->setData('mysql', new Varien_Object($mysql));
139+
140+
/*
141+
* System Requirements
142+
*/
143+
144+
$safeMode = (@ini_get('safe_mode')) ? true : false;
145+
$memoryLimit = $php['memory_limit'];
146+
$memoryLimit = substr($memoryLimit, 0, strlen($memoryLimit) -1);
147+
$phpCurl = @extension_loaded('curl');
148+
$phpDom = @extension_loaded('dom');
149+
$phpGd = @extension_loaded('gd');
150+
$phpHash = @extension_loaded('hash');
151+
$phpIconv = @extension_loaded('iconv');
152+
$phpMcrypt = @extension_loaded('mcrypt');
153+
$phpPcre = @extension_loaded('pcre');
154+
$phpPdo = @extension_loaded('pdo');
155+
$phpPdoMysql = @extension_loaded('pdo_mysql');
156+
$phpSimplexml = @extension_loaded('simplexml');
157+
158+
$requirements = array(
159+
'php_version' => array(
160+
'label' => 'PHP Version:',
161+
'recommended_value' => '>= 5.3.0',
162+
'current_value' => $php['version'],
163+
'result' => version_compare($php['version'], '5.3.0', '>=')
164+
),
165+
'mysql_version' => array(
166+
'label' => 'MySQL Version:',
167+
'recommended_value' => '>= 4.1.20',
168+
'current_value' => $mysql['version'],
169+
'result' => version_compare($mysql['version'], '4.1.20', '>='),
170+
),
171+
'safe_mode' => array(
172+
'label' => 'Safe Mode:',
173+
'recommended_value' => $this->renderBooleanField(false),
174+
'current_value' => $this->renderBooleanField($safeMode),
175+
'result' => !$safeMode,
176+
),
177+
'memory_limit' => array(
178+
'label' => 'Memory Limit:',
179+
'recommended_value' => '>= 256M',
180+
'current_value' => $php['memory_limit'],
181+
'result' => ($memoryLimit >= 256),
182+
),
183+
'max_execution_time' => array(
184+
'label' => 'Max. Execution Time:',
185+
'recommended_value' => '>= 360 sec.',
186+
'current_value' => $php['max_execution_time'],
187+
'result' => ($php['max_execution_time'] >= 360),
188+
),
189+
'curl' => array(
190+
'label' => 'curl',
191+
'recommended_value' => $this->renderBooleanField(true),
192+
'current_value' => $this->renderBooleanField($phpCurl),
193+
'result' => $phpCurl,
194+
),
195+
'dom' => array(
196+
'label' => 'dom',
197+
'recommended_value' => $this->renderBooleanField(true),
198+
'current_value' => $this->renderBooleanField($phpDom),
199+
'result' => $phpDom,
200+
),
201+
'gd' => array(
202+
'label' => 'gd',
203+
'recommended_value' => $this->renderBooleanField(true),
204+
'current_value' => $this->renderBooleanField($phpGd),
205+
'result' => $phpGd,
206+
),
207+
'hash' => array(
208+
'label' => 'hash',
209+
'recommended_value' => $this->renderBooleanField(true),
210+
'current_value' => $this->renderBooleanField($phpHash),
211+
'result' => $phpHash,
212+
),
213+
'iconv' => array(
214+
'label' => 'iconv',
215+
'recommended_value' => $this->renderBooleanField(true),
216+
'current_value' => $this->renderBooleanField($phpIconv),
217+
'result' => $phpIconv,
218+
),
219+
'mcrypt' => array(
220+
'label' => 'mcrypt',
221+
'recommended_value' => $this->renderBooleanField(true),
222+
'current_value' => $this->renderBooleanField($phpMcrypt),
223+
'result' => $phpMcrypt,
224+
),
225+
'pcre' => array(
226+
'label' => 'pcre',
227+
'recommended_value' => $this->renderBooleanField(true),
228+
'current_value' => $this->renderBooleanField($phpPcre),
229+
'result' => $phpPcre,
230+
),
231+
'pdo' => array(
232+
'label' => 'pdo',
233+
'recommended_value' => $this->renderBooleanField(true),
234+
'current_value' => $this->renderBooleanField($phpPdo),
235+
'result' => $phpPdo,
236+
),
237+
'pdo_mysql' => array(
238+
'label' => 'pdo_mysql',
239+
'recommended_value' => $this->renderBooleanField(true),
240+
'current_value' => $this->renderBooleanField($phpPdoMysql),
241+
'result' => $phpPdoMysql,
242+
),
243+
'simplexml' => array(
244+
'label' => 'simplexml',
245+
'recommended_value' => $this->renderBooleanField(true),
246+
'current_value' => $this->renderBooleanField($phpSimplexml),
247+
'result' => $phpSimplexml,
248+
)
249+
);
250+
$system->setData('requirements', new Varien_Object($requirements));
251+
252+
$this->_system = $system;
253+
}
254+
255+
/**
256+
* @return Varien_Object
257+
*/
258+
public function getSystem()
41259
{
42-
return Mage::helper('firegento/firegento')->checkCaches();
260+
return $this->_system;
43261
}
44262

45263
/**
46-
* Checks if all indexes are up-to-date
47-
*
48-
* @return string Indexes Message
264+
* @param boolen $value
265+
* @return string
49266
*/
50-
public function checkIndizes()
267+
public function renderBooleanField($value)
51268
{
52-
return Mage::helper('firegento/firegento')->checkIndizes();
269+
if ($value) {
270+
return $this->__('Enabled');
271+
}
272+
return $this->__('Disabled');
53273
}
54274

55275
/**
56-
* Returns a small system check report with some essential properties
57-
*
58-
* @return array Extension Check Result
276+
* @param $result
277+
* @return string
59278
*/
60-
public function checkSystem()
279+
public function renderRequirementValue($result)
61280
{
62-
return Mage::helper('firegento/firegento')->checkSystem();
281+
if ($result) {
282+
return 'requirement-passed';
283+
}
284+
return 'requirement-failed';
63285
}
64286
}

src/app/code/community/FireGento/Debug/Block/Diagnostic/Phpinfo.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ class FireGento_Debug_Block_Diagnostic_Phpinfo
4040
public function getPhpInfo()
4141
{
4242
ob_start();
43-
phpinfo();
44-
preg_match ('%<style type="text/css">(.*?)</style>.*?(<body>.*</body>)%s', ob_get_clean(), $matches);
45-
echo "<div class='phpinfodisplay' style='overflow:hidden'><style type='text/css'>\n",
46-
join( "\n",
47-
array_map(
48-
create_function(
49-
'$i',
50-
'return ".phpinfodisplay " . preg_replace( "/,/", ",.phpinfodisplay ", $i );'
51-
),
52-
preg_split( '/\n/', $matches[1] )
53-
)
54-
),
55-
"</style>\n",
56-
$matches[2],
57-
"\n</div>\n";
43+
phpinfo(-1);
44+
$phpinfo = ob_get_contents();
45+
ob_end_clean();
46+
47+
preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
48+
$output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]);
49+
$output = preg_replace('#(\w),(\w)#', '\1, \2', $output);
50+
$output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="1" cellspacing="1" cellpadding="4" width="100%"', $output);
51+
$output = preg_replace('#<hr />#', '', $output);
52+
$output = str_replace('<div class="center">', '', $output);
53+
$output = str_replace('</div>', '', $output);
54+
55+
return $output;
5856
}
5957
}

0 commit comments

Comments
 (0)