本文整理汇总了PHP中DBConnection::disconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::disconnect方法的具体用法?PHP DBConnection::disconnect怎么用?PHP DBConnection::disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection::disconnect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInitCustomDBConnection
/**
* @covers DBConnection::DBConnection
* @covers DBConnection::initCustomDBConnection
* @covers DBConnection::initConn
*/
public function testInitCustomDBConnection()
{
$this->setTestConfiguration(self::CONFIG_PGSQL);
$conn = new DBConnection('sqlite', 'localhost', 'ojs', 'ojs', 'ojs', true, false, false);
$dbConn = $conn->getDBConn();
self::assertType('ADODB_sqlite', $dbConn);
$conn->disconnect();
unset($conn);
}
示例2: close_db_connection
public static function close_db_connection()
{
if (self::$db_connection != null) {
self::$db_connection->disconnect();
}
}
示例3: sizeof
$N = $sent[0];
$K = $sent[1];
$command = '/usr/bin/python /var/www/html/toyapp/toyapp-python/toyapp.py encrypt ' . $file_name . ' ' . $N . ' ' . $K;
echo $command;
//echo '<br />'.$command;
//echo '<br />';
#$result = #exec($command);#
$result = json_decode(exec($command, $status), true);
$size = sizeof($result);
//print_r($result);
$i = 0;
require_once '../includes/shareholdersapi.inc';
$shareholders = get_shareholders($sent[2]);
//print_r($shareholders);
require_once '../includes/DB_Abstraction.inc';
$db_con = new DBConnection();
$db_con->connect();
foreach ($result as $pair) {
$uid = $shareholders[$i]['uid'];
$db_con->insert('secrets', 'fid,uid,secret', "{$sent['2']},'{$uid}','[{$pair['0']},{$pair['1']}]'");
$i++;
echo "<br />Secret {$i}: <input type='text' readonly='readonly' value='[{$pair['0']},{$pair['1']}]'/>";
}
//print_r($result);//. ' <br />';
$db_con->update('file', "url='\\/toyapp\\/repo\\/{$fn}.enc',status=2", "fid={$sent['2']}");
$db_con->disconnect();
//unlink($file_name);
}
?>
</body>
</html>
示例4: reconstruct
array_push($shares, $_POST['1']);
}
if (!empty($_POST['2'])) {
array_push($shares, $_POST['2']);
}
if (!empty($_POST['3'])) {
array_push($shares, $_POST['3']);
}
//var_dump($shares);
$reconstructed_secret = reconstruct($shares);
$db = new DBConnection();
$db->connect();
$user = get_user_info();
$secret = $db->query('secret', 'secret', "uid='{$user}'", null, null, null)[0]['secret'];
$db->delete('secret', "uid='{$user}'");
$db->disconnect();
if ($secret == $reconstructed_secret) {
echo "Secrets matching. Access granted.";
} else {
echo "{$secret} != {$reconstructed_secret}. Access denied";
}
} else {
echo "fail";
}
} else {
echo "fail";
}
/* [1,8683146895150534502] [2,17361141234745553751] [3,7143385603424603993]
* Secret 5152555555515253
*
*/
示例5: usage
*/
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionCF{$language_name_no_space}Plugin.html\">Babel Orion Cloud Foundry Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionEditor{$language_name_no_space}Plugin.html\">Babel Orion Editor Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionGit{$language_name_no_space}Plugin.html\">Babel Orion Git Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionHelp{$language_name_no_space}Plugin.html\">Babel Orion Help Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionJavaScript{$language_name_no_space}Plugin.html\">Babel Orion JavaScript Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionUi{$language_name_no_space}Plugin.html\">Babel Orion UI Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionUsers{$language_name_no_space}Plugin.html\">Babel Orion Users Language Pack Plugin</a></li>";
$language_pack_links_file_buffer .= "\n\t\t<li><a href=\"<?= \$language_pack_leader ?>/{$each_language_pack_dir}BabelOrionWebtools{$language_name_no_space}Plugin.html\">Babel Orion Webtools Language Pack Plugin</a></li>";
}
/* End: foreach project */
echo "{$leader}Completed language pack for: {$language_name} ({$language_iso})\n";
$language_pack_links_file_buffer .= "\n\t</ul>";
}
/* End: $project_pct_complete > 0 */
}
fwrite($language_pack_links_file, "\n\t</p>");
fwrite($language_pack_links_file, $language_pack_links_file_buffer);
fwrite($language_pack_links_file, "\n\t<br />\n</body>\n</html>");
fclose($language_pack_links_file);
$dbh = $dbc->disconnect();
echo "Completed language packs for: {$train_id}\n";
}
function usage()
{
echo "\n";
echo "generate_orion.php -b <build_id> [-t <train_id>]\n";
echo " -b <build_id>: The Build ID for this build\n";
echo " -t <train_id>: Optional: train to build (luna, kepler)";
echo "\n";
}