/**
  * Tests WindModule->toArray()
  */
 public function testToArray()
 {
     $this->WindModule->setConfig(array('destroy' => 'commit'));
     $this->WindModule->setConfig(array('aaa' => 'aaa'));
     $arr = $this->WindModule->toArray();
     $this->assertEquals($arr['_config'], array('destroy' => 'commit', 'aaa' => 'aaa'));
 }
 /**
  * 配置设置
  *
  * @param array|string $config
  * @see WindModule::setConfig()
  * @return void
  */
 public function setConfig($config)
 {
     parent::setConfig($config);
     $this->prefix = $this->getConfig('prefix');
     $this->encode = $this->getConfig('encode');
     $this->domain = $this->getConfig('domain');
     $this->path = $this->getConfig('path');
     $this->secure = $this->getConfig('secure');
     $this->httponly = $this->getConfig('httponly');
 }
Esempio n. 3
0
 public function setConfig($config)
 {
     parent::setConfig($config);
     if ($this->_config) {
         $this->templateDir = $this->getConfig('template-dir', '', $this->templateDir);
         $this->templateExt = $this->getConfig('template-ext', '', $this->templateExt);
         $this->compileDir = $this->getConfig('compile-dir', '', $this->compileDir);
         $this->compileExt = $this->getConfig('compile-ext', '', $this->compileExt);
         $this->isCompile = $this->getConfig('is-compile', '', $this->isCompile);
         $this->layout = $this->getConfig('layout', '', $this->layout);
         $this->htmlspecialchars = $this->getConfig('htmlspecialchars', '', $this->htmlspecialchars);
         $this->setThemePackage($this->getConfig('theme-package'));
     }
 }
Esempio n. 4
0
 public function setConfig($config)
 {
     parent::setConfig($config);
     $this->suffix = $this->getConfig('suffix', '', '');
     $this->default = $this->getConfig('default', '', 'message');
     $this->path = $this->getConfig('path', '', '');
     $this->language = $this->getConfig('language', '', 'zh_cn');
 }
 /**
  * 设置配置信息
  * 
  * 支持三个配置项: 
  * <ul>
  * <li><i>security-code</i>: 安全码配置</li>
  * <li><i>key-prefix</i>: key前缀设置</li>
  * <li><i>expires</i>: 缓存过期时间配置,单位为秒,默认为0</li>
  * </ul>
  * 
  * @param array $config 缓存配置信息
  */
 public function setConfig($config)
 {
     parent::setConfig($config);
     $this->setSecurityCode($this->getConfig('security-code', '', ''));
     $this->setKeyPrefix($this->getConfig('key-prefix', '', ''));
     $this->setExpire($this->getConfig('expires', '', 0));
 }
Esempio n. 6
0
 /**
  * 初始化系统配置
  *
  * @param array $config
  */
 private function _init($config)
 {
     parent::setConfig($config);
     $this->sender = $this->getConfig('sender', '', '');
     $this->sendMail = $this->getConfig('sendMail', '', '/usr/sbin/sendmail');
 }
Esempio n. 7
0
 /**
  * @param array() $config
  */
 private function _init($config)
 {
     parent::setConfig($config);
     $this->host = $this->getConfig('host', '', '127.0.0.1');
     $this->port = $this->getConfig('port', '', '25');
     $this->name = $this->getConfig('name', '', 'localhost');
     $this->auth = $this->getConfig('auth', '', true);
     $this->username = $this->getConfig('user');
     $this->password = $this->getConfig('password');
     $this->timeout = $this->getConfig('timeout', '', 60);
 }
 public function setConfig($config)
 {
     parent::setConfig($config);
     if ($default = $this->getModules('default')) {
         $this->defaultModule = WindUtility::mergeArray($this->defaultModule, $default);
     }
 }
 /**
  * (non-PHPdoc)
  * @see WindModule::setConfig()
  */
 public function setConfig($config)
 {
     parent::setConfig($config);
     $this->_initConfig();
     $this->_attributes = array();
 }
 public function setConfig($config)
 {
     parent::setConfig($config);
     if ($default = $this->getConfig('modules', 'default', array())) {
         $this->defaultModule = WindUtility::mergeArray($this->defaultModule, $default);
     }
     $charset = $this->getConfig('charset', '', 'utf-8');
     $this->getResponse()->setHeader('Content-type', 'text/html;charset=' . $charset);
     $this->getResponse()->setCharset($charset);
 }