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


PHP init_connection函数代码示例

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


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

示例1: init_connection

function init_connection($glob)
{
    $glob['fd'] = xfsockopen($glob['host'], $glob['port']);
    if ($glob['fd']) {
        aff_client("FD-SOCKET OK");
    } else {
        aff_error_connect("Connection rate");
        init_connection($glob);
    }
    return $glob;
}
开发者ID:nott0ny,项目名称:zappy2010,代码行数:11,代码来源:client.php

示例2: time

     $ctimes[$pid] = time();
 } else {
     pcntl_signal(SIGCHLD, SIG_IGN);
     pcntl_signal(SIGINT, 'task_sigint_handler');
     register_shutdown_function('task_shutdown');
     $my_pid = posix_getpid();
     $lock_filename = "update_daemon-{$my_pid}.lock";
     $lock_handle = make_lockfile($lock_filename);
     if (!$lock_handle) {
         die("error: Can't create lockfile ({$lock_filename}). " . "Maybe another daemon is already running.\n");
     }
     // ****** Updating RSS code *******
     // Only run in fork process.
     $start_timestamp = time();
     $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
     if (!init_connection($link)) {
         return;
     }
     // We disable stamp file, since it is of no use in a multiprocess update.
     // not really, tho for the time being -fox
     if (!make_stampfile('update_daemon.stamp')) {
         print "warning: unable to create stampfile";
     }
     // Call to the feed batch update function
     // or regenerate feedbrowser cache
     if (rand(0, 100) > 30) {
         update_daemon_common($link);
     } else {
         $count = update_feedbrowser_cache($link);
         _debug("Feedbrowser updated, {$count} feeds processed.");
         purge_orphans($link, true);
开发者ID:rolfkleef,项目名称:Tiny-Tiny-RSS,代码行数:31,代码来源:update_daemon2.php

示例3: error_reporting

<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE);
header('Content-Type: text/html; charset=utf-8');
define('MOBILE_VERSION', true);
require_once "../config.php";
require_once "functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
init_connection($link);
login_sequence($link, true);
$feed_id = db_escape_string($_REQUEST["id"]);
$cat_id = db_escape_string($_REQUEST["cat"]);
$offset = (int) db_escape_string($_REQUEST["skip"]);
$search = db_escape_string($_REQUEST["search"]);
$is_cat = (bool) db_escape_string($_REQUEST["is_cat"]);
render_headlines_list($link, $feed_id, $cat_id, $offset, $search, $is_cat);
?>

开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:21,代码来源:feed.php

示例4: init_connection

if ($api_tiki == 'pdo' && extension_loaded("pdo") && in_array('mysql', PDO::getAvailableDrivers())) {
    $dbInitializer = 'db/tiki-db-pdo.php';
}
require $dbInitializer;
init_connection(TikiDb::get());
if (isset($shadow_host, $shadow_user, $shadow_pass, $shadow_dbs)) {
    global $dbMaster, $dbSlave;
    // Set-up the replication
    $dbMaster = TikiDb::get();
    $host_tiki = $shadow_host;
    $user_tiki = $shadow_user;
    $pass_tiki = $shadow_pass;
    $dbs_tiki = $shadow_dbs;
    require $dbInitializer;
    $dbSlave = TikiDb::get();
    init_connection($dbSlave);
    require_once 'lib/core/TikiDb/MasterSlaveDispatch.php';
    $db = new TikiDb_MasterSlaveDispatch($dbMaster, $dbSlave);
    TikiDb::set($db);
}
unset($host_map, $db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $shadow_user, $shadow_pass, $shadow_host, $shadow_dbs);
function init_connection($db)
{
    global $db_table_prefix, $common_users_table_prefix, $db_tiki;
    $db->setServerType($db_tiki);
    $db->setErrorHandler(new TikiDb_LegacyErrorHandler());
    if (isset($db_table_prefix)) {
        $db->setTablePrefix($db_table_prefix);
    }
    if (isset($common_users_table_prefix)) {
        $db->setUsersTablePrefix($common_users_table_prefix);
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-db.php


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