本文整理汇总了PHP中Phing::printMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Phing::printMessage方法的具体用法?PHP Phing::printMessage怎么用?PHP Phing::printMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phing
的用法示例。
在下文中一共展示了Phing::printMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$args = $this->preparePhingArgs($input, $output);
$phingClasspath = $this->getContainer()->getParameter('rhapsody_phing.phing_classpath');
$phingHome = $this->getContainer()->getParameter('rhapsody_phing.phing_home');
if ($output->getVerbosity() == OutputInterface::VERBOSITY_VERBOSE) {
$commandline = 'phing ' . implode(' ', $args);
$output->writeln('Executing Phing with: ' . $commandline);
}
//require_once('phing/Phing.php');
\Phing::startup();
\Phing::setProperty('rhapsody_phing.home', $phingHome);
\Phing::fire($args);
\Phing::shutdown();
} catch (ConfigurationException $x) {
Phing::printMessage($x);
exit(-1);
} catch (Exception $x) {
exit(1);
}
}
示例2: ini_set
ini_set('include_path', PHP_CLASSPATH);
} else {
if (!defined('PHP_CLASSPATH')) {
define('PHP_CLASSPATH', get_include_path());
}
}
require_once 'phing/Phing.php';
try {
/* Setup Phing environment */
Phing::startup();
// Set phing.home property to the value from environment
// (this may be NULL, but that's not a big problem.)
Phing::setProperty('phing.home', getenv('PHING_HOME'));
// Grab and clean up the CLI arguments
$args = isset($argv) ? $argv : $_SERVER['argv'];
// $_SERVER['argv'] seems to not work (sometimes?) when argv is registered
array_shift($args);
// 1st arg is script name, so drop it
// Invoke the commandline entry point
Phing::fire($args);
// Invoke any shutdown routines.
Phing::shutdown();
} catch (ConfigurationException $x) {
Phing::printMessage($x);
exit(-1);
// This was convention previously for configuration errors.
} catch (Exception $x) {
// Assume the message was already printed as part of the build and
// exit with non-0 error code.
exit(1);
}
示例3: start
/**
* Entry point allowing for more options from other front ends.
*
* This method encapsulates the complete build lifecycle.
*
* @param array &$args The commandline args passed to phing shell script.
* @param array $additionalUserProperties Any additional properties to be passed to Phing (alternative front-end might implement this).
* These additional properties will be available using the getDefinedProperty() method and will
* be added to the project's "user" properties.
* @return void
* @see execute()
* @see runBuild()
*/
public static function start(&$args, $additionalUserProperties = null)
{
try {
$m = new Phing();
$m->execute($args);
} catch (Exception $exc) {
$m->printMessage($exc);
self::halt(-1);
// Parameter error
}
if ($additionalUserProperties !== null) {
$keys = $m->additionalUserProperties->keys();
while (count($keys)) {
$key = array_shift($keys);
$property = $m->additionalUserProperties->getProperty($key);
$m->setDefinedProperty($key, $property);
}
}
try {
$m->runBuild();
} catch (Exception $exc) {
self::halt(1);
// Errors occured
}
// everything fine, shutdown
self::halt(0);
// no errors, everything is cake
}