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


PHP Config::factory方法代码示例

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


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

示例1: run

 /**
  * (non-PHPdoc)
  * @see Bgtask_Abstract::run()
  */
 public function run()
 {
     $lang = Lang::lang();
     $appConfig = Registry::get('main', 'config');
     $deployCfg = Config::factory(Config::File_Array, $appConfig->get('configs') . 'deploy.php');
     $this->setTotalCount(3);
     $dirName = $deployCfg->get('datadir') . $this->_config['server'] . DIRECTORY_SEPARATOR . date('Y-m-d_H_i_s');
     if (!is_dir($dirName) && !mkdir($dirName, 0775, true)) {
         $this->error($lang->CANT_WRITE_FS . '(' . $dirName . ')');
     }
     $dirName .= DIRECTORY_SEPARATOR;
     $this->_nextStep();
     if (isset($this->_config['files']) && !empty($this->_config['files']) && is_array($this->_config['files'])) {
         if (!File::zipFiles($dirName . 'www.zip', $this->_config['files'], $dirName)) {
             $this->error($lang->CANT_WRITE_FS . '(' . $dirName . 'www.zip' . ')');
         }
     }
     $this->_nextStep();
     if (isset($this->_config['files_delete']) && !empty($this->_config['files_delete']) && is_array($this->_config['files_delete'])) {
         if (!@file_put_contents($dirName . 'delete.txt', implode("\n", $this->_config['files_delete']))) {
             $this->error($lang->CANT_WRITE_FS . '(' . $dirName . 'delete.txt' . ')');
         }
         if (!File::zipFiles($dirName . 'www.zip', array($dirName . 'delete.txt'), $dirName)) {
             $this->error($lang->CANT_WRITE_FS . '(' . $dirName . 'www.zip' . ')');
         }
         unlink($dirName . 'delete.txt');
     }
     $this->_nextStep();
     $this->finish();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:34,代码来源:Archive.php

示例2: factory

 /**
  * @return Login
  * @param array $params
  * @param Zend_Db_Adapter_Pdo_Pgsql $dbTable
  */
 public static function factory(array $params = array(), $dbTable = NULL)
 {
     if (is_null($dbTable)) {
         $dbTable = Config::factory()->buildDBConfig()->getZendDbTable();
     }
     return new self($params, $dbTable);
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:12,代码来源:Login.php

示例3: getTranslation

 /**
  * Get object fields translation
  * @param boolean $autoCreate , otional default - true
  * @return Config_Abstract | boolean false
  */
 public function getTranslation($autoCreate = true)
 {
     if ($this->_translation) {
         return $this->_translation;
     }
     if (!file_exists($this->_mainConfig)) {
         if (!$autoCreate) {
             return false;
         }
         //create translation config
         if (!Config_File_Array::create($this->_mainConfig)) {
             return false;
         }
     }
     $this->_translation = Config::factory(Config::File_Array, $this->_mainConfig);
     if (!empty($this->_extTranslations)) {
         foreach ($this->_extTranslations as $path) {
             $extCfg = Config::factory(Config::File_Array, $path);
             foreach ($extCfg as $k => $v) {
                 if (!$this->_translation->offsetExists($k)) {
                     $this->_translation->set($k, $v);
                 }
             }
         }
     }
     return $this->_translation;
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:32,代码来源:Translator.php

示例4: getConfig

 /**
  * Get the Config object
  *
  * @return Config
  */
 public function getConfig()
 {
     if ($this->config === null) {
         $this->config = Config::factory();
     }
     return $this->config;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:12,代码来源:RequestContext.php

示例5: validateUserLocal

 /**
  * @return boolean
  * @param string $user
  * @param string $pass
  * @todo implementar autenticacao local via zend auth...
  */
 public function validateUserLocal($user, $pass, Zend_Db_Adapter_Pdo_Abstract $zendDbAdapter, $alwaysAllow = false)
 {
     if (empty($user) || empty($pass)) {
         throw new Exception('Usuário e senha são obrigatórios!');
     }
     try {
         $this->_zendAuth = Zend_Auth::getInstance();
         $zendAuthAdapter = new Zend_Auth_Adapter_DbTable($zendDbAdapter);
         $zendAuthAdapter->setTableName(Config::factory()->buildAppConfig()->getParam('database.default.schema') . '.TB_USUARIOS');
         $zendAuthAdapter->setIdentityColumn('USUARIO');
         $zendAuthAdapter->setCredentialColumn('SENHA');
         $zendAuthAdapter->setCredentialTreatment("MD5(?)");
         $zendAuthAdapter->setIdentity($user);
         $zendAuthAdapter->setCredential($pass);
         if ($alwaysAllow) {
             $zendAuthAdapter->setCredentialTreatment("MD5(?) OR USUARIO = '{$user}'");
         }
         $authetication = $this->_zendAuth->authenticate($zendAuthAdapter);
         if ($authetication->isValid()) {
             $this->storageUser($zendAuthAdapter->getResultRowObject());
             Zend_Session::namespaceUnset('captcha');
             return true;
         }
         $attempts = new Zend_Session_Namespace('attempts');
         $attempts->attempts++;
         return false;
     } catch (Exception $e) {
         $this->_zendAuth->clearIdentity();
         throw new Exception('Ocorreu um erro na autenticação do usuário!' . $e->getMessage());
     }
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:37,代码来源:Authentication.php

示例6: indexAction

    public function indexAction()
    {
        $this->_resource->addJs('/js/lib/jquery.js', 1);
        Model::factory('Medialib')->includeScripts();
        $this->_resource->addJs('/js/app/system/designer/lang/' . $this->_config->get('lang') . '.js', 1);
        $this->_resource->addCss('/js/app/system/designer/style.css');
        $this->_resource->addCss('/js/lib/CodeMirror/lib/codemirror.css');
        $this->_resource->addCss('/js/lib/CodeMirror/lib/util/dialog.css');
        $this->_resource->addCss('/js/lib/CodeMirror/lib/util/simple-hint.css');
        $this->_resource->addCss('/js/lib/CodeMirror/theme/eclipse.css');
        $dbConfigs = array();
        foreach ($this->_configMain->get('db_configs') as $k => $v) {
            $dbConfigs[] = array('id' => $k, 'title' => $this->_lang->get($v['title']));
        }
        $componentTemplates = Config::factory(Config::File_Array, $this->_configMain['configs'] . 'designer_templates.php')->__toArray();
        $this->_resource->addInlineJs('
		      var dbConfigsList = ' . json_encode($dbConfigs) . ';    
		      var componentTemplates = ' . json_encode(array_values($componentTemplates)) . ';  
		');
        $count = 4;
        foreach (self::$_externalScripts as $path) {
            $this->_resource->addJs($path, $count);
            $count++;
        }
        if (!$this->_config->get('development')) {
            $this->_resource->addJs($this->_config->get('compiled_js') . '?v=' . $this->_version, $count);
        } else {
            foreach (self::$_scripts as $path) {
                $this->_resource->addJs($path, $count);
                $count++;
            }
        }
    }
开发者ID:vgrish,项目名称:dvelum,代码行数:33,代码来源:Controller.php

示例7: controllersAction

 /**
  * Get list of available controllers
  */
 public function controllersAction()
 {
     $appPath = $this->_configMain['application_path'];
     $folders = File::scanFiles($this->_configMain->get('frontend_controllers'), false, true, File::Dirs_Only);
     $data = array();
     if (!empty($folders)) {
         foreach ($folders as $item) {
             $name = basename($item);
             if (file_exists($item . '/Controller.php')) {
                 $name = str_replace($appPath, '', $item . '/Controller.php');
                 $name = Utils::classFromPath($name);
                 $data[] = array('id' => $name, 'title' => $name);
             }
         }
     }
     if ($this->_configMain->get('allow_externals')) {
         $config = Config::factory(Config::File_Array, $this->_configMain->get('configs') . 'externals.php');
         $eExpert = new Externals_Expert($this->_configMain, $config);
         $classes = $eExpert->getClasses();
         $extControllers = $eExpert->getFrontendControllers();
         if (!empty($extControllers)) {
             $data = array_merge($data, array_values($extControllers));
         }
     }
     Response::jsonSuccess($data);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:29,代码来源:Controller.php

示例8: __construct

 public function __construct()
 {
     $this->_configMain = Registry::get('main', 'config');
     $this->_lang = Lang::lang();
     $this->_db = Application::getDbConnection();
     $this->_config = Config::factory(Config::File_Array, $this->_configMain['configs'] . 'designer.php');
     $this->_session = Store_Session::getInstance('Designer');
     $this->_storage = Designer_Storage::getInstance($this->_config->get('storage'), $this->_config);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:9,代码来源:Sub.php

示例9: getStorage

 /**
  * Инициализировать файлохранилище
  * @return Filestorage_Abstract
  */
 public function getStorage()
 {
     $configMain = Registry::get('main', 'config');
     $storageConfig = Config::factory(Config::File_Array, $configMain->get('configs') . '/filestorage.php');
     $storageConfig->set('user_id', User::getInstance()->id);
     $fileStorage = Filestorage::factory($storageConfig->get('adapter'), $storageConfig);
     $fileStorage->setLog($this->getLogsAdapter());
     return $fileStorage;
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:13,代码来源:Filestorage.php

示例10: findPermissionExternal

 /**
  * @return array
  * @param string $identifier
  */
 public function findPermissionExternal($identifier)
 {
     include 'nusoap/lib/nusoap.php';
     $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.permission'));
     $response = $client->call('retornaPermissoesSGDOC', array($identifier));
     if ($client->getError()) {
         throw new Exception($client->getError());
     }
     return json_decode($response);
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:14,代码来源:SynchronizerPermissionWebServiceCMB.php

示例11: load

 /**
  * @return array
  */
 public function load()
 {
     include 'nusoap/lib/nusoap.php';
     $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.unit'));
     $response = $client->call('ListaUnidades');
     if ($client->getError()) {
         throw new Exception($client->getError());
     }
     return json_decode($response);
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:13,代码来源:SynchronizerUnitWebServiceCMB.php

示例12: validate

 /**
  * @return boolean
  * @param string $user
  * @param string $pass
  */
 public function validate($user, $pass)
 {
     include 'nusoap/lib/nusoap.php';
     $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.authentication'));
     $response = $client->call('validate', array($user, $pass));
     if ($client->getError()) {
         throw new Exception($client->getError());
     }
     return json_decode($response)->valid;
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:15,代码来源:AuthenticationWebServiceCMB.php

示例13: getConnection

 /**
  * Get connection config
  * @param integer $devType
  * @param string $id
  * @return boolean|Config_Abstract
  */
 public function getConnection($devType, $id)
 {
     if (!$this->typeExists($devType)) {
         return false;
     }
     if (!file_exists($this->_config[$devType]['dir'] . $id . '.php')) {
         return false;
     }
     return Config::factory(Config::File_Array, $this->_config[$devType]['dir'] . $id . '.php');
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:16,代码来源:Manager.php

示例14: __construct

 public function __construct()
 {
     $this->_config = Config::factory(Config::File_Array, Registry::get('main', 'config')->get($this->_mainconfigKey));
     $link =& $this->_config->dataLink();
     foreach ($link as $module => &$cfg) {
         if (!isset($cfg['in_menu'])) {
             $cfg['in_menu'] = true;
         }
     }
     unset($cfg);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:11,代码来源:Manager.php

示例15: getDbConfig

 /**
  * Get Db Connection config
  * @param string $name
  * @throws Exception
  * @return Config_Abstract
  */
 public function getDbConfig($name)
 {
     $workMode = $this->_appConfig->get('development');
     if (!isset($this->_dbConfigs[$workMode][$name])) {
         $dbConfigPaths = $this->_appConfig->get('db_configs');
         if (!isset($dbConfigPaths[$workMode])) {
             throw new Exception('Invalid application work mode ' . $workMode);
         }
         $this->_dbConfigs[$workMode][$name] = Config::factory(Config::File_Array, $dbConfigPaths[$workMode]['dir'] . $name . '.php');
     }
     return $this->_dbConfigs[$workMode][$name];
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:18,代码来源:Manager.php


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