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


PHP PEAR_PackageFile_v2::setLogger方法代码示例

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


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

示例1: parse

 function parse($data, $file, $archive = false)
 {
     if (PEAR::isError($err = parent::parse($data, $file))) {
         return $err;
     }
     $ret = new PEAR_PackageFile_v2();
     $ret->setConfig($this->_config);
     if (isset($this->_logger)) {
         $ret->setLogger($this->_logger);
     }
     $ret->fromArray($this->_unserializedData);
     $ret->setPackagefile($file, $archive);
     return $ret;
 }
开发者ID:alex-k,项目名称:velotur,代码行数:14,代码来源:v2.php

示例2: array


//.........这里部分代码省略.........
     $arr['summary'] = $this->_packagefile->getSummary();
     $arr['description'] = $this->_packagefile->getDescription();
     $maintainers = $this->_packagefile->getMaintainers();
     foreach ($maintainers as $maintainer) {
         if ($maintainer['role'] != 'lead') {
             continue;
         }
         $new = array('name' => $maintainer['name'], 'user' => $maintainer['handle'], 'email' => $maintainer['email'], 'active' => 'yes');
         $arr['lead'][] = $new;
     }
     if (!isset($arr['lead'])) {
         // some people... you know?
         $arr['lead'] = array('name' => 'unknown', 'user' => 'unknown', 'email' => 'noleadmaintainer@example.com', 'active' => 'no');
     }
     if (count($arr['lead']) == 1) {
         $arr['lead'] = $arr['lead'][0];
     }
     foreach ($maintainers as $maintainer) {
         if ($maintainer['role'] == 'lead') {
             continue;
         }
         $new = array('name' => $maintainer['name'], 'user' => $maintainer['handle'], 'email' => $maintainer['email'], 'active' => 'yes');
         $arr[$maintainer['role']][] = $new;
     }
     if (isset($arr['developer']) && count($arr['developer']) == 1) {
         $arr['developer'] = $arr['developer'][0];
     }
     if (isset($arr['contributor']) && count($arr['contributor']) == 1) {
         $arr['contributor'] = $arr['contributor'][0];
     }
     if (isset($arr['helper']) && count($arr['helper']) == 1) {
         $arr['helper'] = $arr['helper'][0];
     }
     $arr['date'] = $this->_packagefile->getDate();
     $arr['version'] = array('release' => $this->_packagefile->getVersion(), 'api' => $this->_packagefile->getVersion());
     $arr['stability'] = array('release' => $this->_packagefile->getState(), 'api' => $this->_packagefile->getState());
     $licensemap = array('php license' => 'http://www.php.net/license', 'lgpl' => 'http://www.gnu.org/copyleft/lesser.html', 'bsd' => 'http://www.opensource.org/licenses/bsd-license.php', 'mit' => 'http://www.opensource.org/licenses/mit-license.php', 'gpl' => 'http://www.gnu.org/copyleft/gpl.html', 'apache' => 'http://www.opensource.org/licenses/apache2.0.php');
     if (isset($licensemap[strtolower($this->_packagefile->getLicense())])) {
         $uri = $licensemap[strtolower($this->_packagefile->getLicense())];
     } else {
         $uri = 'http://www.example.com';
     }
     $arr['license'] = array('attribs' => array('uri' => $uri), '_content' => $this->_packagefile->getLicense());
     $arr['notes'] = $this->_packagefile->getNotes();
     $temp = array();
     $arr['contents'] = $this->_convertFilelist2_0($temp);
     $this->_convertDependencies2_0($arr);
     $release = $this->_packagefile->getConfigureOptions() || $this->_isExtension ? 'extsrcrelease' : 'phprelease';
     if ($release == 'extsrcrelease') {
         $arr['channel'] = 'pecl.php.net';
         $arr['providesextension'] = strtolower($arr['name']);
         // assumption
     }
     $arr[$release] = array();
     if ($this->_packagefile->getConfigureOptions()) {
         $arr[$release]['configureoption'] = $this->_packagefile->getConfigureOptions();
         foreach ($arr[$release]['configureoption'] as $i => $opt) {
             $arr[$release]['configureoption'][$i] = array('attribs' => $opt);
         }
         if (count($arr[$release]['configureoption']) == 1) {
             $arr[$release]['configureoption'] = $arr[$release]['configureoption'][0];
         }
     }
     $this->_convertRelease2_0($arr[$release], $temp);
     if ($cl = $this->_packagefile->getChangelog()) {
         foreach ($cl as $release) {
             $rel = array();
             $rel['version'] = array('release' => $release['version'], 'api' => $release['version']);
             if (!isset($release['release_state'])) {
                 $release['release_state'] = 'stable';
             }
             $rel['stability'] = array('release' => $release['release_state'], 'api' => $release['release_state']);
             if (isset($release['release_date'])) {
                 $rel['date'] = $release['release_date'];
             } else {
                 $rel['date'] = date('Y-m-d');
             }
             if (isset($release['release_license'])) {
                 if (isset($licensemap[strtolower($release['release_license'])])) {
                     $uri = $licensemap[strtolower($release['release_license'])];
                 } else {
                     $uri = 'http://www.example.com';
                 }
                 $rel['license'] = array('attribs' => array('uri' => $uri), '_content' => $release['release_license']);
             } else {
                 $rel['license'] = $arr['license'];
             }
             if (!isset($release['release_notes'])) {
                 $release['release_notes'] = 'no release notes';
             }
             $rel['notes'] = $release['release_notes'];
             $arr['changelog']['release'][] = $rel;
         }
     }
     $ret = new PEAR_PackageFile_v2();
     $ret->setConfig($this->_packagefile->_config);
     $ret->setLogger($this->_packagefile->_logger);
     $ret->fromArray($arr);
     return $ret;
 }
开发者ID:alex-k,项目名称:velotur,代码行数:101,代码来源:v1.php


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