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


PHP Factory::getLogger方法代碼示例

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


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

示例1: __construct

 public function __construct(Factory $factory)
 {
     $this->factory = $factory;
     $this->db = $factory->getDb();
     $this->logger = $factory->getLogger();
     $this->mainTable = $this->getMainTable();
     $this->relationsTable = $this->getRelationsTable();
     $this->createTables();
 }
開發者ID:michelezamuner,項目名稱:groph-php-simple,代碼行數:9,代碼來源:Collection.php

示例2: flushResults

 private function flushResults()
 {
     while ($this->mDb->more_results()) {
         $this->mDb->next_result();
         if ($res = $this->mDb->store_result()) {
             if ($res->errorno) {
                 Factory::getLogger()->error($res->error);
             }
             $res->free();
         }
     }
 }
開發者ID:espena,項目名稱:peel,代碼行數:12,代碼來源:database.inc.php

示例3: start

 public function start()
 {
     $this->mPeeler->start();
     $this->mData = $this->mPeeler->getData();
     $c = $this->getConfig();
     foreach ($this->mData as &$sourceInfo) {
         if (preg_match('/' . $c['peeler']['url_metadata'] . '/', $sourceInfo['url'], $m) == 1) {
             $sourceInfo['metadata'] = Utils::purgeNumericSubscripts($m);
         } else {
             $log = Factory::getLogger();
             $log->error("Missing or unexpected information in url: %s", $sourceInfo['url']);
         }
     }
 }
開發者ID:espena,項目名稱:peel,代碼行數:14,代碼來源:peeler__url_metadata.inc.php

示例4: run

 /**
  * Run application.
  *
  * Starts application execution. Iterates through each enabled peeler,
  * creates the peeler object, passing in configuration data for
  * that peeler and runs it.
  *
  * @return void
  */
 public function run()
 {
     $log = Factory::getLogger();
     $log->message('Peel engine started');
     $this->mBase->run();
     $c = $this->getConfig();
     foreach ($c['peelers'] as $name => $peelerConf) {
         if ($peelerConf['peeler']['status'] == 'enabled') {
             $this->mPeelers[$name] = Factory::createPeeler($peelerConf);
             $this->mPeelers[$name]->start();
         }
     }
     $log->message('Peel engine finished');
 }
開發者ID:espena,項目名稱:peel,代碼行數:23,代碼來源:app_peel_engine.inc.php

示例5: getDestinationDir

 private function getDestinationDir()
 {
     $c = $this->getConfig();
     $dir = $c['peeler']['download_to'];
     if (!file_exists($dir)) {
         $log = Factory::getLogger();
         $log->warning("Directory %s does not exist", $dir);
         if (mkdir($dir, 0777, true)) {
             $log->message("Destination directory successfully created");
         } else {
             $log->error("Could not create destination directory");
             $dir = FALSE;
         }
     }
     return $dir;
 }
開發者ID:espena,項目名稱:peel,代碼行數:16,代碼來源:peeler__download_to.inc.php

示例6: resolveDestinationPath

 public function resolveDestinationPath($dir, $sourceInfo)
 {
     $log = Factory::getLogger();
     $res = $this->mPeeler->resolveDestinationPath($dir, $sourceInfo);
     $c = $this->getConfig();
     $db = Factory::getDatabase();
     switch ($c['peeler']['unique_by']) {
         case 'url':
             if ($db->urlDownloaded($sourceInfo['url'])) {
                 $log->message('Skipping %s (already downloaded)', $sourceInfo['url']);
                 $res = null;
             }
             break;
         case 'checksum':
             break;
     }
     return $res;
 }
開發者ID:espena,項目名稱:peel,代碼行數:18,代碼來源:peeler__unique_by.inc.php

示例7: getJson

 private function getJson()
 {
     switch ($_GET['json']) {
         case 'peel_log':
             $log = Factory::getLogger();
             $data = $log->getContent();
             break;
         case 'peel_ctrl':
             $conf = Factory::getConfig();
             $data = array_map(function ($e) {
                 return $e['peeler'];
             }, $conf['peelers']);
             break;
         default:
             $data = array();
     }
     return json_encode($data);
 }
開發者ID:espena,項目名稱:peel,代碼行數:18,代碼來源:app_ajax_response.inc.php

示例8: expand

 private function expand($metadata, $tag)
 {
     $exp = '';
     $parts = explode('|', $tag);
     if (isset($metadata[$parts[0]])) {
         $exp = trim($metadata[$parts[0]]);
         for ($i = 1; $i < count($parts); $i++) {
             $params = array();
             if (preg_match('/^([^\\(]+)\\(([^\\)]*)\\)$/i', $parts[$i], $m)) {
                 $func = $m[1];
                 $params = explode(',', $m[2]);
             } else {
                 $func = strtolower(trim($parts[$i]));
             }
             $exp = $this->execute($func, $params, $exp);
         }
     } else {
         $log = Factory::getLogger();
         $log->error("Missing %s in metadata", $tag);
     }
     return $exp;
 }
開發者ID:espena,項目名稱:peel,代碼行數:22,代碼來源:peeler__rename_to.inc.php

示例9: enablePeeler

 /**
  * Enable available peeler.
  *
  * Copies the configuration file for the selected peeler from the
  * peelers-available directory to the peelers-enabled directory.
  *
  * @param string $peelerToEnable The name of the peeler that should be enabled.
  * @return void
  */
 private function enablePeeler($peelerToEnable)
 {
     if (empty($peelerToEnable)) {
         return;
     }
     $source = sprintf('%s/%s.conf', $this->mPathPeelersAvailable, $peelerToEnable);
     $destin = sprintf('%s/%s.conf', $this->mPathPeelersEnabled, $peelerToEnable);
     if (!file_exists($destin) && file_exists($source)) {
         if (symlink($source, $destin)) {
             Factory::getLogger()->message("Peeler %s successfully enabled", $peelerToEnable);
         } else {
             Factory::getLogger()->error("Unable to acitvate peeler %s", $peelerToEnable);
         }
     }
 }
開發者ID:espena,項目名稱:peel,代碼行數:24,代碼來源:app_enabler.inc.php

示例10: __construct

 public function __construct($configKey, $apiUrl = '')
 {
     $this->setConfigKey($configKey);
     if ($apiUrl == '') {
         $apiUrl = getenv('sofortApiUrl') != '' ? getenv('sofortApiUrl') : self::GATEWAY_URL;
     }
     $SofortLibHttp = Factory::getHttpConnection($apiUrl);
     $XmlDataHandler = Factory::getDataHandler($configKey);
     $this->setDataHandler($XmlDataHandler);
     $FileLogger = Factory::getLogger();
     $this->setLogger($FileLogger);
     $this->_DataHandler->setConnection($SofortLibHttp);
     $this->enableLogging = getenv('sofortDebug') == 'true' ? true : false;
 }
開發者ID:sofort,項目名稱:sofortlib-php,代碼行數:14,代碼來源:AbstractWrapper.php


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