本文整理汇总了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];
}
示例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;
}
示例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;
}
示例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');
}
}
示例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;
}
}
示例6: load_info
protected function load_info()
{
$this->aInfo = Loader::loadConfigFile(RX_PATH . '/ruxon/modules/' . $this->sModuleAlias, 'module');
return true;
}