當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。