• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP init_database函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP init_db函数代码示例发布时间:2022-05-15
下一篇:
PHP init_connection函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap