本文整理匯總了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';
示例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';
示例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();
示例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';