Beispiel #1
0
 /**
  * @return string
  */
 private function buildBaseUrl()
 {
     /** @var $config \Shopware_Components_Config */
     $config = $this->container->get('config');
     $request = null;
     if ($this->container->initialized('front')) {
         /** @var $front \Enlight_Controller_Front */
         $front = $this->container->get('front');
         $request = $front->Request();
     }
     if ($request !== null) {
         $baseUrl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
     } else {
         $baseUrl = 'http://' . $config->get('basePath');
     }
     return $baseUrl;
 }
Beispiel #2
0
 /**
  * Checks if the given resource name is already registered.
  * Unlike as the hasResource method is, if the resource does not exist the resource will not even loaded.
  *
  * @param string $name
  * @return bool
  */
 public function issetResource($name)
 {
     return $this->container->initialized($name);
 }
Beispiel #3
-1
 /**
  * @param Container $container
  * @return \Shopware_Components_TemplateMail
  */
 public function factory(Container $container)
 {
     $container->load('MailTransport');
     $stringCompiler = new \Shopware_Components_StringCompiler($container->get('Template'));
     $mailer = new \Shopware_Components_TemplateMail();
     if ($container->initialized('Shop')) {
         $mailer->setShop($container->get('Shop'));
     }
     $mailer->setModelManager($container->get('Models'));
     $mailer->setStringCompiler($stringCompiler);
     return $mailer;
 }