当前位置: 首页>>代码示例>>PHP>>正文


PHP Bootstrap::load方法代码示例

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


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

示例1: loadService

 private static function loadService($service)
 {
     try {
         $servicePath = SERVICES_PATH . '/' . $service . '/';
         Bootstrap::load($servicePath . 'interface.php');
         $implementationsPath = $servicePath . '/' . IMPLEMENTATIONS_DIR . '/';
         $directory = new DirectoryIterator($implementationsPath);
         foreach ($directory as $fileInfo) {
             if ($fileInfo->isFile()) {
                 //					self::$Logger->debug('Loading service "' . $fileInfo->getFilename() . '"...');
                 Bootstrap::load($implementationsPath . $fileInfo->getFilename());
             }
         }
     } catch (Exception $e) {
         self::$Logger->error('Cannot load service "' . $service . '"');
         if (self::$Logger->isDebugEnabled()) {
             self::$Logger->debug(ExceptionStackUtil::getStackTrace($e, false));
         }
         throw new EyeBootstrapException('Cannot load service "' . $service . '".', 0, $e);
     }
 }
开发者ID:sebasalons,项目名称:eyeos-u1db,代码行数:21,代码来源:Bootstrap.php

示例2: define

 * then we can do that logic over here and before toching the application itself we know the infomations
 * for translation, location wise redirect etc.
 * 
 * Here we are declaring an applicaiton constant so that our application know which environment is
 * currently active. This is used in config file as well
 */
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH), realpath(APPLICATION_PATH . '/../library'), get_include_path())));
/**
 * Include auto loader
 */
include_once 'Noobh/Loader/Autoloader.php';
/**
 * The following code can be added in application Bootstrap or t
 * index.php file where document root exist. By default all library
 * classes under Noobh will be autoloaded.
 */
$autoloader = Noobh_Loader_Autoloader::getInstance();
//$globalConfigs = array(GLOBAL_RESOURCE_PATH. '/conf/conf.php');
$config = Noobh_Config::getInstance(realpath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'application.ini'));
Noobh_Registry::set('config', $config);
/**
 * The following code can be added in application Bootstrap or
 * index.php file where document root exist. By default all library
 * classes under ISTWeb will be autoloaded.
 */
require_once realpath(APPLICATION_PATH) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
$bootstrap = new Bootstrap($config);
$bootstrap->load();
开发者ID:krishsenthil,项目名称:Docker-UserService,代码行数:30,代码来源:index.php

示例3: die

$options['config'] = array_key_exists('config', $opts) ? $opts['config'] : (array_key_exists('c', $opts) ? $opts['c'] : ROOT_PATH . '/app/etc/db.php');
$options['migration'] = array_key_exists('migration', $opts) ? $opts['migration'] : (array_key_exists('m', $opts) ? $opts['m'] : './migrations');
$options['bootstrap'] = array_key_exists('bootstrap', $opts) ? $opts['bootstrap'] : (array_key_exists('b', $opts) ? $opts['b'] : ROOT_PATH . '/app/bootstrap.php');
foreach ($options as $k => $v) {
    if (empty($v)) {
        die('fatal error: "' . $k . '" option must not be empty, please provide a valid value or let the default one');
    }
}
$environments = array('development', 'production', 'testing', 'staging');
foreach ($environments as $e) {
    if (preg_match('/^' . $options['environment'] . '/', $e)) {
        $options['environment'] = $e;
        break;
    }
}
define('ENV', $options['environment']);
ini_set('display_errors', true);
error_reporting(-1);
date_default_timezone_set('Europe/Paris');
//define('LIB_PATH',  ROOT_PATH . '/lib');
define('VENDOR_PATH', ROOT_PATH . '/vendor');
set_include_path(PATH_SEPARATOR . VENDOR_PATH);
// set up autoloader
//spl_autoload_register(function ($class) { include str_replace('\\', '/', $class) . '.php'; });
// include_once ROOT_PATH . '/app/autoload_register.php';
@(include_once __DIR__ . '/../vendor/autoload.php') || @(include_once __DIR__ . '/../../../autoload.php');
include_once $options['bootstrap'];
$bootstrap = new Bootstrap(array('options' => $options, 'argv' => $argv));
$resources = $bootstrap->load();
$application = new \Incube\Event\Application('shootmania_admin', $resources['event_manager']);
$application->set_resources($resources)->start();
开发者ID:incubatio,项目名称:yam,代码行数:31,代码来源:yam.php


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