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


PHP Logger::crit方法代码示例

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


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

示例1: uninstall

 /**
  * @return string $statusMessage
  */
 public static function uninstall()
 {
     try {
         // remove static routes
         Feed_Plugin_Install::removeStaticRoutes();
         return self::getTranslate()->_('feed_uninstalled_successfully');
     } catch (Exception $e) {
         Logger::crit($e);
         return self::getTranslate()->_('feed_uninstall_failed');
     }
 }
开发者ID:anyMOTION-GRAPHICS,项目名称:pimcore-rss-atom-feed-plugin,代码行数:14,代码来源:Plugin.php

示例2: __construct

 public function __construct()
 {
     $this->logger = Logger::instance(__CLASS__);
     if (!defined('WSDL_URL')) {
         $this->logger->crit('constant WSDL_URL is not set. Check config/soap.inc.php');
         exit;
     }
     if (!defined('SOAP_OUTPUT_BASE_DIR')) {
         $this->logger->crit('constant SOAP_OUTPUT_BASE_DIR is not set. Check config/soap.inc.php');
         exit;
     }
     if (!defined('SOAP_MODEL_DIR')) {
         $this->logger->crit('constant SOAP_MODEL_DIR is not set. Check config/soap.inc.php');
         exit;
     }
     if (!is_dir(SOAP_OUTPUT_BASE_DIR . '/' . SOAP_MODEL_DIR)) {
         mkdir(SOAP_OUTPUT_BASE_DIR . '/' . SOAP_MODEL_DIR, 0755, true);
     }
     $this->soapClient = new SoapClient(WSDL_URL);
 }
开发者ID:PhDasen,项目名称:php_soap_client_mu,代码行数:20,代码来源:PlentymarketsSoapModelGenerator.class.php

示例3: uninstall

 public static function uninstall()
 {
     try {
         $installer = new Installer(PIMCORE_PLUGINS_PATH . '/Member/install');
         $installer->removeObjectFolder('/members');
         $installer->removeClassmap('Object_Member');
         $installer->removeConfig('member');
         $installer->removeDocuments();
         $installer->removeClass('Member');
     } catch (\Exception $e) {
         \Logger::crit($e);
         return sprintf(self::getTranslate()->_('plugin_member_uninstall_failed'), $e->getMessage());
     }
     return self::getTranslate()->_('plugin_member_uninstall_successful');
 }
开发者ID:Pegasuz,项目名称:member,代码行数:15,代码来源:Plugin.php

示例4: getInstance

 /**
  * @static
  * @return null|Pimcore_Video_Adapter
  */
 public static function getInstance($adapter = null)
 {
     try {
         if ($adapter) {
             $adapterClass = "Pimcore_Video_Adapter_" . $adapter;
             if (Pimcore_Tool::classExists($adapterClass)) {
                 return new $adapterClass();
             } else {
                 throw new Exception("Video-transcode adapter `" . $adapter . "´ does not exist.");
             }
         } else {
             return new Pimcore_Video_Adapter_Ffmpeg();
         }
     } catch (Exception $e) {
         Logger::crit("Unable to load video adapter: " . $e->getMessage());
         throw $e;
     }
     return null;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:23,代码来源:Video.php

示例5: getInstance

 /**
  * @param null $adapter
  * @return bool|null|Video\Adapter
  * @throws \Exception
  */
 public static function getInstance($adapter = null)
 {
     try {
         if ($adapter) {
             $adapterClass = "\\Pimcore\\Video\\Adapter\\" . $adapter;
             if (Tool::classExists($adapterClass)) {
                 return new $adapterClass();
             } else {
                 throw new \Exception("Video-transcode adapter `" . $adapter . "´ does not exist.");
             }
         } else {
             if ($adapter = self::getDefaultAdapter()) {
                 return $adapter;
             }
         }
     } catch (\Exception $e) {
         \Logger::crit("Unable to load video adapter: " . $e->getMessage());
         throw $e;
     }
     return null;
 }
开发者ID:ChristophWurst,项目名称:pimcore,代码行数:26,代码来源:Video.php

示例6: uninstall

 /**
  * @return string $statusMessage
  */
 public static function uninstall()
 {
     try {
         $install = new Blog_Plugin_Install();
         // remove predefined document types
         $install->removeDocTypes();
         // remove static routes
         $install->removeStaticRoutes();
         // remove custom view
         $install->removeCustomView();
         // remove object folder with all childs
         $install->removeFolders();
         // classmap
         $install->unsetClassmap();
         // remove classes
         $install->removeClass('BlogEntry');
         $install->removeClass('BlogCategory');
         return self::getTranslate()->_('blog_uninstalled_successfully');
     } catch (Exception $e) {
         Logger::crit($e);
         return self::getTranslate()->_('blog_uninstall_failed');
     }
 }
开发者ID:weblizards-gmbh,项目名称:blog,代码行数:26,代码来源:Plugin.php

示例7: getInstance

 /**
  * @static
  * @return null|Pimcore_Image_Adapter
  */
 public static function getInstance($adapter = null)
 {
     try {
         if ($adapter) {
             $adapterClass = "Pimcore_Image_Adapter_" . $adapter;
             if (class_exists($adapterClass)) {
                 return new $adapterClass();
             } else {
                 throw new Exception("Image-transform adapter `" . $adapter . "´ does not exist.");
             }
         } else {
             if (extension_loaded("imagick")) {
                 return new Pimcore_Image_Adapter_Imagick();
             } else {
                 return new Pimcore_Image_Adapter_GD();
             }
         }
     } catch (Exception $e) {
         Logger::crit("Unable to load image extensions: " . $e->getMessage());
         throw $e;
     }
     return null;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:27,代码来源:Image.php

示例8: clearDependentCache

 /**
  * @param array $additionalTags
  */
 public function clearDependentCache($additionalTags = array())
 {
     try {
         $tags = array("object_" . $this->getId(), "object_properties", "output");
         $tags = array_merge($tags, $additionalTags);
         Cache::clearTags($tags);
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }
开发者ID:rolandstoll,项目名称:pimcore,代码行数:13,代码来源:AbstractObject.php

示例9: init

 /**
  *
  */
 public static function init()
 {
     if (!self::$instance instanceof \Zend_Cache_Core) {
         // check for custom cache configuration
         $customCacheFile = PIMCORE_CONFIGURATION_DIRECTORY . "/cache.xml";
         if (is_file($customCacheFile)) {
             $config = self::getDefaultConfig();
             try {
                 $conf = new \Zend_Config_Xml($customCacheFile);
                 if ($conf->frontend) {
                     $config["frontendType"] = (string) $conf->frontend->type;
                     $config["customFrontendNaming"] = (bool) $conf->frontend->custom;
                     if ($conf->frontend->options && method_exists($conf->frontend->options, "toArray")) {
                         $config["frontendConfig"] = $conf->frontend->options->toArray();
                     }
                 }
                 if ($conf->backend) {
                     $config["backendType"] = (string) $conf->backend->type;
                     $config["customBackendNaming"] = (bool) $conf->backend->custom;
                     if ($conf->backend->options && method_exists($conf->backend->options, "toArray")) {
                         $config["backendConfig"] = $conf->backend->options->toArray();
                     }
                 }
                 if (isset($config["frontendConfig"]["lifetime"])) {
                     self::$defaultLifetime = $config["frontendConfig"]["lifetime"];
                 }
                 $config = self::normalizeConfig($config);
                 // here you can use the cache backend you like
                 try {
                     self::$instance = self::initializeCache($config);
                 } catch (\Exception $e) {
                     \Logger::crit("can't initialize cache with the given configuration " . $e->getMessage());
                 }
             } catch (\Exception $e) {
                 \Logger::crit($e);
                 \Logger::crit("Error while reading cache configuration, using the default file backend");
             }
         }
     }
     // return default cache if cache cannot be initialized
     if (!self::$instance instanceof \Zend_Cache_Core) {
         self::$instance = self::getDefaultCache();
     }
     self::$instance->setLifetime(self::$defaultLifetime);
     self::$instance->setOption("automatic_serialization", true);
     self::$instance->setOption("automatic_cleaning_factor", 0);
     // init the write lock once (from other processes etc.)
     if (self::$writeLockTimestamp === null) {
         self::$writeLockTimestamp = 0;
         // set the write lock to 0, otherwise infinite loop (self::hasWriteLock() calls self::getInstance())
         self::hasWriteLock();
     }
     self::setZendFrameworkCaches(self::$instance);
 }
开发者ID:Gerhard13,项目名称:pimcore,代码行数:57,代码来源:Cache.php

示例10: setDataFromElement

 /**
  * @param  Element_Interface  $element
  * @return void
  */
 public function setDataFromElement($element)
 {
     $this->id = new SearchPhp_Backend_Data_Id($element);
     $this->fullPath = $element->getFullPath();
     $this->creationDate = $element->getCreationDate();
     $this->modificationDate = $element->getModificationDate();
     $this->userModification = $element->getUserModification();
     $this->userOwner = $element->getUserOwner();
     $this->type = $element->getType();
     if ($element instanceof Object_Abstract) {
         $this->subtype = $element->getClassName();
     } else {
         $this->subtype = $this->type;
     }
     $properties = $element->getProperties();
     if (is_array($properties)) {
         foreach ($properties as $nextProperty) {
             if ($nextProperty->getType() == 'text') {
                 $this->properties .= $nextProperty->getData() . " ";
             }
         }
     }
     if ($element instanceof Document) {
         if ($element instanceof Document_Folder) {
             $this->data = $element->getKey();
             $this->published = true;
         } else {
             if ($element instanceof Document_Link) {
                 $this->published = $element->isPublished();
                 $this->data = $element->getName() . " " . $element->getTitle() . " " . $element->getHref();
             } else {
                 if ($element instanceof Document_PageSnippet) {
                     $this->published = $element->isPublished();
                     $elements = $element->getElements();
                     if (is_array($elements)) {
                         foreach ($elements as $tag) {
                             if ($tag instanceof Document_Tag_Interface) {
                                 $this->data .= strip_tags($tag->frontend()) . " ";
                             }
                         }
                     }
                     if ($element instanceof Document_Page) {
                         $this->published = $element->isPublished();
                         $this->data .= " " . $element->getName() . " " . $element->getTitle() . " " . $element->getDescription() . " " . $element->getKeywords();
                     }
                 }
             }
         }
     } else {
         if ($element instanceof Asset) {
             $this->data = $element->getFilename();
             $this->published = true;
         } else {
             if ($element instanceof Object_Abstract) {
                 if ($element instanceof Object_Concrete) {
                     $this->published = $element->isPublished();
                     foreach ($element->getClass()->getFieldDefinitions() as $key => $value) {
                         $this->data .= $value->getForCsvExport($element) . " ";
                     }
                 } else {
                     if ($element instanceof Object_Folder) {
                         $this->data = $element->getKey();
                         $this->published = true;
                     }
                 }
             } else {
                 Logger::crit("SearchPhp_Backend_Data received an unknown element!");
             }
         }
     }
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:75,代码来源:Data.php

示例11: uninstall

 /**
  * @return string $statusMessage
  */
 public static function uninstall()
 {
     try {
         $install = new Install();
         self::getEventManager()->trigger('uninstall.pre', null, array("installer" => $install));
         // remove predefined document types
         //$install->removeDocTypes();
         // remove static routes
         $install->removeStaticRoutes();
         // remove custom view
         $install->removeCustomView();
         // remove object folder with all childs
         $install->removeFolders();
         // remove classes
         $install->removeClassmap();
         //$install->removeClass("CoreShopCartRule");
         $install->removeClass('CoreShopProduct');
         $install->removeClass('CoreShopCategory');
         $install->removeClass('CoreShopCart');
         $install->removeClass('CoreShopCartItem');
         $install->removeClass("CoreShopUser");
         $install->removeClass("CoreShopOrder");
         $install->removeClass("CoreShopOrderState");
         $install->removeClass("CoreShopPayment");
         $install->removeClass("CoreShopOrderItem");
         $install->removeFieldcollection('CoreShopUserAddress');
         $install->removeImageThumbnails();
         $install->removeConfig();
         self::getEventManager()->trigger('uninstall.post', null, array("installer" => $install));
         return self::getTranslate()->_('coreshop_uninstalled_successfully');
     } catch (Exception $e) {
         \Logger::crit($e);
         return self::getTranslate()->_('coreshop_uninstall_failed');
     }
 }
开发者ID:Cube-Solutions,项目名称:pimcore-coreshop,代码行数:38,代码来源:Plugin.php

示例12: clearDependentCache

 /**
  * @return void
  */
 public function clearDependentCache()
 {
     // this is mostly called in Redirect\Dao not here
     try {
         \Pimcore\Cache::clearTag("redirect");
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }
开发者ID:solverat,项目名称:pimcore,代码行数:12,代码来源:Redirect.php

示例13: clearDependentCache

 /**
  * @param array $additionalTags
  */
 public function clearDependentCache($additionalTags = [])
 {
     try {
         $tags = ["asset_" . $this->getId(), "asset_properties", "output"];
         $tags = array_merge($tags, $additionalTags);
         \Pimcore\Cache::clearTags($tags);
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }
开发者ID:solverat,项目名称:pimcore,代码行数:13,代码来源:Asset.php

示例14: getInstance

 /**
  * Returns a instance of the cache, if the instance isn't available it creates a new one
  *
  * @return Zend_Cache_Core|Zend_Cache_Frontend
  */
 public static function getInstance()
 {
     if (!empty($_REQUEST["nocache"])) {
         self::disable();
     }
     if (!self::$instance instanceof Zend_Cache_Core) {
         // default file based configuration
         $config = self::getDefaultConfig();
         // check for custom cache configuration
         $customCacheFile = PIMCORE_CONFIGURATION_DIRECTORY . "/cache.xml";
         if (is_file($customCacheFile)) {
             try {
                 $conf = new Zend_Config_Xml($customCacheFile);
                 if ($conf->frontend) {
                     $config["frontendType"] = (string) $conf->frontend->type;
                     $config["customFrontendNaming"] = (bool) $conf->frontend->custom;
                     if ($conf->frontend->options && method_exists($conf->backend->options, "toArray")) {
                         $config["frontendConfig"] = $conf->frontend->options->toArray();
                     }
                 }
                 if ($conf->backend) {
                     $config["backendType"] = (string) $conf->backend->type;
                     $config["customBackendNaming"] = (bool) $conf->backend->custom;
                     if ($conf->backend->options && method_exists($conf->backend->options, "toArray")) {
                         $config["backendConfig"] = $conf->backend->options->toArray();
                     }
                 }
             } catch (Exception $e) {
                 Logger::crit($e);
                 Logger::crit("Error while reading cache configuration, using the default file backend");
             }
         }
         self::$defaultLifetime = $config["frontendConfig"]["lifetime"];
         // here you can use the cache backend you like
         try {
             self::$instance = self::initializeCache($config);
         } catch (Exception $e) {
             Logger::crit("can't initialize cache with the given configuration " . $e->getMessage());
         }
     }
     // return default cache if cache cannot be initialized
     if (!self::$instance instanceof Zend_Cache_Core) {
         self::$instance = self::getDefaultCache();
     }
     // reset default lifetime
     self::$instance->setLifetime(self::$defaultLifetime);
     return self::$instance;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:53,代码来源:Cache.php

示例15: catch

            } catch (\Exception $e) {
                continue;
            }
            $contents = $config->toArray();
            if (!is_writable(dirname($phpFile))) {
                throw new \Exception($phpFile . " is not writable");
            }
            if ($fileName == "customviews") {
                $cvData = [];
                if (isset($contents["views"]["view"][0])) {
                    $cvData = $contents["views"]["view"];
                } else {
                    $cvData[] = $contents["views"]["view"];
                }
                $contents = ["views" => $cvData];
            }
            if (!$contents) {
                throw new \Exception("Something went wrong during the migration of " . $xmlFile . " to " . $phpFile . " - Please check the contents of the XML and try it again");
            }
            $contents = var_export_pretty($contents);
            $phpContents = "<?php \n\nreturn " . $contents . ";\n";
            \Pimcore\File::put($phpFile, $phpContents);
        } catch (\Exception $e) {
            \Logger::crit($e);
            echo "<b>Critical ERROR!</b><br />";
            echo $e->getMessage();
            echo "<br />Please try to fix it an run the update again.";
            exit;
        }
    }
}
开发者ID:SeerUK,项目名称:pimcore-manual-updater,代码行数:31,代码来源:preupdate.php


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