mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
__autoload handles core handlers now
This commit is contained in:
parent
20bdd8a7bd
commit
df36ed2f6c
50
class2.php
50
class2.php
@ -9,8 +9,8 @@
|
|||||||
* General purpose file
|
* General purpose file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
* $Revision: 1.149 $
|
* $Revision: 1.150 $
|
||||||
* $Date: 2009-10-01 15:05:41 $
|
* $Date: 2009-10-20 16:00:38 $
|
||||||
* $Author: secretr $
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -879,7 +879,7 @@ if (!function_exists('checkvalidtheme'))
|
|||||||
$sql->db_Mark_Time('Start: Misc Setup');
|
$sql->db_Mark_Time('Start: Misc Setup');
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------------------------------------------------//
|
||||||
if (!class_exists('e107table'))
|
if (!class_exists('e107table', false))
|
||||||
{
|
{
|
||||||
class e107table
|
class e107table
|
||||||
{
|
{
|
||||||
@ -1248,11 +1248,11 @@ else
|
|||||||
define('e_REFERER_SELF', FALSE);
|
define('e_REFERER_SELF', FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//BC, DEPRECATED - use e107::getDateConvert()
|
//BC, DEPRECATED - use e107::getDateConvert(), catched by __autoload as well
|
||||||
if (!class_exists('convert'))
|
/*if (!class_exists('convert'))
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER.'date_handler.php');
|
require_once(e_HANDLER.'date_handler.php');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//@require_once(e_HANDLER."IPB_int.php");
|
//@require_once(e_HANDLER."IPB_int.php");
|
||||||
//@require_once(e_HANDLER."debug_handler.php");
|
//@require_once(e_HANDLER."debug_handler.php");
|
||||||
@ -2099,18 +2099,38 @@ function plugInstalled($plugname)
|
|||||||
return isset($pref['plug_installed'][$plugname]);*/
|
return isset($pref['plug_installed'][$plugname]);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function __autoload($className) {
|
/**
|
||||||
$tmp = explode('_', $className);
|
* Magic autoload
|
||||||
//TODO: Make it support core classes in e107_handlers
|
* TODO - move to spl_autoload[_*] some day (PHP5 > 5.1.2)
|
||||||
if('plugin' !== $tmp[0]) { return; }
|
* @param string $className
|
||||||
if('plugin' == $tmp[0])
|
* @return void
|
||||||
|
*/
|
||||||
|
function __autoload($className)
|
||||||
|
{
|
||||||
|
//Security...
|
||||||
|
if (strpos($className, '/') !== false)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$tmp = explode('_', $className);
|
||||||
|
|
||||||
|
switch($tmp[0])
|
||||||
|
{
|
||||||
|
case 'plugin':
|
||||||
|
case 'eplug_':
|
||||||
array_shift($tmp);
|
array_shift($tmp);
|
||||||
$filename = e_PLUGIN.implode('/', $tmp).'.php';
|
$filename = e_PLUGIN.implode('/', $tmp).'.php';
|
||||||
|
//TODO add debug screen Auto-loaded classes - ['plugin: '.$filename.' - '.$className];
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: //core libraries
|
||||||
|
$filename = e107::getHandlerPath($className, true);
|
||||||
|
//TODO add debug screen Auto-loaded classes - ['core: '.$filename.' - '.$className];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if($filename)
|
||||||
{
|
{
|
||||||
$filename = e_HANDLER.implode('/', $tmp).'.php';
|
include($filename);
|
||||||
}
|
}
|
||||||
require_once($filename);
|
}
|
||||||
} // end __autoload
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
* e107 Shortcode handler
|
* e107 Shortcode handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
|
||||||
* $Revision: 1.33 $
|
* $Revision: 1.34 $
|
||||||
* $Date: 2009-09-25 20:15:19 $
|
* $Date: 2009-10-20 16:00:37 $
|
||||||
* $Author: secretr $
|
* $Author: secretr $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -216,8 +216,6 @@ class e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register Plugin Shortcode Batch files (e_shortcode.php) for use site-wide.
|
* Register Plugin Shortcode Batch files (e_shortcode.php) for use site-wide.
|
||||||
* Equivalent to multiple .sc files in the plugin's folder.
|
* Equivalent to multiple .sc files in the plugin's folder.
|
||||||
@ -260,6 +258,7 @@ class e_shortcode
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register Core Shortcode Batches.
|
* Register Core Shortcode Batches.
|
||||||
|
* FIXME - currently loaded all the time (even on front-end)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function loadCoreShortcodes()
|
function loadCoreShortcodes()
|
||||||
@ -392,7 +391,7 @@ class e_shortcode
|
|||||||
$_method = 'sc_'.strtolower($code);
|
$_method = 'sc_'.strtolower($code);
|
||||||
if(!isset($this->scClasses[$_class]))
|
if(!isset($this->scClasses[$_class]))
|
||||||
{
|
{
|
||||||
if(!class_exists($_class) && $this->registered_codes[$code]['path'])
|
if(!class_exists($_class, false) && $this->registered_codes[$code]['path'])
|
||||||
{
|
{
|
||||||
include_once($this->registered_codes[$code]['path']);
|
include_once($this->registered_codes[$code]['path']);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user