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


PHP Pimcore::initLogger方法代码示例

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


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

示例1: ini_set

/**
 * This source file is subject to the new BSD license that is
 * available through the world-wide-web at this URL:
 * http://www.pimcore.org/license
 *
 * @copyright  Copyright (c) 2013 Weblizards GbR (http://www.weblizards.de)
 * @author     Thomas Keil <thomas@weblizards.de>
 * @license    http://www.pimcore.org/license     New BSD License
 */
ini_set('memory_limit', '2048M');
set_time_limit(-1);
date_default_timezone_set("Europe/Berlin");
include_once dirname(__FILE__) . "/../../../pimcore/config/startup.php";
Pimcore::initAutoloader();
Pimcore::initConfiguration();
Pimcore::initLogger();
Pimcore::initPlugins();
$opts = new Zend_Console_Getopt(array('language|l=s' => "language", 'document|d=s' => "document"));
try {
    $opts->parse();
} catch (Exception $e) {
    Logger::critical($e->getMessage());
    die("Error: " . $e->getMessage());
}
$sphinx_config = SphinxSearch_Config::getInstance();
$documents = $sphinx_config->getDocumentsAsArray();
if (!array_key_exists($opts->document, $documents)) {
    SphinxSearch_Logger::err("Unknown document: " . $opts->document . "\n");
    print "Unknown document: " . $opts->document . "\n";
    print "Possible documents are:\n";
    foreach ($documents as $document_name => $document_config) {
开发者ID:VadzimBelski-ScienceSoft,项目名称:pimcore-plugin-SphinxSearch,代码行数:31,代码来源:index_documents.php

示例2: launchJob

 /**
  * @param $job
  * @return bool
  */
 protected function launchJob($job)
 {
     $pid = pcntl_fork();
     if ($pid == -1) {
         //Problem launching the job
         \Logger::error('Could not launch new job with id [ ' . $job->getId() . ' ], exiting');
         return false;
     } else {
         if ($pid) {
             $this->currentJobs[$pid] = $job->getId();
             if (isset($this->signalQueue[$pid])) {
                 $this->childSignalHandler(SIGCHLD, $pid, $this->signalQueue[$pid]);
                 unset($this->signalQueue[$pid]);
             }
         } else {
             //Forked child
             try {
                 \Pimcore\Db::reset();
                 // reset resource
                 \Pimcore::initLogger();
                 // reinit logger so that he gets a different token eg for mailing
                 \Logger::debug("Executing job [ " . $job->getId() . " ] as forked child");
                 $job->execute();
             } catch (\Exception $e) {
                 \Logger::error($e);
                 \Logger::error("Failed to execute job with id [ " . $job->getId() . " ] and method [ " . $job->getMethod() . " ]");
             }
             $job->unlock();
             \Logger::debug("Done with job [ " . $job->getId() . " ]");
             exit(0);
         }
     }
     return true;
 }
开发者ID:ChristophWurst,项目名称:pimcore,代码行数:38,代码来源:Daemon.php


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