當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WindUtility類代碼示例

本文整理匯總了PHP中WindUtility的典型用法代碼示例。如果您正苦於以下問題:PHP WindUtility類的具體用法?PHP WindUtility怎麽用?PHP WindUtility使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了WindUtility類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __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

示例2: emailAction

 /** 
  * 電子郵件用戶激活
  */
 public function emailAction()
 {
     list($page, $perpage) = $this->getInput(array('page', 'perpage'));
     $page = $page ? $page : 1;
     $perpage = $perpage ? $perpage : $this->perpage;
     $count = $this->_getDs()->countUnActived();
     $list = array();
     if ($count > 0) {
         $totalPage = ceil($count / $perpage);
         $page > $totalPage && ($page = $totalPage);
         $result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage));
         /* @var $userDs PwUser */
         $userDs = Wekit::load('user.PwUser');
         $list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN);
         $list = WindUtility::mergeArray($result, $list);
     }
     $this->setOutput($count, 'count');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput(array('perpage' => $perpage), 'args');
     $this->setOutput($list, 'list');
     // seo設置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:manage.user.email.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:31,代碼來源:UserController.php

示例3: __call

 /**
  * 重載了魔術方法__call
  * 
  * 當類的方法訪問不到時調用該方法,在這裏的實現是配置類屬性對象的延遲加載策略
  * <code>
  * //延遲訪問某個屬性,當使用這種方式調用時該方法被調用,並訪問該類中的$_delayAttributes屬性,並創建該屬性對象並返回
  * $this->_getMethodName(); 
  * </code>
  * @param string $methodName
  * @param array $args
  * @return mixed
  */
 public function __call($methodName, $args)
 {
     $_prefix = substr($methodName, 0, 4);
     $_propertyName = substr($methodName, 4);
     $_propertyName = WindUtility::lcfirst($_propertyName);
     if ($_prefix == '_get') {
         if (!$this->{$_propertyName} && isset($this->_delayAttributes[$_propertyName])) {
             $_property = $this->_delayAttributes[$_propertyName];
             $_value = null;
             if (isset($_property['value'])) {
                 $_value = $_property['value'];
             } elseif (isset($_property['ref'])) {
                 $_value = Wind::getApp()->getWindFactory()->getInstance($_property['ref'], $args);
             } elseif (isset($_property['path'])) {
                 $_className = Wind::import($_property['path']);
                 $_value = WindFactory::createInstance($_className, $args);
             }
             $this->{$_propertyName} = $_value;
             /*unset($this->delayAttributes[$_propertyName]);*/
         }
         return $this->{$_propertyName};
     } elseif ($_prefix == '_set') {
         $this->{$_propertyName} = $args[0];
     }
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:37,代碼來源:WindModule.php

示例4: run

 /**
  * 關注-首頁
  */
 public function run()
 {
     $type = $this->getInput('type');
     $page = intval($this->getInput('page'));
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $url = $classCurrent = array();
     $typeCounts = $this->_getTypeDs()->countUserType($this->loginUser->uid);
     if ($type) {
         $tmp = $this->_getTypeDs()->getUserByType($this->loginUser->uid, $type, $limit, $start);
         $follows = $this->_getDs()->fetchFollows($this->loginUser->uid, array_keys($tmp));
         $count = $typeCounts[$type] ? $typeCounts[$type]['count'] : 0;
         $url['type'] = $type;
         $classCurrent[$type] = 'current';
     } else {
         $follows = $this->_getDs()->getFollows($this->loginUser->uid, $limit, $start);
         $count = $this->loginUser->info['follows'];
         $classCurrent[0] = 'current';
     }
     $uids = array_keys($follows);
     $fans = $this->_getDs()->fetchFans($this->loginUser->uid, $uids);
     $userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN | PwUser::FETCH_DATA | PwUser::FETCH_INFO);
     $service = $this->_getService();
     $typeArr = $service->getAllType($this->loginUser->uid);
     $userType = $service->getUserType($this->loginUser->uid, $uids);
     foreach ($userType as $key => $value) {
         $tmp = array();
         foreach ($value as $k => $v) {
             $tmp[$v] = $typeArr[$v];
         }
         ksort($tmp);
         $userType[$key] = $tmp;
     }
     $follows = WindUtility::mergeArray($follows, $userList);
     if (!$type && !$follows) {
         $num = 30;
         $uids = $this->_getRecommendService()->getOnlneUids($num);
         $uids = array_slice($uids, 0, 24);
         $this->setOutput($this->_getRecommendService()->buildUserInfo($this->loginUser->uid, $uids, $num), 'recommend');
     }
     $this->setOutput($follows, 'follows');
     $this->setOutput($typeArr, 'typeArr');
     $this->setOutput($type, 'type');
     $this->setOutput($userType, 'userType');
     $this->setOutput($typeCounts, 'typeCounts');
     $this->setOutput($fans, 'fans');
     $this->setOutput($classCurrent, 'classCurrent');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($count, 'count');
     $this->setOutput($url, 'url');
     // seo設置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:bbs.follow.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
開發者ID:YoursBoss,項目名稱:nextwind,代碼行數:62,代碼來源:FollowController.php

示例5: getDetailList

 public function getDetailList($notice)
 {
     $list = $uids = array();
     $extendParams = $notice['extend_params'];
     $uids = array_keys($extendParams);
     $userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN);
     $list['follows'] = $this->_getAttention()->fetchFollows($notice['uid'], array_keys($userList));
     $list['fans'] = WindUtility::mergeArray(array_unique($extendParams), $userList);
     return $list;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:10,代碼來源:PwNoticeAttention.php

示例6: run

 /**
  * 運行當前應用
  *
  * @param string $name 應用名稱默認‘phpwind’
  * @param array $components 組建配置信息 該組建配置將會覆蓋原組建配置,默認為空
  */
 public static function run($name = 'phpwind', $components = array())
 {
     $config = WindUtility::mergeArray(include WEKIT_PATH . '../conf/application/default.php', include WEKIT_PATH . '../conf/application/' . $name . '.php');
     if (!empty($components)) {
         $config['components'] = (array) $components + $config['components'];
     }
     /* @var $application WindWebFrontController */
     $application = Wind::application($name, $config);
     $application->registeFilter(new PwFrontFilters($application));
     $application->run();
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:17,代碼來源:wekit.php

示例7: __construct

 /**
  * manifest path
  *
  * @param string $manifest        	
  */
 public function __construct($manifest, $extends = array())
 {
     is_string($manifest) && ($manifest = Wind::getComponent('configParser')->parse($manifest));
     if ($extends) {
         $manifest = WindUtility::mergeArray($manifest, $extends);
         $charset = isset($manifest['application']['charset']) ? $manifest['application']['charset'] : 'utf-8';
     } else {
         $charset = Wekit::app()->charset;
     }
     strncasecmp($charset, 'utf', 3) && ($manifest = WindConvert::convert($manifest, $charset, 'utf-8'));
     $this->manifest = $manifest;
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:17,代碼來源:PwManifest.php

示例8: showErrorMessage

 protected function showErrorMessage($message, $file, $line, $trace, $errorcode)
 {
     $log = $message . "\r\n" . $file . ":" . $line . "\r\n";
     list($fileLines, $trace) = WindUtility::crash($file, $line, $trace);
     foreach ($trace as $key => $value) {
         $log .= $value . "\r\n";
     }
     if (WIND_DEBUG & 2) {
         Wind::getApp()->getComponent('windLogger')->error($log, 'error', true);
     }
     exit($log);
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:12,代碼來源:WindCommandFrontController.php

示例9: addThread

 /**
  * 發表帖子 鉤子
  */
 public function addThread($tid)
 {
     $data = $this->inputData;
     if (intval($data['isopen'] != 1)) {
         return false;
     }
     $tid = intval($tid);
     if ($tid < 1) {
         return false;
     }
     $token = strtolower(WindUtility::generateRandStr(10));
     $dm = $this->_getEncryptPostsDm();
     $dm->setTid($tid)->setToken($token);
     return $this->_getEncryptPostsDs()->add($dm);
 }
開發者ID:sanzhumu,項目名稱:nextwind,代碼行數:18,代碼來源:App_EncryptPosts_EncryptPostsService.php

示例10: run

 /**
  * 關注-首頁
  */
 public function run()
 {
     $type = $this->getInput('type');
     $page = intval($this->getInput('page'));
     $page < 1 && ($page = 1);
     $perpage = 20;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $args = $classCurrent = array();
     /*		$typeCounts = $this->_getTypeDs()->countUserType($this->space->spaceUid);
     		if ($type) {
     			$tmp = $this->_getTypeDs()->getUserByType($this->space->spaceUid, $type, $limit, $start);
     			$follows = $this->_getDs()->fetchFollows($this->space->spaceUid, array_keys($tmp));
     			$count = $typeCounts[$type] ? $typeCounts[$type]['count'] : 0;
     			$classCurrent[$type] = 'current';
     			$args = array('type' => $type);
     		} else {*/
     $follows = $this->_getDs()->getFollows($this->space->spaceUid, $limit, $start);
     $count = $this->space->spaceUser['follows'];
     $classCurrent[0] = 'current';
     //}
     $uids = array_keys($follows);
     $fans = $this->_getDs()->fetchFans($this->loginUser->uid, $uids);
     $myfollows = $this->_getDs()->fetchFollows($this->loginUser->uid, $uids);
     $userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_ALL);
     $service = $this->_getService();
     $args['uid'] = $this->space->spaceUid;
     $follows = WindUtility::mergeArray($follows, $userList);
     if (!$follows && $this->space->tome == PwSpaceBo::MYSELF) {
         $num = 20;
         $uids = $this->_getRecommendService()->getRecommendAttention($this->loginUser->uid, $num);
         $this->setOutput($this->_getRecommendService()->buildUserInfo($this->loginUser->uid, $uids, $num), 'recommend');
     }
     $this->setOutput($fans, 'fans');
     $this->setOutput($follows, 'follows');
     $this->setOutput($myfollows, 'myfollows');
     $this->setOutput($classCurrent, 'classCurrent');
     $this->setOutput($args, 'args');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($count, 'count');
     $this->setOutput('follows', 'src');
     // seo設置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:space.follows.run.title', array($this->space->spaceUser['username'], $this->space->space['space_name'])), '', $lang->getMessage('SEO:space.follows.run.description', array($this->space->spaceUser['username'])));
     Wekit::setV('seo', $seoBo);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:51,代碼來源:FollowsController.php

示例11: initConfig

 public function initConfig($config, $factory)
 {
     is_array($config) || ($config = $factory->getInstance('configParser')->parse($config));
     foreach ($config['web-apps'] as $key => $value) {
         if (isset($this->_config['web-apps'][$key])) {
             continue;
         }
         $rootPath = empty($value['root-path']) ? dirname($_SERVER['SCRIPT_FILENAME']) : Wind::getRealPath($value['root-path'], true);
         Wind::register($rootPath, $key, true);
         if ('default' !== $key && !empty($config['default'])) {
             $value = WindUtility::mergeArray($config['default'], $value);
         }
         $this->setConfig($key, $value);
     }
     $this->_config['router'] = isset($config['router']) ? $config['router'] : array();
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:16,代碼來源:TestFrontController.php

示例12: addAction

 public function addAction()
 {
     $struct = $this->getInput('struct', 'post');
     $model = $this->getInput('model', 'post');
     $pageid = $this->getInput('pageid', 'post');
     if (!$model) {
         $this->showError('operate.fail');
     }
     Wekit::load('design.PwDesignPermissions');
     $permissions = $this->_getPermissionsService()->getPermissionsForPage($this->loginUser->uid, $pageid);
     if ($permissions < PwDesignPermissions::IS_DESIGN) {
         $this->showError("DESIGN:permissions.fail");
     }
     Wind::import('SRV:design.bo.PwDesignModelBo');
     $bo = new PwDesignModelBo($model);
     if (!$bo->isModel()) {
         $this->showError('operate.fail');
     }
     $cls = sprintf('PwDesign%sDataService', ucwords($model));
     Wind::import('SRV:design.srv.model.' . $model . '.' . $cls);
     $service = new $cls();
     $decorator = $service->decorateAddProperty($model);
     $_models = array();
     $service = $this->_getDesignService();
     $types = $service->getDesignModelType();
     $models = $service->getModelList();
     foreach ($models as $k => $v) {
         $_models[$v['type']][] = array('name' => $v['name'], 'model' => $k);
     }
     $ds = $this->_getModuleDs();
     $pageInfo = $this->_getPageDs()->getPage($pageid);
     $module['module_name'] = $pageInfo['page_name'] . '_' . WindUtility::generateRandStr(4);
     $cache['expired'] = 15;
     $this->setOutput($cache, 'cache');
     $this->setOutput($module, 'module');
     $this->setOutput($types, 'types');
     $this->setOutput($_models, 'models');
     $this->setOutput($bo->getProperty(), 'property');
     $this->setOutput($bo->getModel(), 'modelInfo');
     $this->setOutput($decorator, 'decorator');
     $this->setOutput($model, 'model');
     $this->setOutput($pageid, 'pageid');
     $this->setOutput($struct, 'struct');
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:44,代碼來源:PropertyController.php

示例13: dorunAction

 public function dorunAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     list($windid, $serverUrl, $clientId, $clientKey, $connect) = $this->getInput(array('windid', 'serverUrl', 'clientId', 'clientKey', 'connect'), 'post');
     if ($windid == 'local') {
         $serverUrl = Wekit::C('site', 'info.url') . '/windid';
         $clientId = 1;
         !$clientKey && ($clientKey = md5(WindUtility::generateRandStr(10)));
         $connect = 'db';
     }
     $config = new PwConfigSet('windid');
     $config->set('windid', $windid)->set('serverUrl', $serverUrl)->set('clientId', $clientId)->set('clientKey', $clientKey)->set('connect', $connect);
     if ($windid == 'client') {
         list($dbhost, $dbport, $dbuser, $dbpwd, $dbname, $dbprefix, $dbcharset) = $this->getInput(array('dbhost', 'dbport', 'dbuser', 'dbpwd', 'dbname', 'dbprefix', 'dbcharset'), 'post');
         $config->set('db.host', $dbhost)->set('db.port', $dbport)->set('db.user', $dbuser)->set('db.pwd', $dbpwd)->set('db.name', $dbname)->set('db.prefix', $dbprefix)->set('db.charset', $dbcharset);
     }
     $config->flush();
     if ($clientId) {
         Wekit::C()->reload('windid');
         $service = WindidApi::api('app');
         WindidApi::getDm('app');
         if (!$service->getApp($clientId)) {
             $charset = Wekit::V('charset');
             $charset = str_replace('-', '', strtolower($charset));
             if (!in_array($charset, array('gbk', 'utf8', 'big5'))) {
                 $charset = 'utf8';
             }
             $dm = new WindidAppDm();
             $dm->setId($clientId)->setApiFile('windid.php')->setIsNotify(1)->setIsSyn(1)->setAppName(Wekit::C('site', 'info.name'))->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setAppIp(Wind::getComponent('request')->getClientIp())->setCharset($charset);
             $service->addApp($dm);
         } elseif ($clientKey) {
             $dm = new WindidAppDm($clientId);
             $dm->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setCharset($charset);
             $service->editApp($dm);
         }
     }
     $_avatarUrl = WindidApi::api('avatar')->getAvatarUrl();
     if ($_avatarUrl != WindidError::SERVER_ERROR) {
         Wekit::C()->setConfig('site', 'avatarUrl', $_avatarUrl);
     }
     $this->showMessage('ADMIN:success');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:42,代碼來源:WindidController.php

示例14: preHandle

 public function preHandle()
 {
     if (!$this->form) {
         return null;
     }
     $className = Wind::import($this->form);
     $form = WindFactory::createInstance($className);
     $methods = get_class_methods($form);
     foreach ($methods as $method) {
         if (0 !== strpos($method, 'set') || '' == ($_tmp = substr($method, 3))) {
             continue;
         }
         if (null === ($input = $this->getRequest()->getRequest(WindUtility::lcfirst($_tmp), null))) {
             continue;
         }
         call_user_func_array(array($form, $method), array($input));
     }
     $form->validate();
     $this->getRequest()->setAttribute($form, WindUtility::lcfirst($className));
     $this->sendError($form->getErrorAction(), $form->getErrors());
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:21,代碼來源:WindFormFilter.php

示例15: emailAction

 /** 
  * 電子郵件用戶激活
  */
 public function emailAction()
 {
     list($page, $perpage) = $this->getInput(array('page', 'perpage'));
     $page = $page ? $page : 1;
     $perpage = $perpage ? $perpage : $this->perpage;
     $count = $this->_getDs()->countUnActived();
     $list = array();
     if ($count > 0) {
         $totalPage = ceil($count / $perpage);
         $page > $totalPage && ($page = $totalPage);
         $result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage));
         /* @var $userDs PwUser */
         $userDs = Wekit::load('user.PwUser');
         $list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN);
         $list = WindUtility::mergeArray($result, $list);
     }
     $this->setOutput($count, 'count');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($list, 'list');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:24,代碼來源:CheckController.php


注:本文中的WindUtility類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。