• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Autoload类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Autoload的典型用法代码示例。如果您正苦于以下问题:PHP Autoload类的具体用法?PHP Autoload怎么用?PHP Autoload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Autoload类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: cmdRepo

 function cmdRepo()
 {
     $file = new File('/home/billy/1.tar.bz2', true);
     $target = new Dir('/home/billy/temp/1.unpack/includes', true);
     //Packer::unpack($file, $target);
     Packer::pack($target, new File(dirname(__FILE__) . '/2.tbz', true));
     return;
     $pm = new PM();
     $pm->startup();
     $rb = PM::getRollback();
     $rb->push('delete', dirname(__FILE__) . '/_files/source', dirname(__FILE__) . '/_files/target/includes/Controller.php');
     //$rb->push('delete', './_files/source', '_files/target/includes/Controller.php' );
     //$r = $rb->pop();
     $r = $rb->stepBack();
     print_r($r);
     return;
     $ps = PM::getPackageSequence();
     print_r($ps->get());
     print_r($ps->getAfter('news', '2.3'));
     //print_pre($ps->addPackage('news', '2.8'));
     print_pre($ps->removePackage('news', '2.8'));
     return;
     Autoload::addDir(Dir::get($this->root, true)->getDir('repo'));
     $rl = new RepositoryList($this->dataDir->getFile('source.list'));
     $r = $rl->search(explode(' ', 'qt package'));
     print_pre($r);
     $pm->shutdown();
 }
开发者ID:point,项目名称:cassea,代码行数:28,代码来源:PackageManagerFacade.php


示例2: _setAutoload

 /**
  * 自动载入函数
  */
 private function _setAutoload()
 {
     //自动载入函数
     require_once dirname(__FILE__) . '/../LaneSmartFW/Autoload.php';
     $autoload = new Autoload();
     $autoload->register();
 }
开发者ID:MingOrganization,项目名称:LaneSmartFW,代码行数:10,代码来源:App.php


示例3: init

 public function init()
 {
     require_once __DIR__ . '/class.autoload.php';
     //	1. ИНИЦИАЛИЗАЦИЯ КЛАССА АВТОЗАГРУЗКИ
     $loaddata = array('prefix' => 'class.');
     $autoload = new Autoload($loaddata);
     $autoload->add(FRAMEWORK_ROOT_FOLDER);
     $autoload->add(PROJECT_ROOT_DIRECTORY);
     $autoload->register();
     //	2. ОСУЩЕСТВЛЕНИЕ ПОДКЛЮЧЕНИЯ К БАЗЕ ДАННЫХ
     self::$instance->connection = new \framework\database\mySqlConnect('localhost', 'root', '', 'craiglist');
     //	3. ЗАГРУЗКА ШАБЛОНА ПРОЕКТИРОВАНИЯ MVC
     $controller = new \framework\mvc\FrontController(PROJECT_ROOT_DIRECTORY);
     $controller->run();
 }
开发者ID:WrathOfFlame,项目名称:craigslist,代码行数:15,代码来源:class.core.php


示例4: install

 public function install()
 {
     if (!defined('_IS_AGILE_DEV_') && !empty(self::$_newfiles) && !Tools::getValue("redirected")) {
         $adminfolder = AgileInstaller::detect_admin_folder($_SERVER['SCRIPT_FILENAME']);
         AgileInstaller::install_newfiles(self::$_newfiles, $this->name, $adminfolder, 2);
         $result = AgileInstaller::install_health_check(self::$_newfiles, $this->name, $adminfolder);
         if (!empty($result)) {
             $this->_errors[] = '<a target="agile" style="text-decoration:underline;color:blue;" href="http://addons-modules.com/store/en/content/36-agile-module-installation-tips">' . $this->getL('Failed to update files due to permission issue, please visit here for more instructions.') . '</a>';
             return false;
         }
         Tools::redirectAdmin("./index.php?controller=AdminModules&token=" . Tools::getValue("token") . "&install=" . $this->name . "&tab_module=" . $this->tab . " &module_name=" . $this->name . "&anchor=anchor" . $this->name . "&redirected=1");
     }
     $reterrs = AgileInstaller::CanModuleOverride($this->name);
     if (!empty($reterrs)) {
         $this->_errors = array_merge($this->_errors, $reterrs);
         return false;
     }
     $reterrs = AgileInstaller::version_depencies($this->version_dependencies);
     if (!empty($reterrs)) {
         $this->_errors = array_merge($this->_errors, $reterrs);
         return false;
     }
     if (!AgileInstaller::sql_install(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE)) {
         return false;
     }
     if (!parent::install() or !Configuration::updateValue('AGILE_PAYPAL_BUSINESS', '[email protected]') or !Configuration::updateValue('AGILE_PAYPAL_SANDBOX', 1) or !Configuration::updateValue('AGILE_PAYPAL_FORCE_SUMMARY', '1') or !Configuration::updateValue('AGILE_PAYPAL_HIDE_COUNTRY', 0) or !Configuration::updateValue('AGILE_PAYPAL_HIDE_CARRIER', 0) or !Configuration::updateValue('AGILE_PAYPAL_HIDE_TERMS', 0) or !Configuration::updateValue('AGILE_PAYPAL_HEADER', '') or !Configuration::updateValue('AGILE_PAYPAL_RECURRING_PAYMENT', 0) or !Configuration::updateValue('AGILE_PAYPAL_RECURRING_DAILY', 0) or !Configuration::updateValue('AGILE_PAYPAL_RECURRING_WEEKLY', 0) or !Configuration::updateValue('AGILE_PAYPAL_RECURRING_MONTHLY', 0) or !Configuration::updateValue('AGILE_PAYPAL_RECURRING_YEARLY', 0) or !Configuration::updateValue('AGILE_PAYPAL_SUPPORT_SELLERS', 0) or !Configuration::updateValue('AGILE_PAYPAL_BUSINESS2', '') or !Configuration::updateValue('AGILE_PAYPAL_MICRO_AMOUNT', 0) or !Configuration::updateValue('AGILE_PAYPAL_EXPRESS_ENABLED', 1) or !Configuration::updateValue('AGILE_PAYPAL_AM_INTEGRATED', 0) or !Configuration::updateValue('AGILE_PAYPAL_AM_SHOW_CHOICE', 0) or !Configuration::updateValue('AGILE_PAYPAL_AM_NO_MIX_PRODUCT', 0) or !Configuration::updateValue('AGILE_PAYPAL_SUBSCRIBE_ONLY', 0) or !Configuration::updateValue('AGILE_PAYPAL_CURRENCY', Configuration::get('PS_CURRENCY_DEFAULT')) or !$this->registerHook('agileexpresscheckout') or !$this->registerHook('displayShoppingCartFooter') or !$this->registerHook('displayProductButtons') or !$this->registerHook('displayPayment') or !$this->registerHook('displayPaymentReturn') or !$this->registerHook('displayFooter')) {
         return false;
     }
     if (version_compare(_PS_VERSION_, '1.5', '>=')) {
         Autoload::getInstance()->generateIndex();
     }
     return true;
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:33,代码来源:agilepaypalbase.php


示例5: toss

 static function toss($message = null, $type = 'Exception', $code = 0, $previous = null)
 {
     if (!Autoload::loaded($type)) {
         eval('class ' . $type . ' extends Exception{}');
     }
     throw new $type($message, $code, $previous);
 }
开发者ID:jstacoder,项目名称:brushfire,代码行数:7,代码来源:Debug.php


示例6: init

 /**
  * Get an instance of Autoload.
  *
  * @return self
  */
 public static final function init() : self
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:froq,项目名称:froq-beta-archive,代码行数:12,代码来源:Autoload.php


示例7: loadController

 private static final function loadController()
 {
     $view = \View\ViewBundle::getInstance();
     //$view -> setTemplate( KIT_VIEW_TEMPLATE );
     ////\View\ViewBundle::getInstance() -> setVar( 'path', self::$_path );
     self::prepareController();
     $space = 'App\\Controllers\\' . self::$_controller . 'Controller';
     $e404 = ['controller' => self::$_controller, 'action' => self::$_action];
     if (!\Autoload::nameSpaceExists($space)) {
         return $view->e404($e404);
     }
     $cont = new $space();
     $cont->setTpl(self::$_controller . '/' . self::$_action);
     $act_method = "action" . self::$_action;
     /**
      * Проверка существования метода экшена и выполнение его, или стандартного
      * метода 404 ошибки.
      */
     if (method_exists($cont, $act_method)) {
         $cont->{$act_method}(self::$_furl);
         $cont->exir();
     } else {
         $view->e404($e404);
     }
 }
开发者ID:deale,项目名称:dt,代码行数:25,代码来源:FrontControllerAbstract.php


示例8: instance

 /**
  * Get the instane of Autoload
  *
  * @access public
  * @static
  * @return Autoload
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new Autoload();
     }
     return self::$instance;
 }
开发者ID:phalasz,项目名称:aStyler,代码行数:14,代码来源:Autoload.php


示例9: get_modules

	protected function get_modules(Query $query) {
		$url = $query->url();
		array_shift($url);
		$url = array_filter($url);

		if (empty($url)) {
			return array();
		}

		$last = array_pop($url);
		$last = preg_replace_callback('/_([a-z])/', function($res){
			return strtoupper($res[1]);
		}, $last);
		$url[] = $last;

		$class = implode('', array_map('ucfirst', $url));
		$class = \Autoload::getDefaultNamespace() . '\Module\Ajax' . $class;

		if (!class_exists($class)) {
			if ($query->get('format') == 'json') {
				return new AjaxJsonError($query);
			} else {
				return new AjaxError($query);
			}
		}

		return new $class($query);
	}
开发者ID:4otaku,项目名称:framework,代码行数:28,代码来源:Ajax.php


示例10: getInstance

 /**
  * 
  * @return Autoload
  */
 public static function getInstance()
 {
     if (self::$instance === false) {
         self::$instance = new Autoload();
     }
     return self::$instance;
 }
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:11,代码来源:Autoload.class.php


示例11: initAutoload

 private function initAutoload()
 {
     if ($this->preferencesList->useRapidAuthorizationAutoload) {
         Autoload::instance()->init();
     }
     return;
 }
开发者ID:maykonn,项目名称:rapid-authorization,代码行数:7,代码来源:ClientPreferences.php


示例12: __autoload

function __autoload($className)
{
    $classes = Autoload::getClasses();
    if ($classes[$className] && file_exists($classes[$className])) {
        require_once $classes[$className];
    }
}
开发者ID:Tomeno,项目名称:lulcobang,代码行数:7,代码来源:auto.php


示例13: inst

 /**
  * Метод возвращает экземпляр класса-хранилища маппингов.
  * Может быть переопределён в config.ini
  */
 private static final function inst()
 {
     if (isset(self::$inst)) {
         return self::$inst;
         //----
     }
     /*
      * Получим название класса
      */
     $class = ConfigIni::mappingStorage();
     /*
      * Класс совпадает с базовым?
      */
     if (__CLASS__ == $class) {
         return self::$inst = new MappingStorage();
     }
     /*
      * Нам передан класс, который отличается от SDK
      */
     $classPath = Autoload::inst()->getClassPath($class);
     if (!PsCheck::isNotEmptyString($classPath)) {
         return PsUtil::raise('Не удалось найти класс хранилища маппингов [{}]', $class);
     }
     /*
      * Указанный класс должен быть наследником данного
      */
     if (!PsUtil::isInstanceOf($class, __CLASS__)) {
         return PsUtil::raise('Указанное хранилище маппингов [{}] не является наследником класса [{}]', $class, __CLASS__);
     }
     return self::$inst = new $class();
 }
开发者ID:ilivanoff,项目名称:ps-sdk-dev,代码行数:35,代码来源:MappingStorage.php


示例14: StartCurator

/**
 * Preps the application for running, then runs it. If this function is called more than once, an E_USER_ERROR is triggered.
 * 
 * @param string $root_dir The path to the root of the installation.
 * @return void
 */
function StartCurator()
{
    static $did_start = false;
    // set up the exit status.
    $exit_status = 0;
    // make sure this is only run once.
    if ($did_start === false) {
        $autoload = Autoload::singleton();
        // configure the autoloader.
        try {
            $autoload->setBaseDir(CURATOR_APP_DIR);
            $autoload->register();
        } catch (\Exception $e) {
            Console::stderr('** Could not register the autoloader:');
            Console::stderr('   ' . $e->getMessage());
            die;
        }
        // once the autoloader is in place, we are started up.
        $did_start = true;
        try {
            $app = new Application();
            $exit_status = $app->run();
        } catch (\Exception $e) {
            Console::stderr('** Could not run the application:');
            Console::stderr('   ' . $e->getMessage());
            die;
        }
    } else {
        // if we are called again, bail.
        trigger_error('StartCurator called after already being called.', E_USER_ERROR);
    }
    // send the status back.
    return $exit_status;
}
开发者ID:hscale,项目名称:curator,代码行数:40,代码来源:Bootstrap.php


示例15: getInstance

 /**
  * Get instance of autoload (singleton)
  *
  * @return Autoload
  */
 public static function getInstance()
 {
     if (!Autoload::$instance) {
         Autoload::$instance = new Autoload();
     }
     return Autoload::$instance;
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:12,代码来源:Autoload.php


示例16: upgrade_module_1_2_0

function upgrade_module_1_2_0($eu_legal)
{
    $result = true;
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/cashondelivery.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/cashondelivery.zip');
    }
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/gc_ganalytics.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/gc_ganalytics.zip');
    }
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/moneybookers.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/moneybookers.zip');
    }
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/paypal.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/paypal.zip');
    }
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/sofortbanking.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/sofortbanking.zip');
    }
    if (is_file(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/trustedshops.zip')) {
        $result &= unlink(_PS_MODULE_DIR_ . $eu_legal->name . '/modules/trustedshops.zip');
    }
    Autoload::getInstance()->generateIndex();
    $result &= $eu_legal->deleteOverrides('CMSController');
    Autoload::getInstance()->generateIndex();
    return (bool) $result;
}
开发者ID:juanchog,项目名称:modules-1.6.0.12,代码行数:26,代码来源:upgrade-1.2.0.php


示例17: suite

 public static function suite()
 {
     Autoload::registerNamespaced();
     $suite = new PHPUnit_Framework_TestSuite('aStyler');
     $suite->addTest(tests_aStyler_Parser_SGML_AllTests::suite());
     $suite->addTest(tests_aStyler_Lexer_SGML_AllTests::suite());
     return $suite;
 }
开发者ID:phalasz,项目名称:aStyler,代码行数:8,代码来源:AllTests.php


示例18: init

 static function init()
 {
     $processor = Config::getInstance()->language->processor;
     $classname = nameToClass($processor) . 'LanguageProcessor';
     Autoload::addVendor('language', $processor);
     self::$processor = new $classname();
     self::$processor->init();
 }
开发者ID:point,项目名称:cassea,代码行数:8,代码来源:Language.php


示例19: init

 public static function init($directories)
 {
     self::$directories = (array) $directories;
     self::init_cache();
     spl_autoload_register("Autoload::cache", false);
     spl_autoload_register("Autoload::normal", false);
     spl_autoload_register("Autoload::wrapper", false);
     register_shutdown_function("Autoload::write_cache");
 }
开发者ID:4otaku,项目名称:4otaku,代码行数:9,代码来源:autoloader.php


示例20: init

 /**
  * Load config file, setup autoload paths
  *
  * @param string $file
  * @return void
  */
 public static function init($file)
 {
     if (is_readable(DOCUMENT_ROOT . '/' . $file)) {
         self::$paths = (require $file);
         spl_autoload_register(array('Autoload', 'load'));
     } else {
         exit("fail setup autoloding paths");
     }
 }
开发者ID:smith46102,项目名称:koda,代码行数:15,代码来源:autoload.php



注:本文中的Autoload类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Autoloader类代码示例发布时间:2022-05-23
下一篇:
PHP AutoLoader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap