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


PHP Setting::getModules方法代码示例

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


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

示例1: array

<?php

## Setting initialization
Setting::initPath();
$basePath = Setting::getBasePath();
$modules = Setting::getModules();
## define config
$config = array('basePath' => $basePath, 'name' => !Setting::get('app.name') ? "Plansys" : Setting::get('app.name'), 'preload' => array('log', 'EJSUrlManager'), 'import' => array('app.models.*', 'application.models.*', 'application.forms.*', 'app.forms.*', 'app.components.utility.*', 'application.components.*', 'application.components.ui.*', 'application.components.ui.FormFields.*', 'application.components.ui.Widgets.*', 'application.components.utility.*', 'application.components.models.*', 'application.components.codegen.*', 'application.components.repo.*', 'application.behaviors.*', 'ext.YiiJasper.*'), 'runtimePath' => Setting::getRuntimePath(), 'sourceLanguage' => 'en_us', 'language' => 'id', 'modulePath' => Setting::getModulePath(), 'controllerMap' => Setting::getControllerMap(), 'modules' => array_merge($modules, array('nfy' => array('class' => 'nfy.NfyModule'))), 'aliases' => array('nfy' => Setting::getBasePath() . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'nfy'), 'components' => array('assetManager' => array('basePath' => Setting::getAssetPath()), 'img' => array('class' => 'application.extensions.simpleimage.CSimpleImage'), 'ldap' => Setting::getLDAP(), 'nfy' => array('class' => 'nfy.components.NfyDbQueue', 'id' => 'Notifications', 'timeout' => 30), 'todo' => array('class' => 'application.components.ui.Widgets.TodoWidget'), 'EJSUrlManager' => array('class' => 'ext.JSUrlManager.EJSUrlManager'), 'user' => array('allowAutoLogin' => true, 'class' => 'WebUser'), 'db' => Setting::getDB(), 'errorHandler' => array('class' => 'ErrorHandler'), 'log' => array('class' => 'CLogRouter', 'routes' => array(array('class' => 'CFileLogRoute', 'levels' => 'error, warning'))), 'widgetFactory' => array(), 'cache' => array('class' => 'system.caching.CFileCache'), 'clientScript' => array('packages' => array('jquery' => array('basePath' => "application.static.js.lib", 'js' => array('jquery.js'), 'coreScriptPosition' => CClientScript::POS_HEAD))), 'ePdf' => array('class' => 'ext.yiipdf.EYiiPdf', 'params' => array('HTML2PDF' => array('librarySourcePath' => 'application.extensions.html2pdf.*', 'classFile' => 'html2pdf.class.php')))), 'params' => array());
$config = Setting::finalizeConfig($config);
return $config;
开发者ID:reggi49,项目名称:plansys,代码行数:10,代码来源:main.php

示例2: prepareFormName

 public function prepareFormName($class, $module = null)
 {
     if (isset($module)) {
         if (is_string($module)) {
             $moduleList = Setting::getModules();
             if (isset($moduleList[$module])) {
                 $moduleAlias = $moduleList[$module]['class'];
                 $moduleClass = Helper::explodeLast(".", $moduleAlias);
                 Yii::import($moduleAlias);
                 if (@class_exists($moduleClass)) {
                     $module = new $moduleClass($module, null);
                 }
             }
         }
         if (!is_object($module)) {
             $module = null;
         }
     } else {
         if (!isset($module)) {
             if (isset($this->module)) {
                 $module = $this->module;
             }
         }
     }
     if (strpos($class, '.') > 0) {
         $className = Helper::explodeLast(".", $class);
         if (!class_exists($className, false)) {
             try {
                 Yii::import($class);
             } catch (CException $e) {
                 if ($module) {
                     $moduleAlias = Helper::getAlias($module->basePath);
                     Yii::import($moduleAlias . ".forms." . $class);
                 } else {
                     $reflection = new ReflectionClass($this);
                     $path = $reflection->getFileName();
                     if (strpos($path, Yii::getPathOfAlias('app')) === 0) {
                         Yii::import('app.forms.' . $class);
                     } else {
                         if (strpos($path, Yii::getPathOfAlias('application')) === 0) {
                             Yii::import('application.forms.' . $class);
                         }
                     }
                 }
             }
         }
         $class = $className;
     } else {
         if (isset($module)) {
             $module = $module->id;
             if (stripos($class, $module) !== 0) {
                 if (!@class_exists($class)) {
                     $class = ucfirst($module) . ucfirst($class);
                 }
             }
         }
     }
     return $class;
 }
开发者ID:rizabudi,项目名称:plansys,代码行数:59,代码来源:Controller.php

示例3: getCommandMap

 public static function getCommandMap($modules = null)
 {
     $commands = [];
     $modules = is_null($modules) ? Setting::getModules() : $modules;
     foreach ($modules as $m) {
         $moduleClass = explode(".", $m['class']);
         array_pop($moduleClass);
         $moduleName = array_pop($moduleClass);
         array_push($moduleClass, $moduleName);
         $modulePath = implode(".", $moduleClass);
         $path = Yii::getPathOfAlias($modulePath . ".commands");
         if (is_dir($path)) {
             $cmds = glob($path . DIRECTORY_SEPARATOR . "*.php");
             foreach ($cmds as $c) {
                 $dir = explode(DIRECTORY_SEPARATOR, $c);
                 $file = array_pop($dir);
                 $cmd = lcfirst(str_replace("Command.php", "", $file));
                 $commands[$moduleName . "." . $cmd] = ['class' => Helper::getAlias($c)];
             }
         }
     }
     return $commands;
 }
开发者ID:balitax,项目名称:plansys,代码行数:23,代码来源:Setting.php

示例4: getCommandMap

 public static function getCommandMap($modules = null)
 {
     $commands = [];
     $modules = is_null($modules) ? Setting::getModules() : $modules;
     foreach ($modules as $m) {
         $moduleClass = explode(".", $m['class']);
         array_pop($moduleClass);
         $moduleName = array_pop($moduleClass);
         array_push($moduleClass, $moduleName);
         $modulePath = implode(".", $moduleClass);
         $path = Yii::getPathOfAlias($modulePath . ".commands");
         if (is_dir($path)) {
             $cmds = glob($path . DIRECTORY_SEPARATOR . "*.php");
             foreach ($cmds as $c) {
                 $dir = explode(DIRECTORY_SEPARATOR, $c);
                 $file = array_pop($dir);
                 $cmd = lcfirst(str_replace("Command.php", "", $file));
                 $commands[$moduleName . "." . $cmd] = ['class' => Helper::getAlias($c)];
             }
         }
     }
     $commands['migrate'] = ['class' => 'system.cli.commands.MigrateCommand', 'migrationPath' => 'application.migrations', 'connectionID' => 'db', 'migrationTable' => 'p_migration'];
     return $commands;
 }
开发者ID:rizabudi,项目名称:plansys,代码行数:24,代码来源:Setting.php


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