当前位置: 首页>>代码示例>>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;未经允许,请勿转载。