本文整理匯總了PHP中sfCoreAutoload::make方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfCoreAutoload::make方法的具體用法?PHP sfCoreAutoload::make怎麽用?PHP sfCoreAutoload::make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfCoreAutoload
的用法示例。
在下文中一共展示了sfCoreAutoload::make方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* @see sfTask
*/
protected function execute($arguments = array(), $options = array())
{
require_once dirname(__FILE__) . '/../../vendor/lime/lime.php';
require_once dirname(__FILE__) . '/lime_symfony.php';
// cleanup
require_once dirname(__FILE__) . '/../../util/sfToolkit.class.php';
if ($files = glob(sys_get_temp_dir() . DIRECTORY_SEPARATOR . '/sf_autoload_unit_*')) {
foreach ($files as $file) {
unlink($file);
}
}
// update sfCoreAutoload
if ($options['update-autoloader']) {
require_once dirname(__FILE__) . '/../../autoload/sfCoreAutoload.class.php';
sfCoreAutoload::make();
}
$status = false;
$statusFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . sprintf('/.test_symfony_%s_status', md5(dirname(__FILE__)));
if ($options['only-failed']) {
if (file_exists($statusFile)) {
$status = unserialize(file_get_contents($statusFile));
}
}
$h = new lime_symfony(array('force_colors' => $options['color'], 'verbose' => $options['trace']));
$h->base_dir = realpath(dirname(__FILE__) . '/../../../test');
// remove generated files
if ($options['rebuild-all']) {
$finder = sfFinder::type('dir')->name(array('base', 'om', 'map'));
foreach ($finder->in(glob($h->base_dir . '/../lib/plugins/*/test/functional/fixtures/lib')) as $dir) {
sfToolkit::clearDirectory($dir);
}
}
if ($status) {
foreach ($status as $file) {
$h->register($file);
}
} else {
$h->register(sfFinder::type('file')->prune('fixtures')->name('*Test.php')->in(array_merge(array($h->base_dir . '/unit'), glob($h->base_dir . '/../lib/plugins/*/test/unit'), array($h->base_dir . '/functional'), glob($h->base_dir . '/../lib/plugins/*/test/functional'), array($h->base_dir . '/other'))));
}
$ret = $h->run() ? 0 : 1;
file_put_contents($statusFile, serialize($h->get_failed_files()));
if ($options['xml']) {
file_put_contents($options['xml'], $h->to_xml());
}
return $ret;
}
示例2: dirname
<?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.
*/
require_once dirname(__FILE__) . '/../../lib/vendor/lime/lime.php';
class lime_symfony extends lime_harness
{
protected function get_relative_file($file)
{
$file = str_replace(DIRECTORY_SEPARATOR, '/', str_replace(array(realpath($this->base_dir) . DIRECTORY_SEPARATOR, realpath($this->base_dir . '/../lib/plugins') . DIRECTORY_SEPARATOR, $this->extension), '', $file));
return preg_replace('#^(.*?)Plugin/test/(unit|functional)/#', '[$1] $2/', $file);
}
}
require_once dirname(__FILE__) . '/../../lib/util/sfToolkit.class.php';
if ($files = glob(sfToolkit::getTmpDir() . DIRECTORY_SEPARATOR . '/sf_autoload_unit_*')) {
foreach ($files as $file) {
unlink($file);
}
}
// update sfCoreAutoload
require_once dirname(__FILE__) . '/../../lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::make();
$h = new lime_symfony(new lime_output_color());
$h->base_dir = realpath(dirname(__FILE__) . '/..');
$h->register(sfFinder::type('file')->prune('fixtures')->name('*Test.php')->in(array_merge(array($h->base_dir . '/unit'), glob($h->base_dir . '/../lib/plugins/*/test/unit'), array($h->base_dir . '/functional'), glob($h->base_dir . '/../lib/plugins/*/test/functional'), array($h->base_dir . '/other'))));
exit($h->run() ? 0 : 1);