当前位置: 首页>>代码示例>>PHP>>正文


PHP Phing::setErrorStream方法代码示例

本文整理汇总了PHP中Phing::setErrorStream方法的典型用法代码示例。如果您正苦于以下问题:PHP Phing::setErrorStream方法的具体用法?PHP Phing::setErrorStream怎么用?PHP Phing::setErrorStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phing的用法示例。


在下文中一共展示了Phing::setErrorStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runPhing

 /**
  * 
  * @param string $taskName
  */
 public function runPhing($taskName)
 {
     // Copy Files
     $this->mySchemaBuilder->loadXmlFiles();
     // Create build.properties file
     $this->createBuildPropertiesFile($this->tmpDir . '/build.properties');
     // Create buildtime-conf file
     $this->createBuildTimeConfFile($this->tmpDir . '/buildtime-conf.xml');
     //
     $args = array();
     $args = $this->getPhingArguments();
     $args[] = $taskName;
     // Enable output buffering
     \Phing::setOutputStream(new \OutputStream(fopen('php://output', 'w')));
     \Phing::setErrorStream(new \OutputStream(fopen('php://output', 'w')));
     \Phing::startup();
     \Phing::setProperty('phing.home', getenv('PHING_HOME'));
     //
     $myPhing = new \Phing();
     //$returnStatus = true;
     $myPhing->execute($args);
     $myPhing->runBuild();
     /*$this->buffer = ob_get_contents();
       // Guess errors
       if (strstr($this->buffer, 'failed. Aborting.') ||
           strstr($this->buffer, 'Failed to execute') ||
           strstr($this->buffer, 'failed for the following reason:')) {
       }*/
 }
开发者ID:rk4an,项目名称:centreon,代码行数:33,代码来源:PropelMigration.php

示例2: propelGen

 /**
  * Run propel phing commands
  *
  * @param string $cmd	phing target
  * @param array $argv arguments
  * @return string
  */
 public static function propelGen($cmd = '', $argv = array())
 {
     $autoloader = App::getInstance()->autoloader;
     $generatorBase = dirname(dirname(dirname($autoloader->findFile('AbstractPropelDataModelTask'))));
     $buildXml = $generatorBase . '/build.xml';
     $projectPath = \Curry\App::getInstance()['projectPath'] . '/propel';
     $argv[] = '-logger';
     $argv[] = 'phing.listener.AnsiColorLogger';
     $argv[] = '-f';
     $argv[] = $buildXml;
     $argv[] = '-Dproject.dir=' . $projectPath;
     if ($cmd) {
         $argv[] = $cmd;
     }
     $cwd = getcwd();
     $stream = fopen("php://temp", 'r+');
     $outputStream = new OutputStream($stream);
     Phing::setOutputStream($outputStream);
     Phing::setErrorStream($outputStream);
     Phing::startup();
     Phing::fire($argv);
     rewind($stream);
     $content = stream_get_contents($stream);
     Phing::shutdown();
     chdir($cwd);
     if (extension_loaded('apc')) {
         @apc_clear_cache();
     }
     return $content;
 }
开发者ID:bombayworks,项目名称:currycms,代码行数:37,代码来源:DatabaseHelper.php


注:本文中的Phing::setErrorStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。