本文整理匯總了PHP中connect::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP connect::getInstance方法的具體用法?PHP connect::getInstance怎麽用?PHP connect::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connect
的用法示例。
在下文中一共展示了connect::getInstance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProductById
function getProductById($id)
{
$db = new connect();
$select = "select * from products where ProductID={$id}";
$result = $db->getInstance($select);
return $result;
}
示例2: setConexion
private function setConexion()
{
$conf = connect::getInstance();
$this->servidor = $conf->getHostDB();
$this->base_datos = $conf->getDB();
$this->usuario = $conf->getUserDB();
$this->password = $conf->getPassDB();
}
示例3: HttpServer
$transport = new HttpServer('application/json');
if ($logger) {
$transport->setLogger($logger);
}
$encoder = new JsonRpc20Encoder();
if ($logger) {
$encoder->setLogger($logger);
}
if ($settings->isEncryptionEnabled()) {
$encoder = new RsaEncoder($encoder, $settings->getRsaRemotePublicKey(), $settings->getRsaLocalPrivateKey());
}
$server = new Server($transport, $encoder, $endpoint);
try {
$server->handle();
} catch (Exception $e) {
if ($logger && $logger->isHandling(Logger::ERROR)) {
$logger->addError($e->getMessage());
}
ob_start();
while (ob_end_clean()) {
}
header('HTTP/1.0 500 Internal Server Error');
header("Status: 500 Internal Server Error");
header('Content-Type: text/plain; charset=utf-8');
echo '500 Internal Server Error';
}
exit;
}
}
connect::getInstance()->run();