本文整理汇总了PHP中step4函数的典型用法代码示例。如果您正苦于以下问题:PHP step4函数的具体用法?PHP step4怎么用?PHP step4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了step4函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callstep
function callstep($step, $data = array())
{
switch ($step) {
case 5:
return step5($data);
case 4:
return step4($data);
case 3:
return step3($data);
case 2:
return step2($data);
default:
return step1($data);
}
}
示例2: switch
}
switch ($_GET['step']) {
case 1:
require './include/var.php';
env_check($env_items);
dirfile_check($dirfile_items);
function_check($func_items);
break;
case 3:
$install_error = '';
$install_recover = '';
$demo_data = file_exists('./data/utf8_add.sql') ? true : false;
step3($install_error, $install_recover);
break;
case 4:
step4();
break;
case 5:
$sitepath = strtolower(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')));
$sitepath = str_replace('/shop/install', "", $sitepath);
$auto_site_url = strtolower('http://' . $_SERVER['HTTP_HOST'] . $sitepath);
break;
default:
break;
}
function step3(&$install_error, &$install_recover)
{
global $html_title, $html_header, $html_footer;
if ($_POST['submitform'] != 'submit') {
return;
}
示例3: checkConfigFile
// mysql settings ok, go test mysql settings and select database.
checkConfigFile();
header_html(sprintf(__('Step %d'), 2));
step3($_POST["db_host"], $_POST["db_user"], $_POST["db_pass"], $_POST["update"]);
break;
case "Etape_3":
// Create and fill database
checkConfigFile();
header_html(sprintf(__('Step %d'), 3));
if (empty($_POST["databasename"])) {
$_POST["databasename"] = "";
}
if (empty($_POST["newdatabasename"])) {
$_POST["newdatabasename"] = "";
}
step4($_POST["databasename"], $_POST["newdatabasename"]);
break;
case "Etape_4":
// finish installation
header_html(sprintf(__('Step %d'), 4));
step7();
break;
case "update_1":
checkConfigFile();
if (empty($_POST["databasename"])) {
$_POST["databasename"] = "";
}
update1($_POST["databasename"]);
break;
}
}
示例4: stem
/**
* Stems a word. Simple huh?
*
* @param string $word Word to stem
* @return string Stemmed word
*/
function stem($word)
{
if (strlen($word) <= 2) {
return $word;
}
$word = step1ab($word);
$word = step1c($word);
$word = step2($word);
$word = step3($word);
$word = step4($word);
$word = step5($word);
return $word;
}
示例5: header_html
break;
case "Etape_2":
// mysql settings ok, go test mysql settings and select database.
header_html($LANG['install'][77] . " 2");
step3($_POST["db_host"], $_POST["db_user"], $_POST["db_pass"], $_POST["update"]);
break;
case "Etape_3":
// Create and fill database
header_html($LANG['install'][77] . " 3");
if (empty($_POST["databasename"])) {
$_POST["databasename"] = "";
}
if (empty($_POST["newdatabasename"])) {
$_POST["newdatabasename"] = "";
}
step4($_POST["db_host"], $_POST["db_user"], $_POST["db_pass"], $_POST["databasename"], $_POST["newdatabasename"]);
break;
case "Etape_4":
// finish installation
header_html($LANG['install'][77] . " 4");
step7();
break;
case "update_1":
if (empty($_POST["databasename"])) {
$_POST["databasename"] = "";
}
update1($_POST["db_host"], $_POST["db_user"], $_POST["db_pass"], $_POST["databasename"]);
break;
}
}
footer_html();
示例6: setcookie
$template->set_template_file(VIVVO_FS_ROOT . 'installer/templates/frame.xml');
$installer_lang = $sm->get_lang();
if (isset($_POST['installer_lang'])) {
setcookie('installer_lang', $_POST['installer_lang']);
$_COOKIE['installer_lang'] = $_POST['installer_lang'];
}
if (isset($_COOKIE['installer_lang'])) {
$installer_lang->load_lang($_COOKIE['installer_lang'], 'installer/lang/', 'installer');
} else {
$installer_lang->load_lang($_COOKIE['installer_lang'] = 'vietnamese', 'installer/lang/', 'installer');
}
define('VIVVO_INSTALLER_LANG', $_COOKIE['installer_lang']);
$um = $sm->get_url_manager();
$lang = $sm->get_lang();
if ($um->get_param('step') == 2) {
step2($template, $dm, $lang);
} elseif ($um->get_param('step') == 3) {
step3($template, $dm, $lang);
} elseif ($um->get_param('step') == 4) {
step4($template, $dm, $lang);
} elseif ($um->get_param('step') == 5) {
step5($template, $dm, $lang);
} elseif ($um->get_param('step') == 6) {
step6($template, $dm, $lang);
vivvo_cache::get_instance()->delete_all();
} else {
step1($template, $dm, $lang);
}
$template->assign('DUMP_MESSAGES', $dm->_dump_pool);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
echo $sm->get_output();
示例7: step5
function step5()
{
$db = $_REQUEST['db'];
if (!$db['host'] || !$db['user'] || !$db['database']) {
step4('请设置数据库服务器地址,用户和数据库名');
}
$link = @mysql_connect($db['host'], $db['user'], $db['pass']);
if (!$link) {
step4($db['host'] . '连接失败,请确认输入正确的服务器地址,账号和密码');
}
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $link);
if (!$db['cover']) {
$sql = "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME='{$db['database']}'";
$q = mysql_query($sql, $link);
$r = mysql_fetch_array($q);
if ($r) {
step4($db['database'] . '数据库已存在,您可以勾选覆盖数据库');
}
}
$app = file_get_contents(CACHE_DIR . 'app.tmp');
$app = json_decode($app, 1);
$socket = new hgSocket();
$con = $socket->connect($app['ip'], $app['port']);
if (!intval($con)) {
step4('安装无法完成,服务器无法连接,请确认服务器ip是否正确或服务程序hogeMonitor.py是否监听在' . $app['ip'] . ':' . $app['port'] . '上');
}
$socket->close();
$auth = @file_get_contents(CACHE_DIR . 'auth.tmp');
$auth = json_decode($auth, 1);
$db['pass'] = hg_encript_str($db['pass'], true, $auth['appkey']);
file_put_contents(CACHE_DIR . 'db.tmp', json_encode($db));
global $Cfg;
$curl = new curl($Cfg['upgradeServer']['host'] . ':' . $Cfg['upgradeServer']['port'], '', $Cfg['upgradeServer']['token']);
$curl->setClient(CUSTOM_APPID, CUSTOM_APPKEY);
$curl->setSubmitType('get');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('install', 1);
$curl->addRequestData('app', 'livworkbench');
$ret = $curl->request('db.php');
if (!is_array($ret)) {
hg_errorReport('获取数据库结构失败,无法完成安装,请联系软件提供商');
}
$curl->initPostData();
$curl->addRequestData('a', 'checklastversion');
$curl->addRequestData('app', 'livworkbench');
$lastversion = $curl->request('check_version.php');
ob_start();
if (!$db['cover']) {
hg_flushMsg('开始创建数据库 ' . $db['database']);
$sql = 'CREATE DATABASE ' . $db['database'] . ' DEFAULT CHARACTER SET UTF8';
$q = mysql_query($sql, $link);
if (!$q) {
step4($db['database'] . '创建失败, 请确认此账号有权限创建数据库');
continue;
}
hg_flushMsg('数据库 ' . $db['database'] . ' 已创建');
}
mysql_select_db($db['database'], $link);
foreach ($ret as $table => $sql) {
if (substr($table, 0, 4) == 'liv_') {
$table = $db['dbprefix'] . substr($table, 4);
$sql = preg_replace('/CREATE\\s+TABLE\\s+([`]{0,1})liv_/is', 'CREATE TABLE \\1' . $db['dbprefix'], $sql);
}
if (substr($table, 0, 4) == 'm2o_') {
$table = $db['dbprefix'] . substr($table, 4);
$sql = preg_replace('/CREATE\\s+TABLE\\s+([`]{0,1})m2o_/is', 'CREATE TABLE \\1' . $db['dbprefix'], $sql);
}
hg_flushMsg('开始创建数据表 ' . $table);
if ($db['cover']) {
$dropsql = 'DROP table ' . $table;
mysql_query($dropsql, $link);
}
mysql_query($sql, $link);
}
hg_flushMsg('数据库创建完成 ');
$content = get_serv_file($app, $app['dir'] . 'conf/config.php');
$content = preg_replace("/\\\$gGlobalConfig\\s*\\['App_.*'\\]\\s*=\\s*array\\s*(.*?);/is", $appstring, $content);
if ($db) {
$db['pass'] = hg_encript_str($db['pass'], false, $auth['appkey']);
$string = "\$gDBconfig = array(\n'host' => '{$db['host']}',\n'user' => '{$db['user']}',\n'pass' => '{$db['pass']}',\n'database' => '{$db['database']}',\n'charset' => 'utf8',\n'pconncet' => 0,\n);";
$content = preg_replace("/\\\$gDBconfig\\s*=\\s*array\\s*(.*?);/is", $string, $content);
$content = preg_replace("/define\\('DB_PREFIX',\\s*'.*?'\\);/is", "define('DB_PREFIX','{$db['dbprefix']}');", $content);
}
$match = preg_match("/define\\('INITED_APP',\\s*.*?\\s*\\);/is", $content);
if ($match) {
$content = preg_replace("/define\\('INITED_APP',\\s*.*?\\s*\\);/is", "define('INITED_APP', false);", $content);
} else {
$content = preg_replace("/\\?>/is", "\ndefine('INITED_APP', false);\n?>", $content);
}
$content = preg_replace("/define\\('APPID',\\s*'*\\d+'*\\);/is", "", $content);
$content = preg_replace("/define\\('APPKEY',\\s*'.*?'\\);/is", "", $content);
$content = preg_replace("/define\\('CUSTOM_APPID',\\s*\\d+\\);/is", "define('CUSTOM_APPID','{$auth['appid']}');", $content);
$content = preg_replace("/define\\('CUSTOM_APPKEY',\\s*'.*?'\\);/is", "define('CUSTOM_APPKEY','{$auth['appkey']}');", $content);
$content = preg_replace("/define\\('CUSTOM_NAME',\\s*'.*?'\\);/is", "define('CUSTOM_NAME','{$auth['display_name']}');", $content);
$content = preg_replace("/define\\('DEBUG_MODE',\\s*.*?\\);/is", "define('DEBUG_MODE',false);", $content);
$content = preg_replace("/define\\('DEVELOP_MODE',\\s*.*?\\);/is", "define('DEVELOP_MODE',0);", $content);
$match = preg_match("/\\\$gGlobalConfig\\['license'\\]\\s*=\\s*\\'.*\\';/is", $content);
if ($match) {
$content = preg_replace("/\\\$gGlobalConfig\\['license'\\]\\s*=\\s*\\'.*?\\';/is", "\$gGlobalConfig['license'] = '{$auth['domain']}';", $content);
//.........这里部分代码省略.........
示例8: usersMenus
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.squid.inc');
$usersmenus=new usersMenus();
if(!$usersmenus->AsSquidAdministrator){
$tpl=new templates();
$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
echo "alert('$alert');";
die();
}
if(isset($_GET["step0"])){step0();exit;}
if(isset($_GET["step1"])){step1();exit;}
if(isset($_GET["step2"])){step2();exit;}
if(isset($_GET["step3"])){step3();exit;}
if(isset($_GET["step4"])){step4();exit;}
if(isset($_POST["DOMAIN"])){Save();exit;}
if(isset($_POST["LOCALNET"])){Save();exit;}
if(isset($_POST["PROXY"])){Save();exit;}
if(isset($_POST["agree"])){agree();exit;}
start_js();
function start_js(){
header("content-type: application/x-javascript");
$tpl=new templates();
$page=CurrentPageName();