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


PHP Swift_DependencyContainer类代码示例

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


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

示例1: email

 /**
  * Checks if an email matches the current grammars
  * @param string $email
  */
 public static function email($email)
 {
     if (self::$grammar === null) {
         self::$grammar = Swift_DependencyContainer::getInstance()->lookup('mime.grammar');
     }
     return preg_match('/^' . self::$grammar->getDefinition('addr-spec') . '$/D', $email);
 }
开发者ID:codigoirreverente,项目名称:LampCMS,代码行数:11,代码来源:Validate.php

示例2: getInstance

 /**
  * Returns a singleton of the DependencyContainer.
  *
  * @return Swift_DependencyContainer
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
开发者ID:laiello,项目名称:yii-mail-fix,代码行数:12,代码来源:DependencyContainer.php

示例3: __construct

 /**
  * Create a new SmtpTransport, optionally with $host, $port and $security.
  *
  * @param string  $host
  * @param integer $port
  * @param string  $security
  */
 public function __construct($host = 'localhost', $port = 25, $security = null)
 {
     call_user_func_array(array($this, 'Swift_Transport_EsmtpTransport::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('transport.smtp'));
     $this->setHost($host);
     $this->setPort($port);
     $this->setEncryption($security);
 }
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:14,代码来源:SmtpTransport.php

示例4: __construct

 /**
  * Create a new NullTransport.
  */
 public function __construct()
 {
   call_user_func_array(
     array($this, 'Swift_Transport_NullTransport::__construct'),
     Swift_DependencyContainer::getInstance()
       ->createDependenciesFor('transport.null')
   );
 }
开发者ID:nationalfield,项目名称:symfony,代码行数:11,代码来源:NullTransport.php

示例5: __construct

 /**
  * Create a new AWSTransport.
  * @param string $AWSAccessKeyId Your access key.
  * @param string $AWSSecretKey Your secret key.
  * @param boolean $debug Set to true to enable debug messages in error log.
  * @param string $endpoint The AWS endpoint to use.
  */
 public function __construct($AWSAccessKeyId = null, $AWSSecretKey = null, $debug = false, $endpoint = 'https://email.us-east-1.amazonaws.com/')
 {
     call_user_func_array(array($this, 'Swift_Transport_AWSTransport::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('transport.aws'));
     $this->AWSAccessKeyId = $AWSAccessKeyId;
     $this->AWSSecretKey = $AWSSecretKey;
     $this->endpoint = $endpoint;
     $this->debug = $debug;
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:15,代码来源:AWSTransport.php

示例6: __construct

 /**
  * Create a new EmbeddedFile.
  * Details may be optionally provided to the constructor.
  * @param string|Swift_OutputByteStream $data
  * @param string                        $filename
  * @param string                        $contentType
  */
 public function __construct($data = NULL, $filename = NULL, $contentType = NULL)
 {
     call_user_func_array(array($this, 'Swift_Mime_EmbeddedFile::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.embeddedfile'));
     $this->setBody($data);
     $this->setFilename($filename);
     if ($contentType) {
         $this->setContentType($contentType);
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:EmbeddedFile.php

示例7: __construct

 /**
  * Create a new Attachment.
  *
  * Details may be optionally provided to the constructor.
  *
  * @param string|Swift_OutputByteStream $data
  * @param string                        $filename
  * @param string                        $contentType
  */
 public function __construct($data = null, $filename = null, $contentType = null)
 {
     call_user_func_array(array($this, 'Swift_Mime_Attachment::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.attachment'));
     $this->setBody($data);
     $this->setFilename($filename);
     if ($contentType) {
         $this->setContentType($contentType);
     }
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:18,代码来源:Attachment.php

示例8: __construct

  /**
   * Create a new SendmailTransport, optionally using $command for sending.
   * @param string $command
   */
  public function __construct($command = '/usr/sbin/sendmail -bs')
  {
    call_user_func_array(
      array($this, 'Swift_Transport_SendmailTransport::__construct'),
      Swift_DependencyContainer::getInstance()
        ->createDependenciesFor('transport.sendmail')
      );

    $this->setCommand($command);
  }
开发者ID:nationalfield,项目名称:symfony,代码行数:14,代码来源:SendmailTransport.php

示例9: __construct

  /**
   * Creates a new FailoverTransport with $transports.
   * @param array $transports
   */
  public function __construct($transports = array())
  {
    call_user_func_array(
      array($this, 'Swift_Transport_FailoverTransport::__construct'),
      Swift_DependencyContainer::getInstance()
        ->createDependenciesFor('transport.failover')
      );

    $this->setTransports($transports);
  }
开发者ID:nationalfield,项目名称:symfony,代码行数:14,代码来源:FailoverTransport.php

示例10: __construct

  /**
   * Create a new MailTransport, optionally specifying $extraParams.
   * @param string $extraParams
   */
  public function __construct($extraParams = '-f%s')
  {
    call_user_func_array(
      array($this, 'Swift_Transport_MailTransport::__construct'),
      Swift_DependencyContainer::getInstance()
        ->createDependenciesFor('transport.mail')
      );

    $this->setExtraParams($extraParams);
  }
开发者ID:nationalfield,项目名称:symfony,代码行数:14,代码来源:MailTransport.php

示例11: testNoLookupsFail

 public function testNoLookupsFail()
 {
     $di = Swift_DependencyContainer::getInstance();
     foreach ($di->listItems() as $itemName) {
         try {
             $di->lookup($itemName);
         } catch (Swift_DependencyException $e) {
             $this->fail($e->getMessage());
         }
     }
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:11,代码来源:DependencyContainerAcceptanceTest.php

示例12: __construct

  /**
   * Create a new SpoolTransport.
   * @param Swift_Spool $spool
   */
  public function __construct(Swift_Spool $spool)
  {
    $arguments = Swift_DependencyContainer::getInstance()
      ->createDependenciesFor('transport.spool');

    $arguments[] = $spool;

    call_user_func_array(
      array($this, 'Swift_Transport_SpoolTransport::__construct'),
      $arguments
    );
  }
开发者ID:nationalfield,项目名称:symfony,代码行数:16,代码来源:SpoolTransport.php

示例13: __construct

 /**
  * Create a new MimePart.
  *
  * Details may be optionally passed into the constructor.
  *
  * @param string $body        	
  * @param string $contentType        	
  * @param string $charset        	
  */
 public function __construct($body = null, $contentType = null, $charset = null)
 {
     call_user_func_array(array($this, 'Swift_Mime_MimePart::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.part'));
     if (!isset($charset)) {
         $charset = Swift_DependencyContainer::getInstance()->lookup('properties.charset');
     }
     $this->setBody($body);
     $this->setCharset($charset);
     if ($contentType) {
         $this->setContentType($contentType);
     }
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:21,代码来源:MimePart.php

示例14: __construct

 /**
  * Create a new Message.
  * Details may be optionally passed into the constructor.
  * @param string $subject
  * @param string $body
  * @param string $contentType
  * @param string $charset
  */
 public function __construct($subject = NULL, $body = NULL, $contentType = NULL, $charset = NULL)
 {
     call_user_func_array(array($this, 'Swift_Mime_SimpleMessage::__construct'), Swift_DependencyContainer::getInstance()->createDependenciesFor('mime.message'));
     if (!isset($charset)) {
         $charset = Swift_DependencyContainer::getInstance()->lookup('properties.charset');
     }
     $this->setSubject($subject);
     $this->setBody($body);
     $this->setCharset($charset);
     if ($contentType) {
         $this->setContentType($contentType);
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:21,代码来源:Message.php

示例15: __construct

 /**
  * Swift初期化
  *
  * @param String $host
  * @param String $port
  * @param String $user
  * @param String $pass
  * @param String $charset
  * @return vold
  * @codeCoverageIgnore
  */
 public function __construct($host, $port, $user, $pass, $charset = 'iso-2022-jp')
 {
     $this->host = $host;
     $this->port = $port;
     $this->user = $user;
     $this->pass = $pass;
     $this->charset = $charset;
     $this->setPath();
     \Swift::init(function () use($charset) {
         \Swift_DependencyContainer::getInstance()->register('mime.qpheaderencoder')->asAliasOf('mime.base64headerencoder');
         \Swift_Preferences::getInstance()->setCharset($charset);
     });
 }
开发者ID:kobabasu,项目名称:yumenokousakusitsu-api,代码行数:24,代码来源:Init.php


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