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


PHP ProjectConfiguration::hasActive方法代码示例

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


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

示例1: realpath

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$_test_dir = realpath(dirname(__FILE__) . '/..');
// configuration
require_once dirname(__FILE__) . '/../../config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::hasActive() ? ProjectConfiguration::getActive() : new ProjectConfiguration(realpath($_test_dir . '/..'));
// autoloader
$autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir') . '/project_autoload.cache');
$autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(sfConfig::get('sf_symfony_lib_dir') . '/config/config', sfConfig::get('sf_config_dir'))));
$autoload->addDirectory(sfConfig::get('sf_apps_dir'));
$autoload->addDirectory($_test_dir);
$autoload->register();
// lime
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
// hamcrest
set_include_path(get_include_path() . PATH_SEPARATOR . sfConfig::get("sf_lib_dir") . '/vendor/hamcrest/hamcrest');
require_once 'Hamcrest.php';
开发者ID:remialvado,项目名称:symfonyCustomRoutesDemoAndTests,代码行数:24,代码来源:unit.php

示例2: realpath

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$_test_dir = realpath(dirname(__FILE__) . '/..');
// configuration
require_once dirname(__FILE__) . '/../../config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::hasActive() ? ProjectConfiguration::getActive() : ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true);
// autoloader
$autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir') . '/project_autoload.cache');
$autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(sfConfig::get('sf_symfony_lib_dir') . '/config/config', sfConfig::get('sf_config_dir'))));
$autoload->register();
// lime
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
开发者ID:rbolliger,项目名称:otokou,代码行数:19,代码来源:unit.php

示例3: realpath

<?php

/*
 * This file is part of the sfPHPUnit2Plugin package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Idea taken from bootstrap/unit.php of the lime bootstrap file
 */
$_test_dir = realpath(dirname(__FILE__) . '/../..');
$_root_dir = $_test_dir . '/..';
// configuration
require_once $_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::hasActive() ? ProjectConfiguration::getActive() : new ProjectConfiguration(realpath($_root_dir));
// lime
require_once $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
// autoloader
$autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir') . '/project_autoload.cache');
$autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(sfConfig::get('sf_symfony_lib_dir') . '/config/config', sfConfig::get('sf_config_dir'), $_root_dir . '/plugins/sfPHPUnit2Plugin/lib/config')));
$autoload->register();
开发者ID:phpleo,项目名称:viper,代码行数:21,代码来源:unit.php

示例4: realpath

<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$_test_dir = realpath(dirname(__FILE__) . '/..');
require_once dirname(__FILE__) . '/../../config/ProjectConfiguration.class.php';
if (ProjectConfiguration::hasActive()) {
    $configuration = ProjectConfiguration::getActive();
} else {
    $configuration = new ProjectConfiguration(realpath($_test_dir . '/..'));
}
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
开发者ID:limitium,项目名称:uberlov,代码行数:17,代码来源:unit.php


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