• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Phing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: call_phing

 public static function call_phing($task, $target, $build_file = '', $options = array())
 {
     $args = array();
     foreach ($options as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     if ($build_file) {
         $args[] = '-f';
         $args[] = realpath($build_file);
     }
     if (!$task->is_verbose()) {
         $args[] = '-q';
     }
     if (is_array($target)) {
         $args = array_merge($args, $target);
     } else {
         $args[] = $target;
     }
     if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT))) {
         $args[] = '-logger';
         $args[] = 'phing.listener.AnsiColorLogger';
     }
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     $m = new pakePhing();
     $m->execute($args);
     $m->runBuild();
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:28,代码来源:pakePhingTask.class.php


示例2: setUp

 public function setUp()
 {
     Phing::startup();
     $this->project = $this->getMockBuilder('Project')->setMethods(array('getBasedir'))->getMock();
     $this->task = new GuessExtensionKeyTask();
     $this->task->setProject($this->project);
 }
开发者ID:dreadlabs,项目名称:typo3-cms-phing-helper,代码行数:7,代码来源:GuessExtensionKeyTaskTest.php


示例3: testGetFileSystemReturnsCorrect

 /**
  * @dataProvider fileSystemMappingsDataProvider
  */
 public function testGetFileSystemReturnsCorrect($expectedFileSystemClass, $fsTypeKey)
 {
     $this->_resetFileSystem();
     Phing::setProperty('host.fstype', $fsTypeKey);
     $system = FileSystem::getFileSystem();
     $this->assertInstanceOf($expectedFileSystemClass, $system);
 }
开发者ID:eduardobenito10,项目名称:jenkins-php-quickstart,代码行数:10,代码来源:FileSystemTest.php


示例4: targetFinished

 function targetFinished(BuildEvent $event)
 {
     $msg .= PHP_EOL . "Target time: " . self::formatTime(Phing::currentTimeMillis() - $this->targetStartTime) . PHP_EOL;
     $event->setMessage($msg, Project::MSG_INFO);
     $this->messageLogged($event);
     $this->targetName = null;
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:7,代码来源:TargetLogger.php


示例5: call_phing

 public static function call_phing($task, $target, $build_file = '', $options = array())
 {
     $args = array();
     foreach ($options as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     if ($build_file) {
         $args[] = '-f';
         $args[] = realpath($build_file);
     }
     if (!$task->is_verbose()) {
         $args[] = '-q';
     }
     if (is_array($target)) {
         $args = array_merge($args, $target);
     } else {
         $args[] = $target;
     }
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     ob_start(array('pakePhingTask', 'colorize'), 2);
     $m = new pakePhing();
     $m->execute($args);
     $m->runBuild();
     ob_end_clean();
 }
开发者ID:DBezemer,项目名称:server,代码行数:26,代码来源:pakePhingTask.class.php


示例6: setColors

 /**
  * Set the colors to use from a property file specified in the
  * special phing property file "phing/listener/defaults.properties".
  */
 private final function setColors()
 {
     $systemColorFile = new PhingFile(Phing::getResourcePath("phing/listener/defaults.properties"));
     try {
         $prop = new Properties();
         $prop->load($systemColorFile);
         $err = $prop->getProperty("HtmlColorLogger.ERROR_CLASS");
         $warn = $prop->getProperty("HtmlColorLogger.WARNING_CLASS");
         $info = $prop->getProperty("HtmlColorLogger.INFO_CLASS");
         $verbose = $prop->getProperty("HtmlColorLogger.VERBOSE_CLASS");
         $debug = $prop->getProperty("HtmlColorLogger.DEBUG_CLASS");
         if ($err !== null) {
             $this->errColor = self::PREFIX . $err . self::SUFFIX;
         }
         if ($warn !== null) {
             $this->warnColor = self::PREFIX . $warn . self::SUFFIX;
         }
         if ($info !== null) {
             $this->infoColor = self::PREFIX . $info . self::SUFFIX;
         }
         if ($verbose !== null) {
             $this->verboseColor = self::PREFIX . $verbose . self::SUFFIX;
         }
         if ($debug !== null) {
             $this->debugColor = self::PREFIX . $debug . self::SUFFIX;
         }
     } catch (IOException $ioe) {
         //Ignore exception - we will use the defaults.
     }
 }
开发者ID:altesien,项目名称:FinalProject,代码行数:34,代码来源:HtmlColorLogger.php


示例7: callFunction

 /**
  * Calls function and returns results.
  * @return mixed
  */
 protected function callFunction()
 {
     if ($this->class !== null) {
         // import the classname & unqualify it, if necessary
         $this->class = Phing::import($this->class);
         $user_func = array($this->class, $this->function);
         $h_func = $this->class . '::' . $this->function;
         // human-readable (for log)
     } else {
         $user_func = $this->function;
         $h_func = $user_func;
         // human-readable (for log)
     }
     // put parameters into simple array
     $params = array();
     foreach ($this->params as $p) {
         $params[] = $p->getValue();
     }
     $this->log("Calling PHP function: " . $h_func . "()");
     foreach ($params as $p) {
         $this->log("  param: " . $p, PROJECT_MSG_VERBOSE);
     }
     $return = call_user_func_array($user_func, $params);
     return $return;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:29,代码来源:PhpEvalTask.php


示例8: execute

 public function execute($command)
 {
     // test if os match
     $myos = Phing::getProperty("os.name");
     $this->log("Myos = " . $myos, Project::MSG_VERBOSE);
     if ($this->os !== null && strpos($this->os, $myos) === false) {
         // this command will be executed only on the specified OS
         $this->log("Not found in " . $this->os, Project::MSG_VERBOSE);
         return 0;
     }
     if ($this->dir !== null) {
         if ($this->dir->isDirectory()) {
             $currdir = getcwd();
             @chdir($this->dir->getPath());
         } else {
             throw new BuildException("Can't chdir to:" . $this->dir->__toString());
         }
     }
     if ($this->escape == true) {
         // FIXME - figure out whether this is correct behavior
         $command = escapeshellcmd($command);
     }
     if ($this->error !== null) {
         $command .= ' 2> ' . $this->error->getPath();
         $this->log("Writing error output to: " . $this->error->getPath());
     }
     if ($this->output !== null) {
         $command .= ' 1> ' . $this->output->getPath();
         $this->log("Writing standard output to: " . $this->output->getPath());
     } elseif ($this->spawn) {
         $command .= ' 1>/dev/null';
         $this->log("Sending ouptut to /dev/null");
     }
     // If neither output nor error are being written to file
     // then we'll redirect error to stdout so that we can dump
     // it to screen below.
     if ($this->output === null && $this->error === null) {
         $command .= ' 2>&1';
     }
     // we ignore the spawn boolean for windows
     if ($this->spawn) {
         $command .= ' &';
     }
     $this->log("Executing command: " . $command);
     $return = null;
     if ($this->passthru) {
         passthru($command, $return);
     } else {
         $output = array();
         exec($command, $output, $return);
     }
     if ($this->dir !== null) {
         @chdir($currdir);
     }
     if ($return != 0 && $this->checkreturn) {
         throw new BuildException("Task exited with code {$return}");
     }
     return $return;
 }
开发者ID:hellogerard,项目名称:phing-things,代码行数:59,代码来源:ForkPhingTask.php


示例9: setUp

 protected function setUp()
 {
     if (version_compare(PHP_VERSION, '5.3.2') < 0) {
         define('E_DEPRECATED', 8192);
     }
     chdir(dirname(__FILE__));
     Phing::setProperty('phing.home', ZECLIB_TEST_VENDOR_DIR . '/phing');
     Phing::startup();
 }
开发者ID:zenith6,项目名称:eccube-zeclib,代码行数:9,代码来源:TaskTestBase.php


示例10: setUp

 public function setUp()
 {
     Phing::startup();
     $this->base = $this->getMockBuilder('PhingFile')->setConstructorArgs(array(dirname(__FILE__) . '/../Fixtures/BaseLocalConfiguration.php'))->setMethods(NULL)->getMock();
     $this->update = $this->getMockBuilder('PhingFile')->setConstructorArgs(array(dirname(__FILE__) . '/../Fixtures/UpdateLocalConfiguration.php'))->setMethods(NULL)->getMock();
     $_tempTargetFile = tempnam('/tmp', 'tmp');
     $tempTargetFile = $this->getMockBuilder('PhingFile')->setConstructorArgs(array($_tempTargetFile))->setMethods(NULL)->getMock();
     $this->fileWriter = $this->getMockBuilder('FileWriter')->setConstructorArgs(array($tempTargetFile))->getMock();
     $this->task = new MergeLocalConfigurationTask();
 }
开发者ID:dreadlabs,项目名称:typo3-cms-phing-helper,代码行数:10,代码来源:MergeLocalConfigurationTaskTest.php


示例11: __construct

 public function __construct()
 {
     // @todo These should have an auto-loader
     require_once 'phing/Phing.php';
     require_once 'phing/Project.php';
     require_once 'phing/types/FileSet.php';
     require_once 'phing/system/io/PhingFile.php';
     require_once 'phing/system/util/Properties.php';
     // Needs calling quite early (e.g. PhingFile won't work without it)
     Phing::startup();
 }
开发者ID:halfer,项目名称:Meshing,代码行数:11,代码来源:Task.php


示例12: runBuild

 /**
  * @see Phing
  */
 public function runBuild()
 {
     // workaround for included phing 2.3 which by default loads many tasks
     // that are not needed and incompatible (eg phing.tasks.ext.FtpDeployTask)
     // by placing current directory on the include path our defaults will be loaded
     // see ticket #5054
     $includePath = get_include_path();
     set_include_path(dirname(__FILE__) . PATH_SEPARATOR . $includePath);
     parent::runBuild();
     set_include_path($includePath);
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:14,代码来源:sfPhing.class.php


示例13: setUp

 public function setUp()
 {
     Phing::startup();
     $this->project = $this->getMockBuilder('Project')->setMethods(NULL)->getMock(NULL);
     $tempTargetFile = tempnam('/tmp', 'tmp');
     $this->file = $this->getMockBuilder('PhingFile')->setConstructorArgs(array($tempTargetFile))->setMethods(NULL)->getMock();
     $propertyTask = $this->getMockBuilder('PropertyTask')->setMethods(NULL)->getMock();
     $propertyTask->setProject($this->project);
     $propertyTask->setFile(dirname(__FILE__) . '/../Fixtures/LocalConfiguration.properties');
     $propertyTask->setPrefix('LocalConfiguration.');
     $propertyTask->main();
     $this->task = new GenerateLocalConfigurationTask();
     $this->task->setProject($this->project);
 }
开发者ID:dreadlabs,项目名称:typo3-cms-phing-helper,代码行数:14,代码来源:GenerateLocalConfigurationTaskTest.php


示例14: main

 /**
  * Does the work.
  *
  * @throws BuildException if someting goes wrong with the build
  */
 public final function main()
 {
     if ($this->cvsRoot === null) {
         throw new BuildException("cvsroot is required");
     }
     if ($this->password === null) {
         throw new BuildException("password is required");
     }
     $this->log("cvsRoot: " . $this->cvsRoot, PROJECT_MSG_DEBUG);
     $this->log("password: " . $this->password, PROJECT_MSG_DEBUG);
     $this->log("passFile: " . $this->passFile->__toString(), PROJECT_MSG_DEBUG);
     $reader = null;
     $writer = null;
     try {
         $buf = "";
         if ($this->passFile->exists()) {
             $reader = new BufferedReader(new FileReader($this->passFile));
             $line = null;
             while (($line = $reader->readLine()) !== null) {
                 if (!StringHelper::startsWith($this->cvsRoot, $line)) {
                     $buf .= $line . Phing::getProperty("line.separator");
                 }
             }
         }
         $pwdfile = $buf . $this->cvsRoot . " A" . $this->mangle($this->password);
         $this->log("Writing -> " . $pwdfile, PROJECT_MSG_DEBUG);
         $writer = new BufferedWriter(new FileWriter($this->passFile));
         $writer->write($pwdfile);
         $writer->newLine();
         $writer->close();
         if ($reader) {
             $reader->close();
         }
     } catch (IOException $e) {
         if ($reader) {
             try {
                 $reader->close();
             } catch (Exception $e) {
             }
         }
         if ($writer) {
             try {
                 $writer->close();
             } catch (Exception $e) {
             }
         }
         throw new BuildException($e);
     }
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:54,代码来源:CvsPassTask.php


示例15: evaluate

 function evaluate()
 {
     $osName = strtolower(Phing::getProperty("os.name"));
     if ($this->family !== null) {
         if ($this->family === "windows") {
             return StringHelper::startsWith("win", $osName);
         } elseif ($this->family === "mac") {
             return strpos($osName, "mac") !== false || strpos($osName, "darwin") !== false;
         } elseif ($this->family === "unix") {
             return StringHelper::endsWith("ix", $osName) || StringHelper::endsWith("ux", $osName) || StringHelper::endsWith("bsd", $osName) || StringHelper::startsWith("sunos", $osName) || StringHelper::startsWith("darwin", $osName);
         }
         throw new BuildException("Don't know how to detect os family '" . $this->family . "'");
     }
     return false;
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:15,代码来源:OsCondition.php


示例16: selectorCreate

 /**
  * Instantiates the identified custom selector class.
  */
 public function selectorCreate()
 {
     if ($this->classname !== null && $this->classname !== "") {
         try {
             // assume it's fully qualified, import it
             $cls = Phing::import($this->classname);
             // make sure class exists
             if (class_exists($cls)) {
                 $this->dynselector = new $cls();
             } else {
                 $this->setError("Selector " . $this->classname . " not initialized, no such class");
             }
         } catch (Exception $e) {
             $this->setError("Selector " . $this->classname . " not initialized, could not create class: " . $e->getMessage());
         }
     } else {
         $this->setError("There is no classname specified");
     }
 }
开发者ID:nmicht,项目名称:tlalokes-in-acst,代码行数:22,代码来源:ExtendSelector.php


示例17: getStyleSheet

 /**
  * Returns the path to the XSL stylesheet
  */
 private function getStyleSheet()
 {
     $xslname = "phpunit2-" . $this->format . ".xsl";
     if ($this->styleDir) {
         $file = new PhingFile($this->styleDir, $xslname);
     } else {
         $path = Phing::getResourcePath("phing/etc/{$xslname}");
         if ($path === NULL) {
             $path = Phing::getResourcePath("etc/{$xslname}");
             if ($path === NULL) {
                 throw new BuildException("Could not find {$xslname} in resource path");
             }
         }
         $file = new PhingFile($path);
     }
     if (!$file->exists()) {
         throw new BuildException("Could not find file " . $file->getPath());
     }
     return $file;
 }
开发者ID:taryono,项目名称:school,代码行数:23,代码来源:PHPUnit2ReportTask.php


示例18: __construct

 /**
  * Construct new MailLogger
  */
 public function __construct()
 {
     parent::__construct();
     @(require_once 'Mail.php');
     if (!class_exists('Mail')) {
         throw new BuildException('Need the PEAR Mail package to send logs');
     }
     $from = Phing::getDefinedProperty('phing.log.mail.from');
     $subject = Phing::getDefinedProperty('phing.log.mail.subject');
     $tolist = Phing::getDefinedProperty('phing.log.mail.recipients');
     if (!empty($from)) {
         $this->_from = $from;
     }
     if (!empty($subject)) {
         $this->_subject = $subject;
     }
     if (!empty($tolist)) {
         $this->_tolist = $tolist;
     }
 }
开发者ID:sergeytsivin,项目名称:haru,代码行数:23,代码来源:MailLogger.php


示例19: load

 /**
  * This method is called to load the sources from the reader
  * into the buffer of the source.
  */
 function load()
 {
     // Create new Reader
     if ($this->classname === null) {
         throw new BuildException("No Classname given to TokenSource.");
     }
     $classname = Phing::import($this->classname);
     $this->reader = new $classname($this->project);
     // Configure Reader
     $this->configureTokenReader($this->reader);
     // Load Tokens
     try {
         while ($token = $this->reader->readToken()) {
             $this->tokens[] = $token;
         }
     } catch (BuildException $e) {
         $this->log("Error reading TokenSource: " . $e->getMessage(), PROJECT_MSG_WARN);
     } catch (IOException $e) {
         $this->log("Error reading TokenSource: " . $e->getMessage(), PROJECT_MSG_WARN);
     }
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:25,代码来源:TokenSource.php


示例20: main

 /**
  * Executes this task.
  */
 public function main()
 {
     if ($this->file === null) {
         throw new BuildException('The file attribute must be specified');
     }
     $return = getcwd();
     try {
         /* Resolve paths correctly: Everything we do as far as
          * configuration is concerned should be relative to the
          * new project file. */
         chdir($this->file->getAbsoluteFile()->getParent());
         $project = new AgaviProxyProject($this->project);
         $project->addReference('phing.parsing.context', new AgaviProxyXmlContext($project));
         $project->setUserProperty('phing.file', $this->file->getAbsolutePath());
         $project->init();
         Phing::setCurrentProject($project);
         ProjectConfigurator::configureProject($project, $this->file);
         foreach ($project->getTargets() as $name => $target) {
             /* Make sure we don't add proxy targets back to our own project. */
             if ($target instanceof AgaviProxyTarget && $target->getTarget()->getProject() === $this->project) {
                 continue;
             }
             if (array_key_exists($name, $this->project->getTargets())) {
                 throw new BuildException(sprintf('Target conflict: %s already exists in project (attempted to add from %s)', $name, $this->file->getAbsolutePath()));
             }
             $proxy = new AgaviProxyTarget();
             $proxy->setName($name);
             $proxy->setDescription($target->getDescription());
             $proxy->setTarget($target);
             $this->project->addTarget($name, $proxy);
         }
         Phing::setCurrentProject($this->project);
         $this->log(sprintf('Importing external build file %s', $this->file->getAbsolutePath()), Project::MSG_INFO);
     } catch (Exception $e) {
         $this->log(sprintf('Could not read %s: %s (skipping)', $this->file->getAbsolutePath(), $e->getMessage()), Project::MSG_WARN);
     }
     /* Go back from whence we came. */
     chdir($return);
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:42,代码来源:AgaviImportTask.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP PhingFile类代码示例发布时间:2022-05-23
下一篇:
PHP PharData类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap