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); }
private function nextId() { return sha1(Utils::UUID() . Utils::token() . time()); }
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); }
public function __construct() { $this->html = lib('tpl'); $this->csrfToken = sha1(Utils::UUID()); }
public function uuid() { return Utils::UUID(); }
public function has($k) { $check = Utils::UUID(); return $check != isAke($this->data[$this->ns], $k, $check); }
public function has($k) { $tab = $this->unserialize(File::read($this->file)); $check = Utils::UUID(); return $check != isAke($tab, $k, $check); }
public function has($key) { $this->clean(); $token = Utils::UUID(); return $this->motor()->read('values.' . $key, $token) != $token; }