本文整理汇总了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);