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


PHP Loader::loadConfigFile方法代码示例

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


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

示例1: loadMessages

 protected function loadMessages($category, $language, $basePath)
 {
     if (empty($this->messages[$basePath][$category])) {
         $this->messages[$basePath][$category] = \Loader::loadConfigFile(RX_PATH . '/' . $basePath . '/' . $language, $category);
     }
     return $this->messages[$basePath][$category];
 }
开发者ID:ruxon,项目名称:framework,代码行数:7,代码来源:PhpMessageSource.class.php

示例2: init

 public function init($sName, $sLayout = 'index')
 {
     $this->sName = $sName;
     $this->sPath = Core::app()->config()->getThemesPath() . '/' . $sName;
     $this->sUrl = Core::app()->config()->getThemesUrl() . '/' . $sName;
     $classLayout = $this->layoutClass;
     $this->oLayout = new $classLayout($sLayout);
     $aTheme = Loader::loadConfigFile(Core::app()->config()->getThemesPath() . '/' . $sName, 'theme');
     if ($aTheme && isset($aTheme['Client']['Packages']) && count($aTheme['Client']['Packages'])) {
         foreach ($aTheme['Client']['Packages'] as $itm) {
             Core::app()->client()->registerPackage($itm);
         }
     }
     if ($aTheme && isset($aTheme['Client']['ScriptFiles']) && count($aTheme['Client']['ScriptFiles'])) {
         foreach ($aTheme['Client']['ScriptFiles'] as $itm) {
             Core::app()->client()->registerScriptFile($itm);
         }
     }
     if ($aTheme && isset($aTheme['Client']['CssFiles']) && count($aTheme['Client']['CssFiles'])) {
         foreach ($aTheme['Client']['CssFiles'] as $itm) {
             Core::app()->client()->registerCssFile($itm);
         }
     }
     return true;
 }
开发者ID:ruxon,项目名称:framework,代码行数:25,代码来源:Theme.class.php

示例3: install

 /**
  * Install: module install action
  *
  * @return boolean
  */
 public function install()
 {
     $module = Core::app()->getModuleById($this->sModuleAlias);
     if (!$module) {
         // 1. add row to the modules table
         $moduleDir = RX_PATH . '/ruxon/modules/' . $this->sModuleAlias;
         $info = Loader::loadConfigFile($moduleDir, 'module');
         $module = array('Name' => $info['Name'], 'Description' => $info['Description'], 'Version' => $info['Version'], 'DbRevision' => '-1');
         Core::app()->updateModuleById($this->sModuleAlias, $module);
         $sClassName = $this->sModuleAlias . 'Module';
         $classNameWithNamespaces = '\\ruxon\\modules\\' . $this->sModuleAlias . '\\classes\\' . $sClassName;
         Manager::getInstance()->setModule($this->sModuleAlias, class_exists($classNameWithNamespaces) ? new $classNameWithNamespaces() : new $sClassName());
         // 2. create table structure
         $migrator = new MysqlDbMigrator($this->sModuleAlias);
         $migrator->migrateTo('last');
         // 3. copy default config to config folder
         $file1 = RX_PATH . '/ruxon/modules/' . $this->sModuleAlias . '/config/module.inc.php';
         $file2 = RX_PATH . '/ruxon/config/modules/' . $this->sModuleAlias . '.inc.php';
         if (file_exists($file1) && !file_exists($file2)) {
             copy($file1, $file2);
         }
         return true;
     }
     return false;
 }
开发者ID:ruxon,项目名称:framework,代码行数:30,代码来源:BaseModuleInstaller.class.php

示例4: __construct

 public function __construct($aConfig = array())
 {
     $this->execution_start = microtime(true);
     $module = Core::app()->getModuleById($this->sModuleAlias);
     $infoPath = empty($module['BasePath']) ? RX_PATH . '/ruxon/modules/' . $this->sModuleAlias . '/components/' . $this->sComponentAlias : RX_PATH . '/' . $module['BasePath'] . '/components/' . $this->sComponentAlias;
     $this->aContainer = Loader::loadConfigFile($infoPath, 'component');
     $this->init($aConfig);
     $this->setComponentResponse(new ComponentResponse());
     if (!$this->getComponentRequest()->getTemplate()) {
         $this->getComponentRequest()->setTemplate('Index');
     }
 }
开发者ID:ruxon,项目名称:framework,代码行数:12,代码来源:Component.class.php

示例5: renderPackages

 public function renderPackages()
 {
     if (Core::app()->checkInstalledModule($this->assetsModule)) {
         Core::import("Modules." . $this->assetsModule);
         $assetsUrl = Manager::getInstance()->getModule($this->assetsModule)->publishAssets();
         $assetsPath = Manager::getInstance()->getModule($this->assetsModule)->pathAssets();
         $sResult = '';
         if (count($this->aPackages)) {
             foreach ($this->aPackages as $package) {
                 $aPackage = Loader::loadConfigFile($assetsPath . '/' . $package, 'package');
                 if (isset($aPackage['Includes']) && count($aPackage['Includes'])) {
                     foreach ($aPackage['Includes'] as $file) {
                         $sExt = mb_substr($file, mb_strrpos($file, ".") + 1);
                         $file_path = str_replace("~/", $assetsPath . '/' . $package . '/', $file);
                         $file = str_replace("~/", $assetsUrl . '/' . $package . '/', $file);
                         switch ($sExt) {
                             case 'js':
                                 $sResult .= '<script type="text/javascript" src="' . $file . '"></script>';
                                 $sResult .= "\n\t";
                                 break;
                             case 'css':
                                 $sResult .= '<link href="' . $file . '" type="text/css" rel="stylesheet" />';
                                 $sResult .= "\n\t";
                                 break;
                             case 'tpl':
                                 $sResult .= file_get_contents($file_path);
                                 $sResult .= "\n\t";
                                 break;
                         }
                     }
                 }
             }
         }
         return $sResult;
     }
 }
开发者ID:ruxon,项目名称:framework,代码行数:36,代码来源:Client.class.php

示例6: load_info

 protected function load_info()
 {
     $this->aInfo = Loader::loadConfigFile(RX_PATH . '/ruxon/modules/' . $this->sModuleAlias, 'module');
     return true;
 }
开发者ID:ruxon,项目名称:framework,代码行数:5,代码来源:BaseModule.class.php


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