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


PHP PMF_Db::dbSelect方法代码示例

本文整理汇总了PHP中PMF_Db::dbSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Db::dbSelect方法的具体用法?PHP PMF_Db::dbSelect怎么用?PHP PMF_Db::dbSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMF_Db的用法示例。


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

示例1: HTMLFooter

}
if (!is_readable(PMF_ROOT_DIR . '/inc/data.php') && !is_readable(PMF_ROOT_DIR . '/config/database.php')) {
    print '<p class="center">It seems you never run a version of phpMyFAQ.<br />' . 'Please use the <a href="setup.php">install script</a>.</p>';
    HTMLFooter();
    die;
}
if (file_exists(PMF_ROOT_DIR . '/inc/data.php')) {
    // before 2.6.0-alpha
    require PMF_ROOT_DIR . '/inc/data.php';
} else {
    // after 2.6.0-alpha
    require PMF_ROOT_DIR . '/config/database.php';
}
require PMF_ROOT_DIR . '/inc/functions.php';
define('SQLPREFIX', $DB['prefix']);
$db = PMF_Db::dbSelect($DB["type"]);
$db->connect($DB["server"], $DB["user"], $DB["password"], $DB["db"]);
/**************************** STEP 1 OF 4 ***************************/
if ($step == 1) {
    $faqconfig = PMF_Configuration::getInstance();
    $version = $faqconfig->get('main.currentVersion');
    ?>
<form action="update.php?step=2" method="post">
<fieldset class="installation">
<legend class="installation"><strong>phpMyFAQ <?php 
    print NEWVERSION;
    ?>
 Update (Step 1 of 4)</strong></legend>
<p>This update will work <strong>only</strong> for the following versions:</p>
<ul type="square">
    <li>phpMyFAQ 2.0.x</li>
开发者ID:rybal06,项目名称:phpMyFAQ,代码行数:31,代码来源:update.php

示例2: define

define('PMF_CONFIG_DIR', dirname(dirname(__FILE__)) . '/config');
require PMF_CONFIG_DIR . '/database.php';
require PMF_CONFIG_DIR . '/constants.php';
require PMF_INCLUDE_DIR . '/functions.php';
// TODO: Linkverifier.php contains both PMF_Linkverifier class and
//       helper functions => move the fns into the class.
require_once PMF_INCLUDE_DIR . '/Linkverifier.php';
//
// Set the error handler to our pmf_error_handler() function
//
set_error_handler('pmf_error_handler');
//
// Create a database connection
//
define('SQLPREFIX', $DB['prefix']);
$db = PMF_Db::dbSelect($DB['type']);
$db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
//
// Fetch the configuration
//
$faqconfig = PMF_Configuration::getInstance();
$faqconfig->getAll();
//
// We always need a valid session!
//
// Avoid any PHP version to move sessions on URLs
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
//
// Connect to LDAP server, when LDAP support is enabled
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:31,代码来源:Init.php

示例3: file_put_contents

     die;
 }
 // check LDAP if available
 if (extension_loaded('ldap') && !is_null($ldap_enabled)) {
     $datafile = PMF_ROOT_DIR . '/config/ldap.php';
     $ret = file_put_contents($datafile, "<?php\n\$PMF_LDAP[\"ldap_server\"] = '" . $ldap_server . "';\n\$PMF_LDAP[\"ldap_port\"] = '" . $ldap_port . "';\n\$PMF_LDAP[\"ldap_user\"] = '" . $ldap_user . "';\n\$PMF_LDAP[\"ldap_password\"] = '" . $ldap_password . "';\n\$PMF_LDAP[\"ldap_base\"] = '" . $ldap_base . "';", LOCK_EX);
     if (!$ret) {
         print "<p class=\"error\"><strong>Error:</strong> Cannot write to dataldap.php.</p>";
         HTMLFooter();
         cleanInstallation();
         die;
     }
 }
 // connect to the database using inc/data.php
 require PMF_ROOT_DIR . '/config/database.php';
 $db = PMF_Db::dbSelect($sql_type);
 $db->connect($DB['server'], $DB['user'], $DB['password'], $DB['db']);
 if (!$db) {
     print "<p class=\"error\"><strong>DB Error:</strong> " . $db->error() . "</p>\n";
     HTMLFooter();
     cleanInstallation();
     die;
 }
 require_once $sql_type . '.sql.php';
 // CREATE TABLES
 require_once 'config.sql.php';
 // INSERTs for configiration
 require_once 'stopwords.sql.php';
 // INSERTs for stopwords
 print "<p class=\"center\">";
 @ob_flush();
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:setup.php


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