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


PHP Phing::getDefinedProperty方法代码示例

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


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

示例1: __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

示例2: configureLogging

 /**
  * Configure the logger.
  */
 protected function configureLogging()
 {
     $type = Phing::getDefinedProperty('pear.log.type');
     $name = Phing::getDefinedProperty('pear.log.name');
     $ident = Phing::getDefinedProperty('pear.log.ident');
     $conf = Phing::getDefinedProperty('pear.log.conf');
     if ($type === null) {
         $type = 'file';
     }
     if ($name === null) {
         $name = 'phing.log';
     }
     if ($ident === null) {
         $ident = 'phing';
     }
     if ($conf === null) {
         $conf = array();
     }
     $this->logger = Log::singleton($type, $name, $ident, $conf, self::$levelMap[$this->msgOutputLevel]);
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:23,代码来源:PearLogger.php

示例3: configureLogging

 /**
  * Configure the logger.
  */
 protected function configureLogging()
 {
     $type = Phing::getDefinedProperty('pear.log.type');
     $name = Phing::getDefinedProperty('pear.log.name');
     $ident = Phing::getDefinedProperty('pear.log.ident');
     $conf = Phing::getDefinedProperty('pear.log.conf');
     if ($type === null) {
         $type = 'file';
     }
     if ($name === null) {
         $name = 'phing.log';
     }
     if ($ident === null) {
         $ident = 'phing';
     }
     if ($conf === null) {
         $conf = array();
     }
     include_once 'Log.php';
     if (!class_exists('Log')) {
         throw new BuildException("Cannot find PEAR Log class for use by PearLogger.");
     }
     $this->logger = Log::singleton($type, $name, $ident, $conf, self::$levelMap[$this->msgOutputLevel]);
 }
开发者ID:alexhandzhiev,项目名称:sifact,代码行数:27,代码来源:PearLogListener.php

示例4: buildFinished

 /**
  * Sends the mail
  *
  * @see DefaultLogger#buildFinished
  * @param BuildEvent $event
  */
 public function buildFinished(BuildEvent $event)
 {
     parent::buildFinished($event);
     $project = $event->getProject();
     $properties = $project->getProperties();
     $filename = $properties['phing.log.mail.properties.file'];
     // overlay specified properties file (if any), which overrides project
     // settings
     $fileProperties = new Properties();
     $file = new PhingFile($filename);
     try {
         $fileProperties->load($file);
     } catch (IOException $ioe) {
         // ignore because properties file is not required
     }
     foreach ($fileProperties as $key => $value) {
         $properties['key'] = $project->replaceProperties($value);
     }
     $success = $event->getException() === null;
     $prefix = $success ? 'success' : 'failure';
     try {
         $notify = StringHelper::booleanValue($this->getValue($properties, $prefix . '.notify', 'on'));
         if (!$notify) {
             return;
         }
         if (is_string(Phing::getDefinedProperty('phing.log.mail.subject'))) {
             $defaultSubject = Phing::getDefinedProperty('phing.log.mail.subject');
         } else {
             $defaultSubject = $success ? 'Build Success' : 'Build Failure';
         }
         $hdrs = array();
         $hdrs['From'] = $this->getValue($properties, 'from', $this->from);
         $hdrs['Reply-To'] = $this->getValue($properties, 'replyto', '');
         $hdrs['Cc'] = $this->getValue($properties, $prefix . '.cc', '');
         $hdrs['Bcc'] = $this->getValue($properties, $prefix . '.bcc', '');
         $hdrs['Body'] = $this->getValue($properties, $prefix . '.body', '');
         $hdrs['Subject'] = $this->getValue($properties, $prefix . '.subject', $defaultSubject);
         $tolist = $this->getValue($properties, $prefix . '.to', $this->tolist);
     } catch (BadMethodCallException $e) {
         $project->log($e->getMessage(), Project::MSG_WARN);
     }
     if (empty($tolist)) {
         return;
     }
     $mail = Mail::factory('mail');
     $mail->send($tolist, $hdrs, $this->mailMessage);
 }
开发者ID:Geeklog-Japan,项目名称:geeklog-japan,代码行数:53,代码来源:MailLogger.php


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