예제 #1
0
 function getProductById($id)
 {
     $db = new connect();
     $select = "select * from products where ProductID={$id}";
     $result = $db->getInstance($select);
     return $result;
 }
예제 #2
0
파일: bd.php 프로젝트: Champiiy/Servicio
 private function setConexion()
 {
     $conf = connect::getInstance();
     $this->servidor = $conf->getHostDB();
     $this->base_datos = $conf->getDB();
     $this->usuario = $conf->getUserDB();
     $this->password = $conf->getPassDB();
 }
예제 #3
0
        $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();