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


PHP AppContext::load方法代码示例

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


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

示例1: show_error

 function &addPlugin($name, $directory)
 {
     if ($this->pluginExists($name)) {
         show_error('PluginManager', 'Plugin with name "' . $name . '" exists already.');
     }
     $plugin =& new Plugin($name, $directory);
     $pluginContext = file_exists($directory . '/plugin-context.yml') ? $directory . '/plugin-context.yml' : null;
     if ($pluginContext) {
         AppContext::load($pluginContext);
     }
     $bootstrap = file_exists($directory . '/bootstrap' . EXT) ? $directory . '/bootstrap' . EXT : null;
     if ($bootstrap) {
         include $bootstrap;
     }
     $this->plugins[$name] =& $plugin;
     return $plugin;
 }
开发者ID:qlixes,项目名称:springphp,代码行数:17,代码来源:PluginManager.php

示例2: substr

 function &loadTheme($name)
 {
     if (str_ends_with($this->themesDir, '/')) {
         $this->themesDir = substr($this->themesDir, 0, strlen($this->themesDir) - 1);
     }
     $themeDir = $this->themesDir . '/' . $name . '/';
     if (is_dir($themeDir)) {
         $themeContext = file_exists($themeDir . '/theme-context.yml') ? $themeDir . '/theme-context.yml' : null;
         if ($themeContext) {
             AppContext::load($themeContext);
         }
         $bootstrap = file_exists($themeDir . '/bootstrap' . EXT) ? $themeDir . '/bootstrap' . EXT : null;
         if ($bootstrap) {
             include $bootstrap;
         }
         $theme =& new Theme($name, $themeDir);
         return $theme;
     }
     show_error('ThemeManager', 'Specified theme doesn\'t exist: ' . $name);
 }
开发者ID:qlixes,项目名称:springphp,代码行数:20,代码来源:ThemeManager.php

示例3: define

define('EXT', '.' . pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('ROOTPATH', $realpath);
define('BASEPATH', $system_folder . '/');
define('APPPATH', $application_folder . '/');
//load the system
require BASEPATH . 'bootstrap' . EXT;
// The 3 GLOBALs
$request =& new Request();
$response =& new Response();
$appContext =& new AppContext();
//starts output buffering
$response->start();
//bootstrap the app if needed
if (file_exists(APPPATH . 'bootstrap' . EXT)) {
    include APPPATH . 'bootstrap' . EXT;
}
//load the application
AppContext::load(APPPATH . '/config/app-context.yml');
//load any plugins? - NOTE: plugins can override core behavior and add new controllers
autodiscover_plugins();
//display cache after loading plugins but before calling Dispatcher
if ($response->displayCache() !== TRUE) {
    //handle the request
    $dispatcher =& AppContext::createAutowiredService('Dispatcher');
    $dispatcher->process(&$request, &$response);
}
//send the response to the browser
$response->flush();
// flushs output buffering
开发者ID:qlixes,项目名称:springphp,代码行数:31,代码来源:index.php


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