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


PHP ClassLoader::ignoreMissingClasses方法代码示例

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


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

示例1: ignoreMissingClasses

 public static function ignoreMissingClasses($ignore = true)
 {
     self::$ignoreMissingClasses = $ignore;
 }
开发者ID:saiber,项目名称:www,代码行数:4,代码来源:ClassLoader.php

示例2: send

 public function send()
 {
     ClassLoader::ignoreMissingClasses();
     $this->application->processInstancePlugins('email-prepare-send', $this);
     $this->application->processInstancePlugins('email-prepare-send/' . $this->relativeTemplatePath, $this);
     if ($this->template) {
         $originalLocale = $this->application->getLocale();
         $emailLocale = Locale::getInstance($this->getLocale());
         $this->application->setLocale($emailLocale);
         $this->application->getLocale()->translationManager()->loadFile('User');
         $this->application->loadLanguageFiles();
         $smarty = $this->application->getRenderer()->getSmartyInstance();
         foreach ($this->values as $key => $value) {
             $smarty->assign($key, $value);
         }
         $router = $this->application->getRouter();
         $smarty->assign('html', false);
         $smarty->disableTemplateLocator();
         $text = $smarty->fetch($this->template);
         $smarty->enableTemplateLocator();
         $parts = explode("\n", $text, 2);
         $this->subject = array_shift($parts);
         $this->setText(array_shift($parts));
         // fix URLs
         $this->text = str_replace('&', '&', $this->text);
         if ($this->application->getConfig()->get('HTML_EMAIL')) {
             $smarty->assign('html', true);
             $html = array_pop(explode("\n", $smarty->fetch($this->template), 2));
             $css = new EditedCssFile('email');
             $smarty->assign('cssStyle', str_replace("\n", ' ', $css->getCode()));
             $smarty->assign('messageHtml', $html);
             $html = $smarty->fetch($this->getTemplatePath('htmlWrapper'));
             $this->setHtml($html);
         }
         $this->application->setLocale($originalLocale);
     }
     $this->application->processInstancePlugins('email-before-send', $this);
     $this->application->processInstancePlugins('email-before-send/' . $this->relativeTemplatePath, $this);
     $this->message->setSubject($this->subject);
     if ($this->html) {
         preg_match_all('/\\#\\#([_\\-\\.a-zA-Z0-9\\/]+)\\#\\#/msU', $this->html, $matches);
         $html = $this->html;
         if (!empty($matches[1])) {
             foreach ($matches[1] as $match) {
                 $html = str_replace('##' . $match . '##', $this->message->embed(Swift_Image::fromPath(ClassLoader::getRealPath('public.') . $match)), $html);
             }
         }
         preg_match_all('/src\\=\\"([\\:_\\-\\.a-zA-Z0-9\\/]+)\\"/msU', $this->html, $matches);
         if (!empty($matches[1])) {
             foreach ($matches[1] as $match) {
                 if (substr($match, 0, 4) == 'http') {
                     if (substr($match, 0, strlen($this->url)) == $this->url) {
                         $match = substr($match, strlen($this->url));
                     }
                 }
                 if (!substr($match, 0, 4) == 'http') {
                     $match = $this->message->embed(Swift_Image::fromPath(ClassLoader::getRealPath('public.') . $match));
                 }
                 $html = str_replace('src="' . $match . '"', 'src="' . $match . '"', $html);
             }
             $html = str_replace('src="upload', 'src="' . $this->url . '/upload', $html);
         }
         $this->message->setBody($html, 'text/html');
     }
     if ($this->text) {
         if (!$this->html) {
             $this->message->setBody($this->text, 'text/plain');
         } else {
             $this->message->addPart($this->text, 'text/plain');
         }
     }
     if (!$this->text && !$this->html) {
         return false;
     }
     try {
         $res = $this->swiftInstance->send($this->message);
         ClassLoader::ignoreMissingClasses(false);
     } catch (Exception $e) {
         $this->application->processInstancePlugins('email-fail-send/' . $this->relativeTemplatePath, $this, array('exception' => $e));
         $this->application->processInstancePlugins('email-fail-send', $this, array('exception' => $e));
         ClassLoader::ignoreMissingClasses(false);
         return false;
     }
     $this->application->processInstancePlugins('email-after-send/' . $this->relativeTemplatePath, $this);
     $this->application->processInstancePlugins('email-after-send', $this);
     return $res;
 }
开发者ID:saiber,项目名称:www,代码行数:87,代码来源:Email.php

示例3: loadSession

 private function loadSession()
 {
     ClassLoader::import("framework.request.Session");
     // avoid unserialize failures (3rd party application instances, etc.)
     ClassLoader::ignoreMissingClasses(true);
     $this->session = new Session();
     ClassLoader::ignoreMissingClasses(false);
     return $this->session;
 }
开发者ID:GregerA,项目名称:livecart,代码行数:9,代码来源:LiveCart.php

示例4: send

 public function send()
 {
     ClassLoader::ignoreMissingClasses();
     $this->application->processInstancePlugins('email-prepare-send', $this);
     $this->application->processInstancePlugins('email-prepare-send/' . $this->relativeTemplatePath, $this);
     if ($this->template) {
         $originalLocale = $this->application->getLocale();
         $emailLocale = Locale::getInstance($this->getLocale());
         $this->application->setLocale($emailLocale);
         $this->application->getLocale()->translationManager()->loadFile('User');
         $this->application->loadLanguageFiles();
         $smarty = $this->application->getRenderer()->getSmartyInstance();
         foreach ($this->values as $key => $value) {
             $smarty->assign($key, $value);
         }
         $router = $this->application->getRouter();
         $smarty->assign('html', false);
         $smarty->disableTemplateLocator();
         $text = $smarty->fetch($this->template);
         $smarty->enableTemplateLocator();
         $parts = explode("\n", $text, 2);
         $this->subject = array_shift($parts);
         $this->setText(array_shift($parts));
         // fix URLs
         $this->text = str_replace('&', '&', $this->text);
         if ($this->application->getConfig()->get('HTML_EMAIL')) {
             $smarty->assign('html', true);
             $html = array_pop(explode("\n", $smarty->fetch($this->template), 2));
             $css = new EditedCssFile('email');
             $smarty->assign('cssStyle', str_replace("\n", ' ', $css->getCode()));
             $smarty->assign('messageHtml', $html);
             $html = $smarty->fetch($this->getTemplatePath('htmlWrapper'));
             $this->setHtml($html);
         }
         $this->application->setLocale($originalLocale);
     }
     $this->application->processInstancePlugins('email-before-send', $this);
     $this->application->processInstancePlugins('email-before-send/' . $this->relativeTemplatePath, $this);
     $this->message->setSubject($this->subject);
     if ($this->html) {
         $this->message->setBody($this->html, 'text/html');
     }
     if ($this->text) {
         if (!$this->html) {
             $this->message->setBody($this->text, 'text/plain');
         } else {
             $this->message->addPart($this->text, 'text/plain');
         }
     }
     if (!$this->text && !$this->html) {
         return false;
     }
     try {
         $res = $this->swiftInstance->send($this->message);
         ClassLoader::ignoreMissingClasses(false);
     } catch (Exception $e) {
         $this->application->processInstancePlugins('email-fail-send/' . $this->relativeTemplatePath, $this, array('exception' => $e));
         $this->application->processInstancePlugins('email-fail-send', $this, array('exception' => $e));
         ClassLoader::ignoreMissingClasses(false);
         return false;
     }
     $this->application->processInstancePlugins('email-after-send/' . $this->relativeTemplatePath, $this);
     $this->application->processInstancePlugins('email-after-send', $this);
     return $res;
 }
开发者ID:saiber,项目名称:livecart,代码行数:65,代码来源:Email.php


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