Exemplo n.º 1
0
 public function onCreate()
 {
     Wekit::createapp(Wind::getAppName());
     $_debug = Wekit::C('site', 'debug');
     if ($_debug == !Wind::$isDebug) {
         Wind::$isDebug = $_debug;
     }
     error_reporting($_debug ? E_ALL ^ E_NOTICE ^ E_DEPRECATED : E_ERROR | E_PARSE);
     set_error_handler(array($this->front, '_errorHandle'), error_reporting());
     $this->_convertCharsetForAjax();
     if ($components = Wekit::C('components')) {
         Wind::getApp()->getFactory()->loadClassDefinitions($components);
     }
 }
Exemplo n.º 2
0
 public function onCreate()
 {
     if (in_array(Wind::getAppName(), array('phpwind', 'pwadmin'))) {
         //云应用监听sql执行
         WindFactory::_getInstance()->loadClassDefinitions(array('sqlStatement' => array('proxy' => 'WIND:filter.proxy.WindEnhancedClassProxy', 'listeners' => array('LIB:compile.acloud.PwAcloudDbListener'))));
     }
     if (!is_file(Wind::getRealPath('DATA:install.lock', true))) {
         Wind::getApp()->getResponse()->sendRedirect("install.php");
     }
     Wekit::createapp(Wind::getAppName());
     $_debug = Wekit::C('site', 'debug');
     if ($_debug == !Wind::$isDebug) {
         Wind::$isDebug = $_debug;
     }
     if ('phpwind' == Wind::getAppName()) {
         error_reporting($_debug ? E_ALL ^ E_NOTICE ^ E_DEPRECATED : E_ERROR | E_PARSE);
         set_error_handler(array($this->front, '_errorHandle'), error_reporting());
     }
     $this->_convertCharsetForAjax();
     if ($components = Wekit::C('components')) {
         Wind::getApp()->getFactory()->loadClassDefinitions($components);
     }
 }
Exemplo n.º 3
0
 /**
  * 解析资源文件路径信息
  * 
  * @param string $package
  * @return string
  */
 protected function resolvedPath($package)
 {
     $this->path || ($this->path = Wind::getRootPath(Wind::getAppName()));
     $this->language || ($this->language = $this->getRequest()->getAcceptLanguage());
     $path = $this->path . '/' . $this->language . '/' . strtolower($package);
     $path = Wind::getRealDir(trim($path, '/'), true);
     return $path;
 }
Exemplo n.º 4
0
 /**
  * token名称处理
  * 
  * @param string $tokenName
  * @return string
  */
 protected function getTokenName($tokenName)
 {
     $tokenName || ($tokenName = Wind::getAppName());
     return substr(md5('_token' . $tokenName . '_csrf'), -16);
 }