Exemplo n.º 1
0
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     if (isset($config->adapters)) {
         $this->_adapters = $config->adapters;
     }
 }
Exemplo n.º 2
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (!empty($config->auto_load)) {
         $this->load();
     }
 }
Exemplo n.º 3
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (!empty($config->comma_separated)) {
         $this->_comma_separated = $config->comma_separated;
     }
 }
Exemplo n.º 4
0
 public function __construct(KConfig $config = null)
 {
     parent::__construct($config);
     $this->_message = Swift_Message::newInstance();
     switch ($config->method) {
         case 'sendmail':
             // WIP required -bs or -t switch
             $transport = Swift_SendmailTransport::newInstance($config->sendmail);
             break;
         case 'smtp':
             if ($config->smtpauth == 1) {
                 if ($config->smtpsecure != "none") {
                     $transport = Swift_SmtpTransport::newInstance($config->smtphost, $config->smtpport, $config->smtpsecure)->setUsername($config->smtpuser)->setPassword($config->smtppass);
                 } else {
                     $transport = Swift_SmtpTransport::newInstance($config->smtphost, $config->smtpport)->setUsername($config->smtpuser)->setPassword($config->smtppass);
                 }
             } else {
                 if ($config->smtpsecure != "none") {
                     $transport = Swift_SmtpTransport::newInstance($config->smtphost, $config->smtpport, $config->smtpsecure);
                 } else {
                     $transport = Swift_SmtpTransport::newInstance($config->smtphost, $config->smtpport);
                 }
             }
             break;
         case 'spool':
             // TODO: Make spool options configurable.
             $transport = Swift_SpoolTransport::newInstance(new Swift_FileSpool('/var/spool/swift'));
             break;
         case 'mail':
         default:
             $transport = Swift_MailTransport::newInstance();
             break;
     }
     $this->_mailer = Swift_Mailer::newInstance($transport);
 }
Exemplo n.º 5
0
 /**
  * Constructor
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
      parent::__construct($config);
      
      $this->_name = $config->name;
      $this->_path = $config->path;
 }
Exemplo n.º 6
0
 /**
  * Object constructor 
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
     parent::__construct($config);
     // Set the table indentifier
     if (isset($config->table)) {
         $this->setTable($config->table);
     }
 }
Exemplo n.º 7
0
 /**
  * Object constructor
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
     parent::__construct($config);
     $this->_table = $config->table;
     // Reset the row
     $this->reset();
     // Reset the row data
     if (isset($config->data)) {
         $this->setData($config->data->toArray(), $this->_new);
     }
 }
Exemplo n.º 8
0
 /**
  * Object constructor
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
     parent::__construct($config);
     $this->_document = $config->document;
     // Reset the row
     $this->reset();
     // Reset the row data
     if (isset($config->data)) {
         $this->setData(KConfig::unbox($config->data), $this->_new);
     }
 }
Exemplo n.º 9
0
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->mixin(new KMixinCommandchain($config->append(array('mixer' => $this))));
     if ($config->validator !== false) {
         if ($config->validator === true) {
             $config->validator = 'com://admin/files.command.validator.' . $this->getIdentifier()->name;
         }
         $this->getCommandChain()->enqueue($this->getService($config->validator));
     }
 }
Exemplo n.º 10
0
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->mixin(new KMixinCommandchain($config->append(array('mixer' => $this))));
     if ($config->validator !== false) {
         if ($config->validator === true) {
             $config->validator = 'com://admin/files.command.validator.' . $this->getIdentifier()->name;
         }
         $this->getCommandChain()->enqueue($this->getService($config->validator));
     }
     $this->registerCallback(array('after.save', 'after.delete'), array($this, 'setPath'));
     $this->registerCallback(array('after.save'), array($this, 'saveThumbnail'));
     $this->registerCallback(array('after.delete'), array($this, 'deleteThumbnail'));
 }