本文整理汇总了PHP中ezcBase::autoload方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcBase::autoload方法的具体用法?PHP ezcBase::autoload怎么用?PHP ezcBase::autoload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcBase
的用法示例。
在下文中一共展示了ezcBase::autoload方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __autoload
function __autoload($className)
{
try {
ezcBase::autoload($className);
} catch (Exception $e) {
echo $e->getMessage();
}
}
示例2: __autoload
function __autoload($className)
{
if (strpos($className, '_') !== false) {
$file = str_replace('_', '/', $className) . '.php';
@($val = (require_once $file));
return $val === true;
}
ezcBase::autoload($className);
}
示例3: glpiautoload
function glpiautoload($classname)
{
global $DEBUG_AUTOLOAD, $CFG_GLPI;
static $notfound = array();
// empty classname or non concerted plugin
if (empty($classname) || is_numeric($classname)) {
return false;
}
$dir = GLPI_ROOT . "/inc/";
//$classname="PluginExampleProfile";
if ($plug = isPluginItemType($classname)) {
$plugname = strtolower($plug['plugin']);
$dir = GLPI_ROOT . "/plugins/{$plugname}/inc/";
$item = strtolower($plug['class']);
// Is the plugin activate ?
// Command line usage of GLPI : need to do a real check plugin activation
if (isCommandLine()) {
$plugin = new Plugin();
if (count($plugin->find("directory='{$plugname}' AND state=" . Plugin::ACTIVATED)) == 0) {
// Plugin does not exists or not activated
return false;
}
} else {
// Standard use of GLPI
if (!in_array($plugname, $_SESSION['glpi_plugins'])) {
// Plugin not activated
return false;
}
}
} else {
// Is ezComponent class ?
if (preg_match('/^ezc([A-Z][a-z]+)/', $classname, $matches)) {
include_once GLPI_EZC_BASE;
ezcBase::autoload($classname);
return true;
} else {
$item = strtolower($classname);
}
}
// No errors for missing classes due to implementation
if (!isset($CFG_GLPI['missingclasses']) or !in_array($item, $CFG_GLPI['missingclasses'])) {
if (file_exists("{$dir}{$item}.class.php")) {
include_once "{$dir}{$item}.class.php";
if ($_SESSION['glpi_use_mode'] == DEBUG_MODE) {
$DEBUG_AUTOLOAD[] = $classname;
}
} else {
if (!isset($notfound["x{$classname}"])) {
// trigger an error to get a backtrace, but only once (use prefix 'x' to handle empty case)
//logInFile('debug',"file $dir$item.class.php not founded trying to load class $classname\n");
trigger_error("GLPI autoload : file {$dir}{$item}.class.php not founded trying to load class '{$classname}'");
$notfound["x{$classname}"] = true;
}
}
}
}
示例4: __autoload
function __autoload($className)
{
ezcBase::autoload($className);
}
示例5: __autoload
function __autoload($className)
{
ezcBase::autoload($className);
@(include SITE_ROOT . '/app/model/' . $className . '.php');
}
示例6: autoload
public static function autoload($className)
{
if (class_exists('ezcBase')) {
ezcBase::autoload($className);
}
}
示例7: glpi_autoload
/**
* To load classes
*
* @param $classname : class to load
**/
function glpi_autoload($classname)
{
global $DEBUG_AUTOLOAD, $CFG_GLPI;
static $notfound = array('xStates' => true, 'xAllAssets' => true);
// empty classname or non concerted plugin or classname containing dot (leaving GLPI main treee)
if (empty($classname) || is_numeric($classname) || strpos($classname, '.') !== false) {
die("Security die. trying to load an forbidden class name");
}
$dir = GLPI_ROOT . "/inc/";
if ($plug = isPluginItemType($classname)) {
$plugname = strtolower($plug['plugin']);
$dir = GLPI_ROOT . "/plugins/{$plugname}/inc/";
$item = strtolower($plug['class']);
// Is the plugin activate ?
// Command line usage of GLPI : need to do a real check plugin activation
if (isCommandLine()) {
$plugin = new Plugin();
if (count($plugin->find("directory='{$plugname}' AND state=" . Plugin::ACTIVATED)) == 0) {
// Plugin does not exists or not activated
return false;
}
} else {
// Standard use of GLPI
if (!in_array($plugname, $_SESSION['glpi_plugins'])) {
// Plugin not activated
return false;
}
}
} else {
// Is ezComponent class ?
if (preg_match('/^ezc([A-Z][a-z]+)/', $classname, $matches)) {
include_once GLPI_EZC_BASE;
ezcBase::autoload($classname);
return true;
}
// Do not try to load phpcas using GLPI autoload
if (preg_match('/^CAS_.*/', $classname)) {
return false;
}
// Do not try to load Zend using GLPI autoload
if (preg_match('/^Zend.*/', $classname)) {
return false;
}
// Do not try to load Simplepie using GLPI autoload
if (preg_match('/^SimplePie.*/', $classname)) {
return false;
}
$item = strtolower($classname);
}
if (file_exists("{$dir}{$item}.class.php")) {
include_once "{$dir}{$item}.class.php";
if (isset($_SESSION['glpi_use_mode']) && $_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
$DEBUG_AUTOLOAD[] = $classname;
}
} else {
if (!isset($notfound["x{$classname}"])) {
// trigger an error to get a backtrace, but only once (use prefix 'x' to handle empty case)
// trigger_error("GLPI autoload : file $dir$item.class.php not founded trying to load class '$classname'");
$notfound["x{$classname}"] = true;
}
}
}
示例8: webdav_autoload
/**
* Autoload ezc classes
*
* @param string $className
*/
function webdav_autoload($className)
{
ezcBase::autoload($className);
}
示例9: autoload
public static function autoload($class)
{
return ezcBase::autoload($class);
}
示例10: ezc_autoload
function ezc_autoload($className)
{
if (strpos($className, '_') === false) {
ezcBase::autoload($className);
}
}
示例11: __autoload
function __autoload($class)
{
ezcBase::autoload($class);
}
示例12: autoload
function autoload($class)
{
\ezcBase::autoload($class);
}
示例13: autoload
/**
* Autoload-Method
*
* @param string $class name of the class
*/
public function autoload($class)
{
ezcBase::autoload($class);
}
示例14: __autoload
/**
* Autoload ezc classes
*
* @param string $className
*/
function __autoload($className)
{
if (ezcBase::autoload($className)) {
return;
}
}