コード例 #1
0
ファイル: HTMLElement.php プロジェクト: smnDev/pheeca
 public function __construct($tagname, $nodeValue = '', $attributes = array(), $childNodes = array())
 {
     $this->setName($tagname);
     $this->setValue($nodeValue);
     foreach ($attributes as $attrName => $attrValue) {
         $this->addAttribute($attrName, $attrValue);
     }
     foreach ($childNodes as $childName => $childElement) {
         $this->addChild($childName, $childElement);
     }
     Events::trigger(self::ELEMENT_HTML_INSTANCE, array($this));
 }
コード例 #2
0
ファイル: Session.php プロジェクト: smnDev/pheeca
 public function __construct($handler = null, $dataManipulation = null, $options = array())
 {
     $this->_options = $options;
     $this->setHandlerClass($handler);
     $this->setDataManipulationClass($dataManipulation);
     session_set_save_handler(array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc'));
     if (array_key_exists('session_expire', $options)) {
         session_set_cookie_params($options['session_expire']);
     }
     if (array_key_exists('session_gc_lifetime', $options)) {
         ini_set('session.gc_maxlifetime', $options['session_gc_lifetime']);
     }
     if (array_key_exists('session_gc_probability', $options)) {
         ini_set('session.gc_probability', $options['session_gc_probability']);
     }
     if (array_key_exists('session_gc_divisor', $options)) {
         ini_set('session.gc_divisor', $options['session_gc_divisor']);
     }
     register_shutdown_function('session_write_close');
     session_start();
     Events::trigger(self::SESSION_START);
 }