Ejemplo n.º 1
0
 public function __construct($viewFile = null)
 {
     if (null !== $viewFile) {
         $this->_module = 'www';
         if (strstr($viewFile, DS)) {
             $this->_viewFile = $viewFile;
         } else {
             $file = CACHE_PATH . DS . md5($this->_viewFile . time() . Utils::UUID()) . '.fake';
             File::create($file);
             $fp = fopen($file, 'a');
             fwrite($fp, '<?php echo $this->content; ?>');
             $this->_viewFile = $file;
         }
     } else {
         $route = Utils::get('appDispatch');
         /* polymorphism */
         $route = !$route instanceof Container ? container()->getRoute() : $route;
         if ($route instanceof Container) {
             $module = $route->getModule();
             $controller = $route->getController();
             $action = $route->getAction();
             $this->_module = $module;
             $isTranslate = Utils::get('isTranslate');
             if (true === $isTranslate) {
                 $lng = getLanguage();
                 if (true === container()->getMultiSite()) {
                     $this->_viewFile = APPLICATION_PATH . DS . SITE_NAME . DS . 'modules' . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($lng) . DS . Inflector::lower($action) . '.phtml';
                 } else {
                     $this->_viewFile = APPLICATION_PATH . DS . 'modules' . DS . SITE_NAME . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($lng) . DS . Inflector::lower($action) . '.phtml';
                 }
             } else {
                 if (true === container()->getMultiSite()) {
                     $this->_viewFile = APPLICATION_PATH . DS . SITE_NAME . DS . 'modules' . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($action) . '.phtml';
                 } else {
                     $this->_viewFile = APPLICATION_PATH . DS . 'modules' . DS . SITE_NAME . DS . $module . DS . 'views' . DS . 'scripts' . DS . Inflector::lower($controller) . DS . Inflector::lower($action) . '.phtml';
                 }
             }
         }
     }
     Utils::set('appView', $this);
     Utils::set('showStats', true);
 }
Ejemplo n.º 2
0
 private function nextId()
 {
     return sha1(Utils::UUID() . Utils::token() . time());
 }
Ejemplo n.º 3
0
 public function offsetExists($key)
 {
     $method = lcfirst(Inflector::camelize('isset_' . $key . '_attribute'));
     $methods = get_class_methods($this);
     if (in_array($method, $methods)) {
         return $this->{$method}();
     }
     $check = Utils::UUID();
     return $check != isAke($this->_data, $key, $check);
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     $this->html = lib('tpl');
     $this->csrfToken = sha1(Utils::UUID());
 }
Ejemplo n.º 5
0
 public function uuid()
 {
     return Utils::UUID();
 }
Ejemplo n.º 6
0
 public function has($k)
 {
     $check = Utils::UUID();
     return $check != isAke($this->data[$this->ns], $k, $check);
 }
Ejemplo n.º 7
0
 public function has($k)
 {
     $tab = $this->unserialize(File::read($this->file));
     $check = Utils::UUID();
     return $check != isAke($tab, $k, $check);
 }
Ejemplo n.º 8
0
 public function has($key)
 {
     $this->clean();
     $token = Utils::UUID();
     return $this->motor()->read('values.' . $key, $token) != $token;
 }