本文整理汇总了PHP中Update::u0003方法的典型用法代码示例。如果您正苦于以下问题:PHP Update::u0003方法的具体用法?PHP Update::u0003怎么用?PHP Update::u0003使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Update
的用法示例。
在下文中一共展示了Update::u0003方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_controller
function admin_controller()
{
global $mysqli, $session, $route, $updatelogin;
// Allow for special admin session if updatelogin property is set to true in settings.php
// Its important to use this with care and set updatelogin to false or remove from settings
// after the update is complete.
if ($updatelogin || $session['admin']) {
$sessionadmin = true;
}
// if ($session['userid']==4) $sessionadmin = true;
if ($sessionadmin) {
if ($route->action == 'view') {
$result = view("Modules/admin/admin_main_view.php", array());
}
if ($route->action == 'db') {
$applychanges = get('apply');
if (!$applychanges) {
$applychanges = false;
} else {
$applychanges = true;
}
require "Modules/admin/update_class.php";
require_once "Lib/dbschemasetup.php";
$update = new Update($mysqli);
$updates = array();
$updates[] = array('title' => "Database schema", 'description' => "", 'operations' => db_schema_setup($mysqli, load_db_schema(), $applychanges));
if (!$updates[0]['operations']) {
// In future versions we could check against db version number as to what updates should be applied
$updates[] = $update->u0001($applychanges);
//$updates[] = $update->u0002($applychanges);
$updates[] = $update->u0003($applychanges);
$updates[] = $update->u0004($applychanges);
}
$result = view("Modules/admin/update_view.php", array('applychanges' => $applychanges, 'updates' => $updates));
}
if ($route->action == 'users' && $session['write'] && $session['admin']) {
$result = view("Modules/admin/userlist_view.php", array());
}
if ($route->action == 'userlist' && $session['write'] && $session['admin']) {
$data = array();
$result = $mysqli->query("SELECT id,username,email FROM users");
while ($row = $result->fetch_object()) {
$data[] = $row;
}
$result = $data;
}
if ($route->action == 'setuser' && $session['write'] && $session['admin']) {
$_SESSION['userid'] = intval(get('id'));
header("Location: ../user/view");
}
}
return array('content' => $result);
}