本文整理汇总了PHP中Wekit::createapp方法的典型用法代码示例。如果您正苦于以下问题:PHP Wekit::createapp方法的具体用法?PHP Wekit::createapp怎么用?PHP Wekit::createapp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wekit
的用法示例。
在下文中一共展示了Wekit::createapp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onCreate
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);
}
}
示例2: run
/**
* 87升级到9更新缓存
*/
public function run()
{
//$db = $this->_checkDatabase();
Wekit::createapp('phpwind');
//更新HOOK配置数据
Wekit::load('hook.srv.PwHookRefresh')->refresh();
//初始化站点config
$site_hash = WindUtility::generateRandStr(8);
$cookie_pre = WindUtility::generateRandStr(3);
Wekit::load('config.PwConfig')->setConfig('site', 'hash', $site_hash);
Wekit::load('config.PwConfig')->setConfig('site', 'cookie.pre', $cookie_pre);
Wekit::load('config.PwConfig')->setConfig('site', 'info.url', PUBLIC_URL);
Wekit::load('nav.srv.PwNavService')->updateConfig();
//风格默认数据
Wekit::load('APPCENTER:service.srv.PwStyleInit')->init();
//计划任务默认数据
Wekit::load('cron.srv.PwCronService')->updateSysCron();
//版块的统计数据更新
/* @var $forumMisc PwForumMiscService */
$forumMisc = Wekit::load('forum.srv.PwForumMiscService');
$forumMisc->correctData();
$forumMisc->countAllForumStatistics();
//更新数据缓存
/* @var $usergroup PwUserGroupsService */
$usergroup = Wekit::load('SRV:usergroup.srv.PwUserGroupsService');
$usergroup->updateLevelCache();
$usergroup->updateGroupCache();
$usergroup->updateGroupRightCache();
/* @var $emotion PwEmotionService */
$emotion = Wekit::load('SRV:emotion.srv.PwEmotionService');
$emotion->updateCache();
//门户演示数据
Wekit::load('SRV:design.srv.PwDesignDefaultService')->likeModule();
Wekit::load('SRV:design.srv.PwDesignDefaultService')->tagModule();
Wekit::load('SRV:design.srv.PwDesignDefaultService')->reviseDefaultData();
//全局缓存更新
Wekit::load('SRV:cache.srv.PwCacheUpdateService')->updateConfig();
Wekit::load('SRV:cache.srv.PwCacheUpdateService')->updateMedal();
$this->_writeWindid();
$this->_designUpgrade();
//清理升级过程的文件
// WindFile::del(Wind::getRealPath('DATA:setup.setup_config.php', true));
// WindFile::del(Wind::getRealPath('DATA:setup.tmp_dbsql.php', true));
$this->setTemplate('upgrade_finish');
}
示例3: beforeAction
public function beforeAction($handlerAdapter)
{
if ('finish' != $handlerAdapter->getAction()) {
Wekit::createapp('install');
}
//ajax递交编码转换
if ($this->getRequest()->getIsAjaxRequest()) {
$toCharset = $this->getResponse()->getCharset();
if (strtoupper(substr($toCharset, 0, 2)) != 'UT') {
$_tmp = array();
foreach ($_POST as $key => $value) {
$key = WindConvert::convert($key, $toCharset, 'UTF-8');
$_tmp[$key] = WindConvert::convert($value, $toCharset, 'UTF-8');
}
$_POST = $_tmp;
}
}
$_consts = (include Wind::getRealPath('CONF:publish.php', true));
foreach ($_consts as $const => $value) {
if (defined($const)) {
continue;
}
if ($const === 'PUBLIC_URL' && !$value) {
$value = Wind::getApp()->getRequest()->getBaseUrl(true);
}
define($const, $value);
}
$url = array();
$url['base'] = 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);
$url['attach'] = WindUrlHelper::checkUrl(PUBLIC_ATTACH, PUBLIC_URL);
Wekit::setGlobal($url, 'url');
$this->setOutput(NEXT_VERSION, 'wind_version');
WindFile::isFile($this->_getInstallLockFile()) && $this->showError('INSTALL:have_install_lock');
}
示例4: onCreate
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);
}
}
示例5: error_reporting
<?php
error_reporting(0);
@header("Content-Type:text/html; charset=utf-8");
define('SCR', 'aCloud_index');
define('WIND_DEBUG', 0);
require_once '.././src/wekit.php';
$front = Wind::application('acloud', WEKIT_PATH . 'aCloud/aCloudConfig.php');
// $front->createApplication();
Wekit::createapp('acloud');
$config = (include WEKIT_PATH . '../conf/application/default.php');
Wekit::app()->charset = $config['web-apps']['default']['charset'];
require_once WEKIT_PATH . 'aCloud/aCloud.php';
$router = new ACloudRouter();
$router->run();
示例6: error_reporting
if (!defined('WEKIT_VERSION')) {
error_reporting(E_ERROR | E_PARSE);
require_once WINDID_BOOT . '../wekit.php';
Wekit::init('windidclient');
Wind::application('windidclient', Wekit::S());
$database = (include WINDID_BOOT . 'conf/database.php');
$windidConfig = (include Wind::getRealPath('WINDID:conf.config.php', true));
Wind::register(WINDID_PATH . 'service', 'SRV');
} else {
$windidConfig = Wekit::C('windid');
if ($windidConfig['windid'] == 'local') {
$database = Wind::getComponent('db')->getConfig();
$database['tableprefix'] .= 'windid_';
$windidConfig['connect'] = 'db';
} else {
$database = array('dsn' => 'mysql:host=' . $windidConfig['db.host'] . ';dbname=' . $windidConfig['db.name'] . ';port=' . $windidConfig['db.port'], 'user' => $windidConfig['db.user'], 'pwd' => $windidConfig['db.pwd'], 'charset' => $windidConfig['db.charset'], 'tableprefix' => $windidConfig['db.prefix']);
}
$windidConfig['charset'] = Wekit::V('charset');
}
Wind::register(WINDID_PATH . 'service', 'WSRV');
Wind::import('WSRV:base.WindidBaseDao');
Wind::import('WSRV:base.WindidUtility');
Wind::import('WSRV:base.WindidError');
Wind::registeComponent(array('path' => 'WIND:db.WindConnection', 'config' => $database), 'windiddb', 'singleton');
define('WINDID_CONNECT', $windidConfig['connect']);
define('WINDID_SERVER_URL', $windidConfig['serverUrl']);
define('WINDID_CLIENT_ID', $windidConfig['clientId']);
define('WINDID_CLIENT_KEY', $windidConfig['clientKey']);
define('WINDID_CLIENT_CHARSET', $windidConfig['charset']);
Wekit::createapp('windidclient', 'windid');
示例7: finishAction
/**
* 安装完成
*/
public function finishAction()
{
Wekit::createapp('phpwind');
$db = $this->_checkDatabase();
//更新HOOK配置数据
Wekit::load('hook.srv.PwHookRefresh')->refresh();
//初始化站点config
$site_hash = WindUtility::generateRandStr(8);
$cookie_pre = WindUtility::generateRandStr(3);
Wekit::load('config.PwConfig')->setConfig('site', 'hash', $site_hash);
Wekit::load('config.PwConfig')->setConfig('site', 'cookie.pre', $cookie_pre);
Wekit::load('config.PwConfig')->setConfig('site', 'info.mail', $db['founder']['manager_email']);
Wekit::load('config.PwConfig')->setConfig('site', 'info.url', PUBLIC_URL);
Wekit::load('nav.srv.PwNavService')->updateConfig();
//风格默认数据
Wekit::load('APPS:appcenter.service.srv.PwStyleInit')->init();
//计划任务默认数据
Wekit::load('cron.srv.PwCronService')->updateSysCron();
//更新数据缓存
/* @var $usergroup PwUserGroupsService */
$usergroup = Wekit::load('SRV:usergroup.srv.PwUserGroupsService');
$usergroup->updateLevelCache();
$usergroup->updateGroupCache(range(1, 16));
$usergroup->updateGroupRightCache();
/* @var $emotion PwEmotionService */
$emotion = Wekit::load('SRV:emotion.srv.PwEmotionService');
$emotion->updateCache();
//创始人配置
$uid = $this->_writeFounder($db['founder']['manager'], $db['founder']['manager_pwd'], $db['founder']['manager_email']);
//门户演示数据
Wekit::load('SRV:design.srv.PwDesignDefaultService')->likeModule();
Wekit::load('SRV:design.srv.PwDesignDefaultService')->tagModule();
Wekit::load('SRV:design.srv.PwDesignDefaultService')->reviseDefaultData();
//演示数据导入
Wind::import('SRV:forum.srv.PwPost');
Wind::import('SRV:forum.srv.post.PwTopicPost');
$pwPost = new PwPost(new PwTopicPost(2, new PwUserBo($uid)));
$threads = $this->_getDemoThreads();
foreach ($threads as $thread) {
$postDm = $pwPost->getDm();
$postDm->setTitle($thread['title'])->setContent($thread['content']);
$result = $pwPost->execute($postDm);
}
//全局缓存更新
Wekit::load('SRV:cache.srv.PwCacheUpdateService')->updateConfig();
Wekit::load('SRV:cache.srv.PwCacheUpdateService')->updateMedal();
//清理安装过程的文件
WindFile::write($this->_getInstallLockFile(), 'LOCKED');
WindFile::del($this->_getTempFile());
WindFile::del($this->_getTableLogFile());
WindFile::del($this->_getTableSqlFile());
}