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


PHP ProjectConfiguration::getSymfonyLibDir方法代码示例

本文整理汇总了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');
开发者ID:remialvado,项目名称:ysfDimensionPlugin,代码行数:30,代码来源:ysfCartestianIteratorTest.php

示例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';
开发者ID:bshaffer,项目名称:Symplist,代码行数:16,代码来源: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 = 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();
开发者ID:nvidela,项目名称:kimkelen,代码行数:23,代码来源:unit.php

示例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;
开发者ID:WIZARDISHUNGRY,项目名称:sflimetracker,代码行数:31,代码来源:unit.php


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