当前位置: 首页>>代码示例>>PHP>>正文


PHP Wind类代码示例

本文整理汇总了PHP中Wind的典型用法代码示例。如果您正苦于以下问题:PHP Wind类的具体用法?PHP Wind怎么用?PHP Wind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Wind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postUpload

 protected function postUpload($tmp_name, $filename)
 {
     if (strpos($filename, '..') !== false || strpos($filename, '.php.') !== false || preg_match('/\\.php$/', $filename)) {
         exit('illegal file type!');
     }
     WindFolder::mkRecur(dirname($filename));
     if (function_exists("move_uploaded_file") && @move_uploaded_file($tmp_name, $filename)) {
         @unlink($tmp_name);
         @chmod($filename, 0777);
         return filesize($filename);
     } elseif (@copy($tmp_name, $filename)) {
         @unlink($tmp_name);
         @chmod($filename, 0777);
         return filesize($filename);
     } elseif (is_readable($tmp_name)) {
         Wind::import('WIND:utility.WindFile');
         WindFile::write($filename, WindFile::read($tmp_name));
         @unlink($tmp_name);
         if (file_exists($filename)) {
             @chmod($filename, 0777);
             return filesize($filename);
         }
     }
     return false;
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:25,代码来源:WindFormUpload.php

示例2: addlikeAction

 public function addlikeAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     $fromid = (int) $this->getInput('fromid', 'post');
     $fromApp = $this->getInput('app', 'post');
     $subject = $this->getInput('subject', 'post');
     $url = $this->getInput('url', 'post');
     if ($fromid < 1 || empty($fromApp)) {
         $this->showError('BBS:like.fail');
     }
     $source = $this->_getLikeSourceDs()->getSourceByAppAndFromid($fromApp, $fromid);
     $newId = isset($source['sid']) ? (int) $source['sid'] : 0;
     Wind::import('SRV:like.dm.PwLikeSourceDm');
     if ($newId < 1) {
         $dm = new PwLikeSourceDm();
         $dm->setSubject($subject)->setSourceUrl($url)->setFromApp($fromApp)->setFromid($fromid)->setLikeCount(0);
         $newId = $this->_getLikeSourceDs()->addSource($dm);
     } else {
         $dm = new PwLikeSourceDm($source['sid']);
         $dm->setLikeCount($source['like_count']);
         $this->_getLikeSourceDs()->updateSource($dm);
     }
     $resource = $this->_getLikeService()->addLike($this->loginUser, 9, $newId);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $this->setOutput($resource, 'data');
     $this->showMessage('BBS:like.success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:29,代码来源:SourceController.php

示例3: doeditAction

 public function doeditAction()
 {
     $tpl = $this->getInput('tpl', 'post');
     $compid = (int) $this->getInput('compid', 'post');
     $tpl = $this->_getDesignService()->filterTemplate($tpl);
     if (!$this->_getDesignService()->checkTemplate($tpl)) {
         $this->showError("DESIGN:template.error");
     }
     $property = $this->bo->getProperty();
     $limit = $this->compileFor($tpl);
     $property['limit'] = $limit ? $limit : $property['limit'];
     Wind::import('SRV:design.dm.PwDesignModuleDm');
     $dm = new PwDesignModuleDm($this->bo->moduleid);
     $dm->setModuleTpl($tpl)->setCompid($compid)->setProperty($property);
     $resource = $this->_getModuleDs()->updateModule($dm);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $module = $this->bo->getModule();
     Wekit::load('design.srv.PwSegmentService')->updateSegmentByPageId($module['page_id']);
     Wind::import('SRV:design.srv.data.PwAutoData');
     $srv = new PwAutoData($this->bo->moduleid);
     $srv->addAutoData();
     $this->_getDesignService()->clearCompile();
     if ($module['module_type'] == PwDesignModule::TYPE_SCRIPT) {
         $this->showMessage("operate.success", "design/module/run?type=api", true);
     } else {
         $this->showMessage("operate.success");
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:30,代码来源:TemplateController.php

示例4: __construct

 public function __construct($forum)
 {
     Wind::import('SRV:forum.vo.PwThreadSo');
     $this->forum = $forum;
     $this->so = new PwThreadSo();
     $this->so->setFid($forum->fid)->setDisabled(0);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:PwSearchThread.php

示例5: _initInfo

 private function _initInfo()
 {
     $this->uid = wekit::getLoginUser()->info['uid'];
     // dump($this->uid);
     $this->username = wekit::getLoginUser()->info['username'];
     $this->onlinetime = intval(intval(wekit::getLoginUser()->info['onlinetime']) / 3600);
     // $this->ip= wekit::getLoginUser()->info['lastloginip'];
     // $this->ip=$_SERVER["REMOTE_ADDR"];
     $this->ip = $this->GetIP();
     Wind::import('SRV:credit.bo.PwCreditBo');
     $userBelongSrv = Wekit::load('SRV:user.PwUserBelong');
     // dump($userBelongSrv->getUserBelongs(7));
     $this->gid = wekit::getLoginUser()->info['groupid'];
     //$this->gid=8;//0 NULL 1会员2游客3管理员4总版主5论坛版主6禁止发言7未验证会员
     if (($group = Wekit::cache()->get('group', $this->gid)) === false) {
         $group = Wekit::cache()->get('group', 1);
     }
     // dump(Wekit::$_app);
     // dump($this->gid);
     //2015.1.17关闭group
     if ($group) {
         $this->groupInfo = array('name' => $group['name'], 'type' => $group['type'], 'image' => $group['image'], 'points' => $group['points']);
         $this->permission = $group['permission'];
     }
     // dump($this->groupInfo);
     $this->avatarPath = str_replace('_middle', '', Pw::getAvatar($this->uid));
     //获取头像 √
 }
开发者ID:taita2015,项目名称:NanaGate-2015,代码行数:28,代码来源:CustomController.php

示例6: getMethod

 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);
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:7,代码来源:IndexController.php

示例7: afterAction

 public function afterAction($handlerAdapter)
 {
     parent::afterAction($handlerAdapter);
     $debug = Wekit::C('site', 'debug') || !Wekit::C('site', 'css.compress');
     Wekit::setGlobal(array('debug' => $debug ? '/dev' : '/build'), 'theme');
     $this->setTheme('site', null);
     /* @var $resource WindLangResource */
     $resource = Wind::getComponent('i18n');
     $_error = $this->getForward()->getVars('message');
     if ($resource !== null) {
         foreach ($_error as $key => $value) {
             if (is_array($value)) {
                 list($value, $var) = $value;
             } else {
                 $var = array();
             }
             $message = $resource->getMessage($value, $var);
             $message && ($_error[$key] = $message);
         }
     }
     $this->getForward()->setVars(array('message' => $_error, '__error' => ''));
     $type = $this->getRequest()->getAcceptTypes();
     // 如果是含有上传的递交,不能采用ajax的方式递交,需要以html的方式递交,并且返回的结果需要是json格式,将以json=1传递过来标志
     $json = $this->getInput('_json');
     $requestJson = $this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false;
     if ($requestJson || $json == 1) {
         $this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset'));
         echo Pw::jsonEncode($this->getForward()->getVars());
         exit;
     }
 }
开发者ID:BTSnowball,项目名称:BTSnowball_Users_Hand,代码行数:31,代码来源:PwErrorController.php

示例8: run

 public function run()
 {
     $this->_setNavType('schoolarea');
     $allArea = $this->_getAreaDs()->getAreaByParentid(0);
     $allArea = array_values($allArea);
     //check if has province id or not, if has, then school list need to based on that
     //get province from url
     $choosenProvinceid = $this->getInput('choosenProvinceid');
     if (!isset($choosenProvinceid) || $choosenProvinceid <= 0) {
         $choosenProvinceid = $allArea[0]['areaid'];
     }
     $allSchool = $this->_getSchoolDs()->getSchoolByAreaidAndTypeid($choosenProvinceid, 3);
     $allSchool = array_values($allSchool);
     $this->setOutput($allSchool, 'allSchool');
     $choosenSchoolid = $this->getInput('choosenSchoolid');
     if (!isset($choosenSchoolid) || $choosenSchoolid <= 0) {
         $choosenSchoolid = $allSchool[0]['schoolid'];
     }
     //check if it is from search, if from search, then search by selected university
     if ($this->getInput('search', 'post') === 'search') {
         $choosenSchoolid = $this->getInput('choosenSchoolid', 'post');
         $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid);
         $choosenProvinceid = $this->getInput('choosenProvinceid', 'post');
     } else {
         //get first school and show its area
         Wind::import('EXT:4tschool.service.dm.App_SchoolArea_Dm');
         $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid);
         //print_r($areaList);die;
     }
     $this->setOutput($choosenProvinceid, 'choosenProvinceid');
     $this->setOutput($choosenSchoolid, 'choosenSchoolid');
     $this->setOutput($areaList, 'areaList');
     $this->setOutput($allArea, 'allArea');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:34,代码来源:SchoolareaController.php

示例9: __construct

 /**
  * 初始化安装程序
  */
 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);
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:10,代码来源:PwInstallApplication.php

示例10: doftpAction

 /**
  * 后台设置-ftp设置
  */
 public function doftpAction()
 {
     Wind::import('WINDID:service.config.srv.WindidConfigSet');
     $config = new WindidConfigSet('attachment');
     $config->set('ftp.url', $this->getInput('ftpUrl', 'post'))->set('ftp.server', $this->getInput('ftpServer', 'post'))->set('ftp.port', $this->getInput('ftpPort', 'post'))->set('ftp.dir', $this->getInput('ftpDir', 'post'))->set('ftp.user', $this->getInput('ftpUser', 'post'))->set('ftp.pwd', $this->getInput('ftpPwd', 'post'))->set('ftp.timeout', abs(intval($this->getInput('ftpTimeout', 'post'))))->flush();
     $this->showMessage('WINDID:success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:10,代码来源:StorageController.php

示例11: setStore

 public function setStore($key, $storage)
 {
     Wind::import('WINDID:service.config.srv.WindidConfigSet');
     $config = new WindidConfigSet('storage');
     $config->set($key, serialize($storage))->flush();
     return true;
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:WindidStoreService.php

示例12: getAppOutPut

 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;
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:25,代码来源:ACloudVerCoreApp.php

示例13: checkVerify

 public function checkVerify($inputCode)
 {
     Wind::import('WINDID:service.verify.srv.PwVerifyService');
     $srv = new PwVerifyService('PwVerifyService_getVerifyType');
     $config = Wekit::C('verify');
     return $srv->checkVerify($config['type'], $inputCode);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:PwCheckVerifyService.php

示例14: run

 public function run()
 {
     $permissionService = new PwPermissionService();
     $categorys = $permissionService->getPermissionPoint($this->_getShowPoint(), array('basic', 'bbs'));
     $compare = $this->getInput('gid');
     if ($compare && $compare != $this->loginUser->gid) {
         $this->setOutput(true, 'compare');
         $compareGroup = $permissionService->getPermissionConfigByGid($compare, $this->_getShowPoint());
         $this->setOutput($compareGroup, 'compareGroupPermission');
         $this->setOutput($compare, 'comparegid');
     }
     $myGroup = $permissionService->getPermissionConfigByGid($this->loginUser->gid, $this->_getShowPoint());
     $this->listGroups();
     $attach = array('allow_upload', 'allow_download', 'uploads_perday');
     foreach ($categorys['bbs']['sub'] as $_k => $_v) {
         if (!in_array($_v, $attach)) {
             continue;
         }
         unset($categorys['bbs']['sub'][$_k]);
     }
     $totalCredit = Wekit::load('usergroup.srv.PwUserGroupsService')->getCredit($this->loginUser->info);
     $categorys['attach'] = array('name' => '附件权限', 'sub' => $attach);
     $this->setOutput($categorys, 'categorys');
     $this->setOutput($myGroup, 'myGroupPermission');
     $this->setOutput($totalCredit, 'myCredit');
     $this->_appendBread('权限查看', WindUrlHelper::createUrl('profile/right/run'));
     $this->setTemplate('profile_right');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:profile.right.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:34,代码来源:RightController.php

示例15: getType

 /**
  * 根据请求的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);
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:13,代码来源:WindMimeType.php


注:本文中的Wind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。