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


PHP init_database函数代码示例

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


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

示例1: patch_database

function patch_database()
{
    // sanity check. check that the version table exists.
    global $dbconfig, $db;
    $has_table = $db->getOne("SHOW TABLES LIKE '{$dbconfig['table_prefix']}version'");
    if (!$has_table) {
        init_database();
    }
    $last_patch = $db->getOne('SELECT ver_version FROM {{%version}}');
    if (!isset($last_patch)) {
        // insert initial value
        $db->query('INSERT INTO {{%version}} SET ver_version=0');
        $last_patch = 0;
    }
    $files = read_patches(__DIR__ . '/patches');
    $addCount = 0;
    foreach ($files as $number => $file) {
        if ($number > $last_patch) {
            echo '* Applying patch: ', $number, ' (', basename($file), ")\n";
            exec_sql_file($file);
            $db->query("UPDATE {{%version}} SET ver_version={$number}");
            $addCount++;
        }
    }
    $version = max(array_keys($files));
    if ($addCount == 0) {
        echo "* Your database is already up-to-date. Version {$version}\n";
    } else {
        echo "* Your database is now up-to-date. Updated from {$last_patch} to {$version}\n";
    }
}
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:update-database.php

示例2: die

 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
//
// This is the main admin UI script
//
// You can add applications by adding their respective bundle identifiers
// and you can delete applications and define if external symbolification
// should be turned on or not
//
require_once '../config.php';
require_once 'common.inc';
if ($acceptallapps) {
    die('<html><head><META http-equiv="refresh" content="0;URL=app_versions.php"></head><body></body></html>');
}
init_database();
parse_parameters(',bundleidentifier,symbolicate,id,name,issuetrackerurl,hockeyappidentifier,pushids,emails,');
if (!isset($bundleidentifier)) {
    $bundleidentifier = "";
}
if (!isset($symbolicate)) {
    $symbolicate = "";
}
if (!isset($id)) {
    $id = "";
}
if (!isset($name)) {
    $name = "";
}
if (!isset($issuetrackerurl)) {
    $issuetrackerurl = "";
开发者ID:Feng-xp,项目名称:QuincyKit,代码行数:31,代码来源:app_name.php

示例3: init_database

<?php

/* **************************************************
/  REST Webservice fuer Vereins Mitglieder Datenbank
/  created by Andreas Baierl, 09.02.2010
/  
/
/  orte.php -	get Listenressource: GET ".../strassen" (alle Strassen)
/					get Ressourcendetails: GET ".../strassen/1" (Details von Strasse 1)
/					create Ressource: POST ".../routen"
/
/* *************************************************/
require_once "includes.php";
$database = init_database();
$param = null;
if (isset($_GET['type'])) {
    $type = $_GET['type'];
}
// Check for the path elements
$path = $_SERVER[PATH_INFO];
if ($path != null) {
    $path_params = spliti("/", $path);
}
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    // GET Request
    set_headers($type);
    if ($path_params[1] != null) {
        render_result(get_ort($path_params[1]), "orte", $type);
        // Ressourcendarstellung
    } else {
        render_result(get_orte(), "orte", $type);
开发者ID:rellla,项目名称:djkservice,代码行数:31,代码来源:orte.php

示例4: Hotaru

require_once 'install_tables.php';
require_once 'install_functions.php';
require_once BASE . 'Hotaru.php';
require_once EXTENSIONS . 'csrf/csrf_class.php';
// protection against CSRF attacks
require_once EXTENSIONS . 'Inspekt/Inspekt.php';
// sanitation
require_once EXTENSIONS . 'ezSQL/ez_sql_core.php';
// database
require_once EXTENSIONS . 'ezSQL/mysql/ez_sql_mysql.php';
// database
$h = new Hotaru('install');
// must come before language inclusion
require_once INSTALL . 'install_language.php';
// language file for install
$db = init_database();
$cage = init_inspekt_cage();
$step = $cage->get->getInt('step');
// Installation steps.
switch ($step) {
    case 1:
        installation_welcome();
        // "Welcome to Hotaru CMS.
        break;
    case 2:
        database_setup();
        // DB name, user, password, prefix...
        break;
    case 3:
        database_creation();
        // Creates the database tables
开发者ID:shibuya246,项目名称:Hotaru-Plugins,代码行数:31,代码来源:install.php


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