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


PHP Zibo::getConfigValue方法代码示例

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


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

示例1: getBaseUrl

 /**
  * Gets the base URL of the system
  * @return string
  */
 public function getBaseUrl()
 {
     if ($this->baseUrl) {
         return $this->baseUrl;
     }
     $baseUrl = $this->zibo->getConfigValue(self::CONFIG_URL);
     if (!$baseUrl) {
         $baseUrl = $this->generateBaseUrl();
     }
     return $this->baseUrl = rtrim($baseUrl, '/');
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:15,代码来源:Environment.php

示例2: setInvertToCreatedFilter

 protected static function setInvertToCreatedFilter(AbstractInvertLogItemFilter $filter, Zibo $zibo, $name, $configBase)
 {
     $configInvert = $configBase . Module::CONFIG_INVERT;
     $invert = $zibo->getConfigValue($configInvert);
     if ($invert !== null) {
         $filter->setInvert($invert);
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:8,代码来源:AbstractInvertLogItemFilter.php

示例3: readRoutesFromFile

 /**
  * Reads the routes from the provided file
  * @param zibo\library\filesystem\File $file
  * @return array Array with Route objects as value and their path as key
  */
 private function readRoutesFromFile(File $file)
 {
     $dom = new Document();
     $relaxNg = $this->zibo->getConfigValue(self::CONFIG_RNG);
     if ($relaxNg) {
         $dom->setRelaxNGFile($relaxNg);
     }
     $dom->load($file);
     return $this->getRoutesFromElement($file, $dom->documentElement);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:15,代码来源:XmlRouterIO.php

示例4: getMimeType

 /**
  * Gets the MIME type of a file based on it's extension
  * @param zibo\core\Zibo $zibo Instance of Zibo
  * @param zibo\library\filesystem\File $file The file to get the MIME from
  * @return string The MIME type of the file
  */
 public static function getMimeType(Zibo $zibo, File $file)
 {
     $extension = $file->getExtension();
     if (empty($extension)) {
         return self::MIME_UNKNOWN;
     }
     $mime = $zibo->getConfigValue(self::CONFIG_MIME . $extension);
     if (!$mime) {
         $mime = self::MIME_UNKNOWN;
     }
     return $mime;
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:18,代码来源:Mime.php

示例5: createValidator

 /**
  * Create a new validator
  * @param string $validatorName name of the validator
  * @param array $options options for the validator
  * @return zibo\library\validation\validator\Validator
  * @throws zibo\ZiboException when the validator does not exist
  */
 public function createValidator($validatorName, array $options = array())
 {
     if (!String::isString($validatorName, String::NOT_EMPTY)) {
         throw new ZiboException('Provided validator name is empty or invalid');
     }
     if (!isset($this->validators[$validatorName])) {
         $validatorClass = $this->zibo->getConfigValue(self::CONFIG_VALIDATOR . '.' . $validatorName);
         if (!$validatorClass) {
             throw new ZiboException('Unsupported validator: ' . $validatorName);
         }
         $this->registerValidator($validatorName, $validatorClass);
     }
     $className = $this->validators[$validatorName];
     return new $className($options);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:22,代码来源:ValidationFactory.php

示例6: loadListeners

 private function loadListeners(Zibo $zibo)
 {
     $config = $zibo->getConfigValue(self::CONFIG_LOG);
     if (isset($config[self::CONFIG_LISTENER])) {
         unset($config[self::CONFIG_LISTENER]);
     }
     if (isset($config[self::CONFIG_FILTER])) {
         unset($config[self::CONFIG_FILTER]);
     }
     $listenerFactory = new LogListenerFactory($zibo);
     foreach ($config as $name => $parameters) {
         $listener = $listenerFactory->createListener($name);
         if ($listener != null) {
             $this->log->addLogListener($listener);
         }
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:17,代码来源:Module.php

示例7: loadModules

 /**
  * Loads the defined modules from the Zibo Configuration
  * @param zibo\core\Zibo $zibo Instance of Zibo
  * @return array Array with the defined modules
  * @throws zibo\ZiboException when a module could not be created
  * @see Module
  * @see CONFIG_MODULE
  */
 public function loadModules(Zibo $zibo)
 {
     $configModules = $zibo->getConfigValue(self::CONFIG_MODULE);
     if (!$configModules) {
         return array();
     }
     $objectFactory = new ObjectFactory();
     $modules = array();
     $configModules = Config::parseConfigTree($configModules);
     foreach ($configModules as $configKey => $moduleClass) {
         try {
             $modules[] = $objectFactory->create($moduleClass, self::INTERFACE_MODULE);
         } catch (ZiboException $exception) {
             throw new ZiboException('Could not create ' . $moduleClass . ' from the ' . $configKey . ' configuration key', 0, $exception);
         }
     }
     return $modules;
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:26,代码来源:ConfigModuleLoader.php

示例8: addFiltersToCreatedListener

 protected static function addFiltersToCreatedListener(AbstractFilteredLogListener $listener, Zibo $zibo, $name, $configBase)
 {
     $configBase .= Module::CONFIG_FILTER;
     $config = $zibo->getConfigValue($configBase);
     if (empty($config)) {
         return;
     }
     if (isset($config[Module::CONFIG_FILTER_ALL])) {
         $listener->setFilterAllFilters($config[Module::CONFIG_FILTER_ALL]);
         unset($config[Module::CONFIG_FILTER_ALL]);
     }
     if (isset($config[Module::CONFIG_INVERT])) {
         $listener->setInvert($config[Module::CONFIG_INVERT]);
         unset($config[Module::CONFIG_INVERT]);
     }
     $filterFactory = new LogItemFilterFactory($zibo);
     foreach ($config as $name => $parameters) {
         $filterConfigBase = $configBase . Config::TOKEN_SEPARATOR . $name . Config::TOKEN_SEPARATOR;
         $filter = $filterFactory->createFilter($name, $filterConfigBase);
         if ($filter != null) {
             $listener->addFilter($filter);
         }
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:24,代码来源:AbstractFilteredLogListener.php

示例9: parseConfiguration

 /**
  * Assign the smarty configuration to the engine
  * @param zibo\core\Zibo $zibo instance of Zibo to get the configuration from
  * @return null
  */
 private function parseConfiguration(Zibo $zibo)
 {
     $this->smarty->caching = false;
     $this->smarty->compile_dir = $zibo->getConfigValue(self::CONFIG_COMPILE_DIRECTORY, self::DEFAULT_COMPILE_DIRECTORY);
     $directory = new File($this->smarty->compile_dir);
     $directory->create();
     $smartyPluginDirectories = $zibo->getConfigValue(self::CONFIG_PLUGINS, array());
     if (!is_array($smartyPluginDirectories)) {
         $smartyPluginDirectories = array($smartyPluginDirectories);
     }
     foreach ($smartyPluginDirectories as $directory) {
         $this->smarty->plugins_dir[] = $directory;
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:19,代码来源:SmartyView.php

示例10: setParametersToCreatedListener

 protected static function setParametersToCreatedListener(FileListener $listener, Zibo $zibo, $name, $configBase)
 {
     $configFileTruncateSize = $configBase . self::CONFIG_FILE_TRUNCATE_SIZE;
     $fileTruncateSize = $zibo->getConfigValue($configFileTruncateSize);
     if ($fileTruncateSize !== null) {
         $listener->setFileTruncateSize($fileTruncateSize);
     }
     $configDateFormat = $configBase . self::CONFIG_DATE_FORMAT;
     $dateFormat = $zibo->getConfigValue($configDateFormat);
     if ($dateFormat !== null) {
         $listener->setDateFormat($dateFormat);
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:13,代码来源:FileListener.php

示例11: loadConnectionsFromConfig

 /**
  * Loads the database connections from the Zibo configuration
  * @param zibo\core\Zibo $zibo Instance of Zibo
  * @return null
  * @throws zibo\library\database\exception\DatabaseException when the configuration contains an invalid connection
  * @throws zibo\library\database\exception\DatabaseException when the default connection does not exist
  */
 private function loadConnectionsFromConfig(Zibo $zibo)
 {
     $zibo->runEvent(Zibo::EVENT_LOG, 'Loading database connections', '', 0, self::LOG_NAME);
     $connections = $zibo->getConfigValue(self::CONFIG_CONNECTION, array());
     if (!is_array($connections)) {
         $connections = array(self::NAME_DEFAULT => $connections);
     }
     $defaultConnectionName = null;
     foreach ($connections as $name => $dsn) {
         if ($name == self::NAME_DEFAULT) {
             $defaultConnectionName = $name;
         }
         try {
             $dsn = new Dsn($dsn);
             $this->registerConnection($name, $dsn);
         } catch (DatabaseException $e) {
             if ($name == self::NAME_DEFAULT) {
                 $defaultConnectionName = $dsn;
             } else {
                 throw $e;
             }
         }
     }
     if ($defaultConnectionName != null) {
         $this->setDefaultConnectionName($defaultConnectionName);
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:34,代码来源:DatabaseManager.php

示例12: setDefaultAction

 /**
  * Sets the default action and controller to the router
  * @param zibo\core\Zibo $zibo
  * @return null
  */
 private function setDefaultAction(Zibo $zibo)
 {
     $router = $zibo->getRouter();
     if ($router === null) {
         $router = new GenericRouter();
         $zibo->setRouter($router);
     }
     if (!$router instanceof GenericRouter) {
         return;
     }
     $defaultController = $router->getDefaultController();
     if ($defaultController) {
         return;
     }
     $defaultController = $zibo->getConfigValue(self::CONFIG_CONTROLLER_DEFAULT, self::CONTROLLER_DEFAULT);
     $router->setDefaultAction($defaultController);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:22,代码来源:Module.php

示例13: initializeHashAlgorithm

 /**
  * Initializes the hash algorithm from the Zibo configuration
  * @param zibo\core\Zibo $zibo The Zibo instance
  * @param zibo\library\ObjectFactory $objectFactory Instance of an object factory
  * @return null
  */
 private function initializeHashAlgorithm(Zibo $zibo, ObjectFactory $objectFactory)
 {
     $hashAlgorithms = $zibo->getConfigValue(EncryptionModule::CONFIG_HASH_ALGORITHM);
     $hashAlgorithmName = $zibo->getConfigValue(self::CONFIG_HASH_ALGORITHM, self::DEFAULT_HASH_ALGORITHM);
     if (!array_key_exists($hashAlgorithmName, $hashAlgorithms)) {
         throw new ZiboException('Provided password hash algorithm ' . $hashAlgorithmName . ' could not be found');
     }
     $hashAlgorithmClass = $hashAlgorithms[$hashAlgorithmName];
     $this->hashAlgorithm = $objectFactory->create($hashAlgorithmClass, EncryptionModule::INTERFACE_HASH_ALGORITHM);
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:16,代码来源:SecurityManager.php

示例14: loadTypes

 /**
  * Loads the archive types from the Zibo configuration
  * @return null
  */
 private function loadTypes(Zibo $zibo)
 {
     $this->types = array();
     $types = $zibo->getConfigValue(self::CONFIG_TYPES, array());
     foreach ($types as $typeName => $className) {
         $this->register($typeName, $className);
     }
 }
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:12,代码来源:ArchiveFactory.php


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