本文整理汇总了PHP中Phing::halt方法的典型用法代码示例。如果您正苦于以下问题:PHP Phing::halt方法的具体用法?PHP Phing::halt怎么用?PHP Phing::halt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phing
的用法示例。
在下文中一共展示了Phing::halt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: characters
/**
* Method that gets invoked when the parser runs over CDATA.
*
* This method is called by PHP's internal parser functions and registered
* in the actual parser implementation.
*
* It gives control to the current active handler object by calling the
* <code>characters()</code> method. That processes the given CDATA.
*
* BECAUSE OF PROBLEMS WITH EXCEPTIONS BUBBLING UP THROUGH xml_parse() THIS
* METHOD WILL CALL Phing::halt(-1) ON EXCEPTION.
*
* @param resource $parser php's internal parser handle.
* @param string $data the CDATA
*/
function characters($parser, $data)
{
try {
$this->handler->characters($data);
} catch (Exception $e) {
print "[Exception in XML parsing]\n";
print $e;
Phing::halt(-1);
}
}
示例2: ini_set
// ---------------------------
ini_set('track_errors', 1);
/* set classpath */
if (getenv('PHP_CLASSPATH')) {
define('PHP_CLASSPATH', getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path());
ini_set('include_path', PHP_CLASSPATH);
} else {
define('PHP_CLASSPATH', get_include_path());
}
require_once 'phing/Phing.php';
/* Setup Phing environment */
Phing::startup();
/*
find phing home directory
-- if Phing is installed from PEAR this will probably be null,
which is fine (I think). Nothing uses phing.home right now.
*/
Phing::setProperty('phing.home', getenv('PHING_HOME'));
/* polish CLI arguments */
$args = isset($argv) ? $argv : $_SERVER['argv'];
// $_SERVER['argv'] seems not to work when argv is registered (PHP5b4)
array_shift($args);
// 1st arg is script name, so drop it
/* fire main application */
Phing::fire($args);
/*
exit OO system if not already called by Phing
-- basically we should not need this due to register_shutdown_function in Phing
*/
Phing::halt(0);