本文整理汇总了PHP中ProjectConfiguration::getSymfonyLibDir方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectConfiguration::getSymfonyLibDir方法的具体用法?PHP ProjectConfiguration::getSymfonyLibDir怎么用?PHP ProjectConfiguration::getSymfonyLibDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectConfiguration
的用法示例。
在下文中一共展示了ProjectConfiguration::getSymfonyLibDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realpath
/**
*
* Copyright (c) 2007 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content in this file are licensed
* under the MIT open source license.
*
* For the full copyright and license information, please view the LICENSE.yahoo
* file that was distributed with this source code.
*/
$sf_symfony_lib_dir = '/Users/dustin/projects/symfony/branch/1.1/lib';
$sf_root_dir = realpath(dirname(__FILE__) . '/../../fixtures/project');
require_once $sf_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration($sf_root_dir);
// load lime
require_once $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
$t = new lime_test(2, new lime_output_color());
require_once dirname(__FILE__) . '/../../../lib/util/ysfCartesianIterator.class.php';
$test = array();
// test data
$data1 = array('symfony', 'dimensions');
$data2 = array('works', 'properly');
$cartestianExpression = new ysfCartesianIterator();
$cartestianExpression->addArray($data1);
$cartestianExpression->addArray($data2);
foreach ($cartestianExpression as $catesianProduct) {
array_push($test, $catesianProduct);
}
$t->is($cartestianExpression instanceof Iterator, 'true', 'is subclass of Iterator');
$t->diag('->addArray()');
$t->is($test, array(array('symfony', 'works'), array('dimensions', 'works'), array('symfony', 'properly'), array('dimensions', 'properly')), 'cartestian expression is expanded correctly');
示例2: realpath
<?php
$_test_dir = realpath(dirname(__FILE__) . '/..');
$_root_dir = realpath(file_exists($_test_dir . '/../symfony') ? $_test_dir . '/..' : $_test_dir . '/../../..');
if (false !== strpos(file_get_contents($_root_dir . '/symfony'), 'ProjectConfiguration')) {
// symfony 1.1 bootstrap
require_once $_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration($_root_dir);
$sf_symfony_lib_dir = $configuration->getSymfonyLibDir();
} else {
// symfony 1.0 bootstrap
define('SF_ROOT_DIR', $_root_dir);
include SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
}
require_once $sf_symfony_lib_dir . '/vendor/lime/lime.php';
$ga_lib_dir = $_root_dir . '/plugins/sfGoogleAnalyticsPlugin/lib';
示例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 = new ProjectConfiguration($_root_dir);
// lime
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
//custom base class
require_once dirname(__FILE__) . '/../lib/BaseUnitTestCase.class.php';
// autoloader for sfPHPUnit2Plugin libs
$autoload = sfSimpleAutoload::getInstance();
$autoload->addDirectory($_root_dir . '/plugins/sfPHPUnit2Plugin/lib/config');
$autoload->register();
示例4: fixture_url
<?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';
$configuration = new ProjectConfiguration(realpath($_test_dir . '/..'));
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
$sf_symfony_lib_dir = $configuration->getSymfonyLibDir();
$sf_root_dir = $configuration->getRootDir();
require_once $sf_symfony_lib_dir . '/autoload/sfSimpleAutoload.class.php';
$autoload = sfSimpleAutoload::getInstance();
$autoload->addDirectory($sf_symfony_lib_dir);
$autoload->addDirectory($sf_root_dir . '/plugins');
$autoload->addDirectory($sf_root_dir . '/lib');
$autoload->register();
// Commenting this out because it seems to be breaking stuff right now
$app_config = $configuration->getApplicationConfiguration('tracker', 'test', true);
$databaseManager = new sfDatabaseManager($app_config);
//$databaseManager->loadConfiguration();
sfContext::createInstance($app_config, 'tracker');
$sessionPath = sfToolkit::getTmpDir() . '/sessions_' . rand(11111, 99999);
$storage = new sfSessionTestStorage(array('session_path' => $sessionPath));
function fixture_url($name, $file_url = true)
{
global $sf_root_dir;