Esempio n. 1
0
 /**
  * 获取伪静态设置的扩展
  *
  * @return mixed
  */
 public function getRewriteAddOns()
 {
     $r = @(include Wind::getRealPath("APPS:rewrite.conf.rewrite.php", true));
     $r || ($r = array());
     $r = PwSimpleHook::getInstance('rewrite_config')->runWithFilters($r);
     return $r;
 }
Esempio n. 2
0
 public static function getAppOutPut($collect)
 {
     $data = array();
     $sign = ACloudSysCoreCommon::getSiteSign();
     $data['src'] = $collect->getSrc();
     $data['url'] = ACloudSysCoreCommon::getGlobal('g_siteurl', $_SERVER['SERVER_NAME']);
     $data['sn'] = ACloudSysCoreCommon::getSiteUnique();
     $data['fid'] = $collect->getFid();
     $data['uid'] = $collect->getUid();
     $data['tid'] = $collect->getTid();
     $data[$sign] = ACloudVerCoreApp::getSyncData($sign);
     $data['charset'] = ACloudSysCoreCommon::getGlobal('g_charset', 'gbk');
     $data['username'] = $collect->getUsername();
     $data['title'] = $collect->getTitle();
     $data['_ua'] = ACloudSysCoreCommon::getSiteUserAgent();
     $data['_shr'] = base64_encode(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
     $data['_sqs'] = base64_encode(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
     $data['_ssn'] = base64_encode(isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '');
     $data['_t'] = ACloudSysCoreCommon::getGlobal('timestamp') + 86400;
     $data['_v'] = rand(1000, 9999);
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     $url = sprintf("http://%s/?%s", ACloudSysCoreDefine::ACLOUD_HOST_APP, ACloudSysCoreHttp::httpBuildQuery($data));
     $output = "<script type=\"text/javascript\">(function(d,t){var url=\"{$url}\";var g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>";
     return $output;
 }
Esempio n. 3
0
 public function __construct()
 {
     $this->logfile = Wind::getRealPath(Wekit::app()->logFile, true);
     if (!WindFile::isFile($this->logfile)) {
         WindFile::write($this->logfile, "<?php die;?>\n");
     }
 }
Esempio n. 4
0
 /**
  * 返回验证码类型
  *
  * @return array
  */
 public function getVerifyType()
 {
     $conf = Wind::getRealPath('WINDID:service.verify.codetype.verify.php', true);
     $tmp = array('name' => '', 'alias' => '', 'description' => '', 'components' => array());
     $verify = @(include $conf);
     return $verify;
 }
Esempio n. 5
0
 /**
  * 获得扩展列表
  * 
  * @param string $type
  * @return array
  */
 private function getExtendsList($type)
 {
     if ($this->config === null) {
         $this->config = (include Wind::getRealPath('APPS:task.conf.taskExtends.php', true));
     }
     return isset($this->config[$type]) ? $this->config[$type] : array();
 }
Esempio n. 6
0
 /**
  * 初始化安装程序
  */
 public function __construct()
 {
     $this->_appId = 'L000' . time() . WindUtility::generateRandStr(4);
     $this->_config = @(include Wind::getRealPath(self::CONF_PATH, true));
     $this->tmpPath = Wind::getRealPath($this->getConfig('tmp_dir') . '.' . Pw::getTime(), false);
     $this->tmpInstallLog = Wind::getRealPath($this->getConfig('log_dir'), false);
 }
Esempio n. 7
0
 public static function sendPost($data)
 {
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttpclient");
     $data = self::httpBuildQuery($data);
     $result = ACloudSysCoreHttpclient::post(self::getCloudApi(), $data);
     return ACloudSysCoreCommon::jsonDecode($result);
 }
Esempio n. 8
0
 protected function showErrorMessage($message, $file, $line, $trace, $errorcode)
 {
     list($fileLines, $trace) = $this->crash($file, $line, $trace);
     if (Wind::$isDebug & 2) {
         $log = $message . "\r\n" . $file . ":" . $line . "\r\n";
         foreach ($trace as $key => $value) {
             $log .= $value . "\r\n";
         }
         Wind::getComponent('windLogger')->error($log, 'error', true);
     }
     $message = nl2br($message);
     $errDir = Wind::getRealPath($this->errorDir, false);
     if ($this->isClosed) {
         $errPage = 'close';
     } elseif (is_file($errDir . '/' . $errorcode . '.htm')) {
         $errPage = $errorcode;
     } else {
         $errPage = 'error';
     }
     $title = $this->getResponse()->codeMap($errorcode);
     $title = $title ? $errorcode . ' ' . $title : 'unknowen error';
     $__vars['title'] = ucwords($title);
     $__vars['message'] = $message;
     if (Wind::$isDebug & 1) {
         $__vars['debug']['file'] = $file;
         $__vars['debug']['line'] = $line;
         $__vars['debug']['trace'] = $trace;
         $__vars['debug']['fileLines'] = $fileLines;
     }
     $this->render($__vars, $errorcode, $errDir, $errPage);
 }
Esempio n. 9
0
 /**
  * 根据请求的mime类型获得返回内容类型
  *
  * @param string $mime mime类型
  * @return string
  */
 public static function getType($mime)
 {
     if (self::$mimes === null) {
         self::$mimes = @(include Wind::getRealPath('WIND:http.mime.mime.php', true));
     }
     return array_search($mime, self::$mimes);
 }
Esempio n. 10
0
 protected function getMethod($operation)
 {
     $config = (include Wind::getRealPath('WINDID:service.base.WindidNotifyConf.php', true));
     $method = isset($config[$operation]['method']) ? $config[$operation]['method'] : '';
     $args = isset($config[$operation]['args']) ? $config[$operation]['args'] : array();
     return array($method, $args);
 }
Esempio n. 11
0
 public function __construct($re)
 {
     if (!is_file(Wind::getRealPath('DATA:install.lock', true))) {
         Wind::getComponent('response')->sendRedirect("install.php");
     }
     parent::__construct($re);
 }
 public function getVersionCustomizedCredit()
 {
     if (!isset($this->service['VersionCustomizedCredit']) || !$this->service['VersionCustomizedCredit']) {
         require_once Wind::getRealPath('ACLOUD_VER:customized.ACloudVerCustomizedCredit');
         $this->service['VersionCustomizedCredit'] = new ACloudVerCustomizedCredit();
     }
     return $this->service['VersionCustomizedCredit'];
 }
Esempio n. 13
0
 /**
  * 获取seo配置
  *
  * @return array
  */
 public function getConfig()
 {
     if ($this->config !== null) {
         return $this->config;
     }
     $this->config = @(include Wind::getRealPath('APPS:seo.conf.seoExtends'));
     $this->config = PwSimpleHook::getInstance('seo_config')->runWithFilters($this->config);
     return $this->config;
 }
Esempio n. 14
0
 public static function createHttpQuery($params)
 {
     if (!$params || !is_array($params)) {
         return '';
     }
     ksort($params);
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     return ACloudSysCoreHttp::httpBuildQuery($params);
 }
Esempio n. 15
0
 public function checkAction()
 {
     require_once Wind::getRealPath('ACLOUD:aCloud');
     ACloudSysCoreCommon::setGlobal('g_siteurl', PUBLIC_URL);
     ACloudSysCoreCommon::setGlobal('g_sitename', 'phpwind');
     ACloudSysCoreCommon::setGlobal('g_charset', Wind::getApp()->getResponse()->getCharset());
     list($this->BenchService, $operate) = array(ACloudSysCoreCommon::loadSystemClass('administor', 'bench.service'), strtolower($this->getInput("operate")));
     return $operate == 'reset' ? $this->reset() : $this->checkEnvironment();
 }
 public function getGeneralClassAndMethodAndArguments($apiConfig, $request)
 {
     $classPath = Wind::getRealPath(sprintf("ACLOUD:api.common.%s.ACloudApiCommonGeneralApi", ACloudSysCoreDefine::ACLOUD_API_VERSION));
     list($className, $method) = array('ACloudApiCommonGeneralApi', 'get');
     list($apiClass, $method) = $this->getRealClassAndMethodAndArguments($classPath, $className, $method);
     if (!$apiClass) {
         return array('', '', array());
     }
     return array($apiClass, $method, array($apiConfig, $request));
 }
 public function getVersionFilterService()
 {
     static $service = null;
     if (!is_null($service)) {
         return $service;
     }
     require_once Wind::getRealPath('ACLOUD_VER:config.ACloudVerConfigFilter');
     $service = new ACloudVerConfigFilter();
     return $service;
 }
Esempio n. 18
0
 public function get()
 {
     $path = Wind::getRealPath('SRV:design.srv.router.router');
     $sysPage = @(include $path);
     $config = Wekit::C('site', 'design.router');
     if (is_array($config)) {
         $sysPage = array_merge($sysPage, $config);
     }
     return $sysPage;
 }
Esempio n. 19
0
 public static function createSignWithOAuth($data)
 {
     $keysService = ACloudSysCoreCommon::loadSystemClass('keys', 'config.service');
     $key1 = $keysService->getKey1(1);
     if (!$key1 || strlen($key1) != 128 || !is_array($data) || count($data) < 4) {
         return '';
     }
     require_once Wind::getRealPath('ACLOUD:.system.core.ACloudSysCoreOauth');
     return ACloudSysCoreOauth::createHttpSign(ACloudSysCoreOauth::createHttpQuery($data) . $key1);
 }
Esempio n. 20
0
 /**
  * 编辑xml
  *
  */
 public function editxmlAction()
 {
     $alias = $this->getInput('alias', 'get');
     /* @var $app PwApplication */
     $app = Wekit::load('APPCENTER:service.PwApplication');
     $app = $app->findByAlias($alias);
     $this->setOutput($app, 'app');
     $manifest = WindFile::read(Wind::getRealPath('EXT:' . $alias . '.Manifest.xml', true));
     $this->setOutput($manifest, 'manifest');
 }
Esempio n. 21
0
 public function getPlats()
 {
     $conf = Wind::getRealPath('SRV:mobile.config.plat.php', true);
     $tmp = array('name' => '', 'alias' => '', 'managelink' => '', 'description' => '', 'components' => array());
     $plats = @(include $conf);
     $plats = $this->sHook->runWithFilters($plats);
     foreach ($plats as $key => $value) {
         $plats[$key] = array_merge($tmp, $value);
     }
     return $plats;
 }
Esempio n. 22
0
 /**
  * 返回附件存储类型
  *
  * @return array
  */
 public function getStorages()
 {
     $conf = Wind::getRealPath('WINDID:service.config.storage.storages.php', true);
     $tmp = array('name' => '', 'alias' => '', 'avatarmanagelink' => '', 'description' => '', 'components' => array());
     $storages = @(include $conf);
     $storages = $this->hook->runWithFilters($storages);
     foreach ($storages as $key => $value) {
         $storages[$key] = array_merge($tmp, $value);
     }
     return $storages;
 }
Esempio n. 23
0
 /**
  * 返回附件存储类型
  *
  * @return array
  */
 public function getStorages()
 {
     $conf = Wind::getRealPath('APPS:config.conf.storages.php', true);
     $tmp = array('name' => '', 'alias' => '', 'managelink' => '', 'description' => '', 'components' => array());
     $storages = @(include $conf);
     $storages = PwSimpleHook::getInstance('PwAttacmentService_getStorages')->runWithFilters($storages);
     foreach ($storages as $key => $value) {
         $storages[$key] = array_merge($tmp, $value);
     }
     return $storages;
 }
 private function __construct()
 {
     $config = (include Wind::getRealPath($this->_config, true));
     $config = PwSimpleHook::getInstance('PwCreditOperationConfig')->runWithFilters($config);
     foreach ($config as $key => $value) {
         if ($value[1] && $value[3]) {
             $this->_map[$value[1]][] = $key;
         }
     }
     $this->_data = $config;
 }
Esempio n. 25
0
 public function __construct()
 {
     $this->file = Wind::getRealPath('EXT:com_qq_login.config', 'php');
     if (file_exists($this->file)) {
         $this->cfg = $this->oldcfg = (include $this->file);
     } else {
         if (!is_writable(dirname($this->file))) {
             throw new exception('config file ' . $this->file . ' is not writable,please set mod to 777.');
         }
     }
 }
Esempio n. 26
0
 public function beforeAction($handlerAdapter)
 {
     $url['baseUrl'] = PUBLIC_URL;
     $url['res'] = WindUrlHelper::checkUrl(PUBLIC_RES, PUBLIC_URL);
     $url['css'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/css', PUBLIC_URL);
     $url['images'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/images', PUBLIC_URL);
     $url['js'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/js/dev', PUBLIC_URL);
     Wekit::setGlobal($url, 'url');
     $config = Wind::getComponent('configParser')->parse(Wind::getRealPath('APPS:demo.WindManifest.xml', true, true));
     Wekit::setGlobal($config['application'], 'c');
 }
Esempio n. 27
0
 /**
  * 返回验证码类型
  *
  * @return array
  */
 public function getVerifyType()
 {
     $conf = Wind::getRealPath('SRV:verify.codetype.verify.php', true);
     $tmp = array('name' => '', 'alias' => '', 'description' => '', 'components' => array());
     $verify = @(include $conf);
     $verify = $this->sHook->runWithFilters($verify);
     foreach ($verify as $key => $value) {
         $verify[$key] = array_merge($tmp, $value);
     }
     return $verify;
 }
Esempio n. 28
0
 private function _setModleInfo()
 {
     $_configParser = Wind::getComponent('configParser');
     $configPath = Wind::getRealPath('SRV:design.srv.model.' . $this->modle . '.config');
     if (!is_file($configPath)) {
         $this->_modelInfo = array();
         return;
     }
     $config = $_configParser->parse($configPath);
     $config['property'] = array_merge($config['normal'], $config['special']);
     $this->_modelInfo = $config;
 }
Esempio n. 29
0
 protected function getOperation($method)
 {
     $config = (include Wind::getRealPath('WSRV:base.WindidNotifyConf.php', true));
     $operation = '';
     foreach ($config as $k => $v) {
         if ($v['method'] == $method) {
             $operation = $k;
             break;
         }
     }
     return $operation;
 }
Esempio n. 30
0
 public function __construct($config = array())
 {
     $config = $config ? $config : (include Wind::getRealPath('WINDID:conf.config.php', true));
     $this->windid = $config['windid'];
     $this->serverUrl = $config['serverUrl'];
     $this->serverIp = isset($config['serverIp']) ? $config['serverIp'] : '';
     $this->clientKey = $config['clientKey'];
     $this->clientId = $config['clientId'];
     $this->clientDb = $config['clientDb'];
     $this->clientCharser = $config['clientCharser'];
     $this->timevc = isset($config['timevc']) ? $config['timevc'] : 0;
 }