mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Converted comments to phpdoc style
This commit is contained in:
parent
a93ea924a0
commit
b68275d52a
1 changed files with 39 additions and 10 deletions
49
lib/odbc.php
49
lib/odbc.php
|
@ -1,16 +1,45 @@
|
||||||
<?php
|
<?php
|
||||||
//This is the ODBC Socket Server class PHP client class with sample usage
|
|
||||||
// at bottom.
|
|
||||||
// (c) 1999 Team FXML
|
|
||||||
// Released into the public domain for version 0.90 of ODBC Socket Server
|
|
||||||
// http://odbc.linuxbox.com/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* odbc.php - This is the ODBC Socket Server class PHP client class
|
||||||
|
* with sample usage at bottom.
|
||||||
|
*
|
||||||
|
* Released into the public domain for version 0.90 of ODBC Socket Server
|
||||||
|
* {@link http://odbc.linuxbox.com/}
|
||||||
|
* @author Team FXML
|
||||||
|
* @copyright Copyright (c) 1999 Team FXML
|
||||||
|
* @license http://odbc.linuxbox.com/ public domain
|
||||||
|
* @package moodlecore
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ODBC Socket Server class
|
||||||
|
*/
|
||||||
class ODBCSocketServer {
|
class ODBCSocketServer {
|
||||||
var $sHostName; //name of the host to connect to
|
|
||||||
var $nPort; //port to connect to
|
|
||||||
var $sConnectionString; //connection string to use
|
|
||||||
|
|
||||||
//function to parse the SQL
|
/**
|
||||||
|
* Name of the host to connect to
|
||||||
|
* @var string $sHostName
|
||||||
|
*/
|
||||||
|
var $sHostName;
|
||||||
|
/**
|
||||||
|
* Port to connect to
|
||||||
|
* @var int $nPort
|
||||||
|
*/
|
||||||
|
var $nPort;
|
||||||
|
/**
|
||||||
|
* Connection string to use
|
||||||
|
* @var string $sConnectionString
|
||||||
|
*/
|
||||||
|
var $sConnectionString;
|
||||||
|
|
||||||
|
//
|
||||||
|
/**
|
||||||
|
* Function to parse the SQL
|
||||||
|
*
|
||||||
|
* @param string $sSQL The SQL statement to parse
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function ExecSQL($sSQL) {
|
function ExecSQL($sSQL) {
|
||||||
|
|
||||||
$fToOpen = fsockopen($this->sHostName, $this->nPort, &$errno, &$errstr, 30);
|
$fToOpen = fsockopen($this->sHostName, $this->nPort, &$errno, &$errstr, 30);
|
||||||
|
@ -25,7 +54,7 @@ class ODBCSocketServer {
|
||||||
//search and replace HTML chars in SQL first
|
//search and replace HTML chars in SQL first
|
||||||
$sSQL = HTMLSpecialChars($sSQL);
|
$sSQL = HTMLSpecialChars($sSQL);
|
||||||
$sSend = "<?xml version=\"1.0\"?>\r\n<request>\r\n<connectionstring>$this->sConnectionString</connectionstring>\r\n<sql>$sSQL</sql>\r\n</request>\r\n";
|
$sSend = "<?xml version=\"1.0\"?>\r\n<request>\r\n<connectionstring>$this->sConnectionString</connectionstring>\r\n<sql>$sSQL</sql>\r\n</request>\r\n";
|
||||||
//write request
|
//write request
|
||||||
fputs($fToOpen, $sSend);
|
fputs($fToOpen, $sSend);
|
||||||
//now read response
|
//now read response
|
||||||
while (!feof($fToOpen))
|
while (!feof($fToOpen))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue