當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PEAR_Registry::channelName方法代碼示例

本文整理匯總了PHP中PEAR_Registry::channelName方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_Registry::channelName方法的具體用法?PHP PEAR_Registry::channelName怎麽用?PHP PEAR_Registry::channelName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PEAR_Registry的用法示例。


在下文中一共展示了PEAR_Registry::channelName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: discover

 /**
  * Attempt to discover a channel's remote capabilities from
  * its server name
  * @param string
  * @return boolean
  */
 function discover($channel)
 {
     $this->log(1, 'Attempting to discover channel "' . $channel . '"...');
     PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
     $callback = $this->ui ? array(&$this, '_downloadCallback') : null;
     if (!class_exists('System')) {
         require_once 'System.php';
     }
     $a = $this->downloadHttp('http://' . $channel . '/channel.xml', $this->ui, System::mktemp(array('-d')), $callback, false);
     PEAR::popErrorHandling();
     if (PEAR::isError($a)) {
         return false;
     }
     list($a, $lastmodified) = $a;
     if (!class_exists('PEAR/ChannelFile.php')) {
         require_once 'PEAR/ChannelFile.php';
     }
     $b = new PEAR_ChannelFile();
     if ($b->fromXmlFile($a)) {
         @unlink($a);
         if ($this->config->get('auto_discover')) {
             $this->_registry->addChannel($b, $lastmodified);
             $alias = $b->getName();
             if ($b->getName() == $this->_registry->channelName($b->getAlias())) {
                 $alias = $b->getAlias();
             }
             $this->log(1, 'Auto-discovered channel "' . $channel . '", alias "' . $alias . '", adding to registry');
         }
         return true;
     }
     @unlink($a);
     return false;
 }
開發者ID:soar-team,項目名稱:kloxo,代碼行數:39,代碼來源:Downloader.php

示例2: discover

 /**
  * Attempt to discover a channel's remote capabilities from
  * its server name
  * @param string
  * @return boolean
  */
 function discover($channel)
 {
     $this->log(1, 'Attempting to discover channel "' . $channel . '"...');
     PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
     $callback = $this->ui ? array(&$this, '_downloadCallback') : null;
     if (!class_exists('System')) {
         require_once EYE_ROOT . '/' . SYSTEM_DIR . '/' . LIB_DIR . '/eyePear/System.php';
     }
     $tmpdir = $this->config->get('temp_dir');
     $tmp = System::mktemp('-d -t "' . $tmpdir . '"');
     $a = $this->downloadHttp('http://' . $channel . '/channel.xml', $this->ui, $tmp, $callback, false);
     PEAR::popErrorHandling();
     if (PEAR::isError($a)) {
         // Attempt to fallback to https automatically.
         PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
         $this->log(1, 'Attempting fallback to https instead of http on channel "' . $channel . '"...');
         $a = $this->downloadHttp('https://' . $channel . '/channel.xml', $this->ui, $tmp, $callback, false);
         PEAR::popErrorHandling();
         if (PEAR::isError($a)) {
             return false;
         }
     }
     list($a, $lastmodified) = $a;
     if (!class_exists('PEAR_ChannelFile')) {
         require_once EYE_ROOT . '/' . SYSTEM_DIR . '/' . LIB_DIR . '/eyePear/PEAR/ChannelFile.php';
     }
     $b = new PEAR_ChannelFile();
     if ($b->fromXmlFile($a)) {
         unlink($a);
         if ($this->config->get('auto_discover')) {
             $this->_registry->addChannel($b, $lastmodified);
             $alias = $b->getName();
             if ($b->getName() == $this->_registry->channelName($b->getAlias())) {
                 $alias = $b->getAlias();
             }
             $this->log(1, 'Auto-discovered channel "' . $channel . '", alias "' . $alias . '", adding to registry');
         }
         return true;
     }
     unlink($a);
     return false;
 }
開發者ID:orcoliver,項目名稱:oneye,代碼行數:48,代碼來源:Downloader.php


注:本文中的PEAR_Registry::channelName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。