本文整理汇总了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();