本文整理匯總了PHP中Generator::nimble_root方法的典型用法代碼示例。如果您正苦於以下問題:PHP Generator::nimble_root方法的具體用法?PHP Generator::nimble_root怎麽用?PHP Generator::nimble_root使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Generator
的用法示例。
在下文中一共展示了Generator::nimble_root方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGenerateScripts
/**
* @covers Generator::generate_scripts
*/
function testGenerateScripts()
{
file_put_contents(vfsStream::url('root/scripts/nimblize'), 'no');
file_put_contents(vfsStream::url('root/scripts/test'), 'yes');
mkdir(vfsStream::url('root/test/scripts'), 0777, true);
Generator::$nimble_root = vfsStream::url('root/test');
Generator::generate_scripts(vfsStream::url('root/test/scripts'));
$this->assertFileExists(vfsStream::url('root/test/scripts/test'));
$this->assertFileNotExists(vfsStream::url('root/test/scripts/nimblize'));
}
示例2: help
{
file_put_contents($path, $string);
}
/**
* Retrieve the help documentation.
*/
public static function help()
{
return file_get_contents(FileUtils::join(static::$template_path, 'help.tmpl'));
}
public static function echo_path($type, $path)
{
if (defined("NIMBLE_IS_TESTING")) {
return;
}
echo CommandLineColor::blue($type) . ': ' . CommandLineColor::yellow($path) . "\n";
}
public static function echo_operation($op)
{
if (defined("NIMBLE_IS_TESTING")) {
return;
}
echo CommandLineColor::underline_white('Generating:') . ' ' . CommandLineColor::red($op) . "\n";
}
}
foreach (array('template_path' => FileUtils::join(__DIR__, '..', 'templates'), 'script_path' => FileUtils::join(__DIR__, '..', '..', 'nimble_scripts')) as $name => $path) {
Generator::${$name} = $path;
}
if (defined('NIMBLE_ROOT')) {
Generator::$nimble_root = NIMBLE_ROOT;
}