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


PHP Prado::setPathOfAlias方法代码示例

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


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

示例1: importZendNamespace

 protected function importZendNamespace()
 {
     if (is_null(Prado::getPathOfAlias('Zend'))) {
         $zendBase = !is_null($this->_ZF) ? $this->_ZF . '.*' : 'Application.index.*';
         $path = !is_null($this->_ZF) ? $this->_ZF . '.Zend.*' : 'Application.index.Zend.*';
         Prado::using($zendBase);
         Prado::setPathOfAlias('Zend', Prado::getPathOfNamespace($path));
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:9,代码来源:ZendSearch.php

示例2: testSetTransformPathAsNamespace

 public function testSetTransformPathAsNamespace()
 {
     if (Prado::getPathOfAlias('UnitTest') === null) {
         Prado::setPathOfAlias('UnitTest', dirname(__FILE__) . '/data');
     }
     $expected = $this->transformPath;
     $transform = new TXmlTransform();
     $transform->setTransformPath('UnitTest.hello');
     $this->assertEquals($expected, $transform->getTransformPath());
 }
开发者ID:bklein01,项目名称:prado,代码行数:10,代码来源:TXmlTransformTest.php

示例3: __construct

 function __construct($root, $app_dir = '.')
 {
     $this->_root = $root;
     Prado::setPathOfAlias('Tests', $root);
     if ($app_dir === null) {
         $app_dir = '.';
     }
     $app = new TShellApplication($app_dir);
     $app->run();
 }
开发者ID:bailey-ann,项目名称:stringtools,代码行数:10,代码来源:unit_tests.php

示例4: applyConfiguration

 public function applyConfiguration($config, $withinService = false)
 {
     if ($config->getIsEmpty()) {
         return;
     }
     foreach ($config->getAliases() as $alias => $path) {
         Prado::setPathOfAlias($alias, $path);
     }
     foreach ($config->getUsings() as $using) {
         Prado::using($using);
     }
     if (!$withinService) {
         foreach ($config->getProperties() as $name => $value) {
             $this->setSubProperty($name, $value);
         }
     }
     if (empty($this->_services)) {
         $this->_services = array($this->getPageServiceID() => array('TPageService', array(), null));
     }
     foreach ($config->getParameters() as $id => $parameter) {
         if (is_array($parameter)) {
             $component = Prado::createComponent($parameter[0]);
             foreach ($parameter[1] as $name => $value) {
                 $component->setSubProperty($name, $value);
             }
             $this->_parameters->add($id, $component);
         } else {
             $this->_parameters->add($id, $parameter);
         }
     }
     $modules = array();
     foreach ($config->getModules() as $id => $moduleConfig) {
         if (!is_string($id)) {
             $id = '_module' . count($this->_lazyModules);
         }
         $this->_lazyModules[$id] = $moduleConfig;
         if ($module = $this->internalLoadModule($id)) {
             $modules[] = $module;
         }
     }
     foreach ($modules as $module) {
         $module[0]->init($module[1]);
     }
     foreach ($config->getServices() as $serviceID => $serviceConfig) {
         $this->_services[$serviceID] = $serviceConfig;
     }
     foreach ($config->getExternalConfigurations() as $filePath => $condition) {
         if ($condition !== true) {
             $condition = $this->evaluateExpression($condition);
         }
         if ($condition) {
             if (($path = Prado::getPathOfNamespace($filePath, $this->getConfigurationFileExt())) === null || !is_file($path)) {
                 throw new TConfigurationException('application_includefile_invalid', $filePath);
             }
             $cn = $this->getApplicationConfigurationClass();
             $c = new $cn();
             $c->loadFromFile($path);
             $this->applyConfiguration($c, $withinService);
         }
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:61,代码来源:pradolite.php

示例5: applyConfiguration

 /**
  * Applies an application configuration.
  * @param TApplicationConfiguration the configuration
  * @param boolean whether the configuration is specified within a service.
  */
 public function applyConfiguration($config, $withinService = false)
 {
     if ($config->getIsEmpty()) {
         return;
     }
     // set path aliases and using namespaces
     foreach ($config->getAliases() as $alias => $path) {
         Prado::setPathOfAlias($alias, $path);
     }
     foreach ($config->getUsings() as $using) {
         Prado::using($using);
     }
     // set application properties
     if (!$withinService) {
         foreach ($config->getProperties() as $name => $value) {
             $this->setSubProperty($name, $value);
         }
     }
     if (empty($this->_services)) {
         $this->_services = array($this->getPageServiceID() => array('TPageService', array(), null));
     }
     // load parameters
     foreach ($config->getParameters() as $id => $parameter) {
         if (is_array($parameter)) {
             $component = Prado::createComponent($parameter[0]);
             foreach ($parameter[1] as $name => $value) {
                 $component->setSubProperty($name, $value);
             }
             $this->_parameters->add($id, $component);
         } else {
             $this->_parameters->add($id, $parameter);
         }
     }
     // load and init modules specified in app config
     $modules = array();
     foreach ($config->getModules() as $id => $moduleConfig) {
         Prado::trace("Loading module {$id} ({$moduleConfig[0]})", 'System.TApplication');
         list($moduleClass, $initProperties, $configElement) = $moduleConfig;
         $module = Prado::createComponent($moduleClass);
         if (!is_string($id)) {
             $id = '_module' . count($this->_modules);
             $initProperties['id'] = $id;
         }
         $this->setModule($id, $module);
         foreach ($initProperties as $name => $value) {
             $module->setSubProperty($name, $value);
         }
         $modules[] = array($module, $configElement);
     }
     foreach ($modules as $module) {
         $module[0]->init($module[1]);
     }
     // load service
     foreach ($config->getServices() as $serviceID => $serviceConfig) {
         $this->_services[$serviceID] = $serviceConfig;
     }
     // external configurations
     foreach ($config->getExternalConfigurations() as $filePath => $condition) {
         if ($condition !== true) {
             $condition = $this->evaluateExpression($condition);
         }
         if ($condition) {
             if (($path = Prado::getPathOfNamespace($filePath, self::CONFIG_FILE_EXT)) === null || !is_file($path)) {
                 throw new TConfigurationException('application_includefile_invalid', $filePath);
             }
             $c = new TApplicationConfiguration();
             $c->loadFromFile($path);
             $this->applyConfiguration($c, $withinService);
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:76,代码来源:TApplication.php


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