mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Debug option to check php tags on addon files
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2007-02-08 20:09:07 $
|
| $Date: 2007-02-11 20:16:25 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +103,7 @@ class e107plugin
|
|||||||
|
|
||||||
// scan for addons.
|
// scan for addons.
|
||||||
$eplug_addons = $this->getAddons($plugin_path);
|
$eplug_addons = $this->getAddons($plugin_path);
|
||||||
|
// $eplug_addons = $this->getAddons($plugin_path,'check'); // Checks opening/closing tags on addon files
|
||||||
|
|
||||||
// See whether the plugin needs installation - it does if one or more variables defined
|
// See whether the plugin needs installation - it does if one or more variables defined
|
||||||
$no_install_needed = 1;
|
$no_install_needed = 1;
|
||||||
@@ -588,17 +589,26 @@ class e107plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return a list of available plugin addons for the specified plugin. e_xxx etc.
|
// return a list of available plugin addons for the specified plugin. e_xxx etc.
|
||||||
function getAddons($plugin_path,$debug=FALSE){
|
// $debug = TRUE - prints diagnostics
|
||||||
global $fl;
|
// $debug = 'check' - checks each file found for php tags - prints 'pass' or 'fail'
|
||||||
|
function getAddons($plugin_path,$debug=FALSE)
|
||||||
$p_addons = array();
|
{
|
||||||
foreach($this->plugin_addons as $e_xxx)
|
global $fl;
|
||||||
|
$p_addons = array();
|
||||||
|
foreach($this->plugin_addons as $e_xxx)
|
||||||
|
{
|
||||||
|
if(is_readable(e_PLUGIN.$plugin_path."/".$e_xxx.".php"))
|
||||||
{
|
{
|
||||||
if(is_readable(e_PLUGIN.$plugin_path."/".$e_xxx.".php"))
|
$passfail = '';
|
||||||
{
|
if ($debug == 'check')
|
||||||
$p_addons[] = $e_xxx;
|
{
|
||||||
}
|
$file_text = file_get_contents(e_PLUGIN.$plugin_path."/".$e_xxx.".php");
|
||||||
|
if ((substr($file_text,0,5) != '<'.'?php') || (substr($file_text,-2,2) !='?>')) $passfail = '<b>fail</b>'; else $passfail = 'pass';
|
||||||
|
echo $plugin_path."/".$e_xxx.".php - ".$passfail."<br />";
|
||||||
|
}
|
||||||
|
$p_addons[] = $e_xxx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!is_object($fl)){
|
if(!is_object($fl)){
|
||||||
require_once(e_HANDLER.'file_class.php');
|
require_once(e_HANDLER.'file_class.php');
|
||||||
@@ -638,7 +648,7 @@ class e107plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($debug)
|
if($debug==TRUE)
|
||||||
{
|
{
|
||||||
echo $plugin_path." = ".implode(",",$p_addons)."<br />";
|
echo $plugin_path." = ".implode(",",$p_addons)."<br />";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user