Changeset: 74ca89377328 for monetdb-php
URL: http://dev.monetdb.org/hg/monetdb-php?cmd=changeset;node=74ca89377328
Modified Files:
        INSTALL
        README
        examples/simple_query.php
        lib/php_monetdb.php
Branch: default
Log Message:

Removed trailing white space.


diffs (truncated from 614 to 300 lines):

diff --git a/INSTALL b/INSTALL
--- a/INSTALL
+++ b/INSTALL
@@ -13,7 +13,7 @@ You can verify wether your interpreter h
 
 and check for the presence of the "--enable-sockets" option.
 
-In order to enable sockets support in your php interpreter; 
+In order to enable sockets support in your php interpreter;
 load the php_sockets.so library from the php.ini configuration file.
 
 
diff --git a/README b/README
--- a/README
+++ b/README
@@ -17,4 +17,4 @@ The php API aims at being compatible wit
 
 A comparison between cimpl and native can be found at: 
http://www.ins.cwi.nl/~gm/bench/
 
-php_test.tar.bz2 - contains an utility to measure the performance of the two 
php APIS. 
+php_test.tar.bz2 - contains an utility to measure the performance of the two 
php APIS.
diff --git a/examples/simple_query.php b/examples/simple_query.php
--- a/examples/simple_query.php
+++ b/examples/simple_query.php
@@ -23,7 +23,7 @@
        {
                $db = monetdb_connect($lang = "sql", $host = "127.0.0.1", $port 
= "50000" , $username = "monetdb", $password = "monetdb", $database = 
"php_demo" )
                or die(monetdb_last_error());
-               
+
                $sql = monetdb_escape_string($_POST['query']);
                $res = monetdb_query($sql);
                while ( $row = monetdb_fetch_assoc($res) )
@@ -32,7 +32,7 @@
                        print_r($row);
                        print "</pre>\n";
                }
-               
+
                monetdb_disconnect();
        }
 
@@ -42,7 +42,7 @@
        value=\"{$_POST['query']}\" />\n";
        print "<input type=\"submit\" value=\"Execute\" />\n";
        print "</form>\n";
-?>     
+?>
 
 </body>
 
diff --git a/lib/php_monetdb.php b/lib/php_monetdb.php
--- a/lib/php_monetdb.php
+++ b/lib/php_monetdb.php
@@ -12,7 +12,7 @@
        * Implementation of the driver API.
        *
        * This library relies on the native PHP mapi implementation.
-       * 
+       *
        * This file should be included by all pages that want to make use of a
        * database connection.
        *
@@ -23,71 +23,26 @@
     * function monetdb_connected() *
        * function monetdb_query($query)  *
        * function monetdb_fetch_assoc($hdl) *
-       * function monetdb_fetch_object($hdl) 
+       * function monetdb_fetch_object($hdl)
        * function monetdb_num_rows($hdl)  *
-       * function monetdb_affected_rows($hdl) * 
+       * function monetdb_affected_rows($hdl) *
        * function monetdb_last_error()  *
        * function monetdb_insert_id($seq)  *
        * function monetdb_quote_ident($str) *
-       * function monetdb_escape_string($str) * 
+       * function monetdb_escape_string($str) *
        **/
 
        /**
        * php_mapi.inc is a native (socket based) php implementation of the 
MAPI communication protocol.
        */
        require 'php_mapi.inc';
-       
+
        /**
        * register a 'monetdb' extension to retain compatibility with wht Cimpl 
based scripts.
        */
-       
-       /**
-        * Opens a connection to a MonetDB server.  
-        * 
-        * @param string language to be used (sql)
-        * @param string hostname to connect to (default is localhost)
-        * @param int    port to use (default is 50000)
-        * @param string username (default is monetdb)
-        * @param string password (default is monetdb)
-        * @param string database to use (default is demo)
-        * @param string hash function to use during authentication (defaults 
to SHA1) 
-        * @return bool TRUE on success or FALSE on failure 
-        */
-       
-       function monetdb_connect($lang = "sql", $host = "127.0.0.1", $port = 
50000, $username = "monetdb", $password = "monetdb", $database = "demo", 
$hashfunc = "") {
-               $options["host"] = $host;
-               $options["port"] = $port;
-
-               $options["username"] = $username;
-               $options["password"] = $password;
-               
-               $options["database"] = $database; 
-               $options["persistent"] = FALSE;
-       
-       
-           if ($hashfunc == "") {
-                   $hashfunc = "sha1";
-           }
-           
-           if ($lang == "") {
-               $lang = "sql";
-           }
-           
-           $options["hashfunc"] = $hashfunc;
-        $options["lang"]     = $lang;
-                               
-               return mapi_connect_proxy($options);
-       }
 
        /**
-        * Opens a persistent connection to a MonetDB server.  
-        * First, when connecting, the function would first try to find a 
(persistent) link that's already open with the same host, 
-        * username and password. If one is found, an identifier for it will be 
returned instead of opening a new connection.
-        *
-        * Second, the connection to the SQL server will not be closed when the 
execution of the script ends. 
-        * Instead, the link will remain open for future use (monetdb_close() 
will not close links established by monetdb_pconnect()).
-        *
-        * This type of link is therefore called 'persistent'. 
+        * Opens a connection to a MonetDB server.
         *
         * @param string language to be used (sql)
         * @param string hostname to connect to (default is localhost)
@@ -96,9 +51,54 @@
         * @param string password (default is monetdb)
         * @param string database to use (default is demo)
         * @param string hash function to use during authentication (defaults 
to SHA1)
-        * @return bool TRUE on success or FALSE on failure 
+        * @return bool TRUE on success or FALSE on failure
         */
-       
+
+       function monetdb_connect($lang = "sql", $host = "127.0.0.1", $port = 
50000, $username = "monetdb", $password = "monetdb", $database = "demo", 
$hashfunc = "") {
+               $options["host"] = $host;
+               $options["port"] = $port;
+
+               $options["username"] = $username;
+               $options["password"] = $password;
+
+               $options["database"] = $database;
+               $options["persistent"] = FALSE;
+
+
+           if ($hashfunc == "") {
+                   $hashfunc = "sha1";
+           }
+
+           if ($lang == "") {
+               $lang = "sql";
+           }
+
+           $options["hashfunc"] = $hashfunc;
+        $options["lang"]     = $lang;
+
+               return mapi_connect_proxy($options);
+       }
+
+       /**
+        * Opens a persistent connection to a MonetDB server.
+        * First, when connecting, the function would first try to find a 
(persistent) link that's already open with the same host,
+        * username and password. If one is found, an identifier for it will be 
returned instead of opening a new connection.
+        *
+        * Second, the connection to the SQL server will not be closed when the 
execution of the script ends.
+        * Instead, the link will remain open for future use (monetdb_close() 
will not close links established by monetdb_pconnect()).
+        *
+        * This type of link is therefore called 'persistent'.
+        *
+        * @param string language to be used (sql)
+        * @param string hostname to connect to (default is localhost)
+        * @param int    port to use (default is 50000)
+        * @param string username (default is monetdb)
+        * @param string password (default is monetdb)
+        * @param string database to use (default is demo)
+        * @param string hash function to use during authentication (defaults 
to SHA1)
+        * @return bool TRUE on success or FALSE on failure
+        */
+
   function monetdb_pconnect($lang = "sql", $host = "127.0.0.1", $port = 
500000, $username = "monetdb", $password = "monetdb", $database = "demo", 
$hashfunc = "") {
 
                $options["host"] = $host;
@@ -106,22 +106,22 @@
 
                $options["username"] = $username;
                $options["password"] = $password;
-               $options["database"] = $database; 
+               $options["database"] = $database;
                $options["persistent"] = TRUE;
-               
+
                if ($hashfunc == "") {
                    $hashfunc = "sha1";
            }
-           
+
            if ($lang == "") {
                $lang = "sql";
                } else if (strstr($lang, "sql") == $lang) {
                        $lang = "sql";
                }
-           
+
            $options["hashfunc"] = $hashfunc;
         $options["lang"]     = $lang;
-               
+
                return mapi_connect_proxy($options);
        }
 
@@ -132,7 +132,7 @@
         */
        function monetdb_disconnect($conn=NULL) {
                $num_args = func_num_args();
-               
+
                if ($num_args == 0) {
                        $conn = mapi_get_current_conn();
                        mapi_close(NULL);
@@ -140,7 +140,7 @@
                        mapi_close($conn);
                }
        }
-       
+
        /**
         * Returns whether a connection to the database has been made, and has
         * not been closed yet.  Note that this function doesn't guarantee that
@@ -152,14 +152,14 @@
         */
        function monetdb_connected($connection=NULL) {
                $num_args = func_num_args();
-               
+
                if ($num_args == 0){
                        return mapi_connected(mapi_get_current_conn());
                }
-               
+
                return mapi_connected($connection);
        }
-       
+
        /**
         * Executes the given query on the database.
         *
@@ -169,23 +169,23 @@
         */
        function monetdb_query($connection=NULL, $query="") {
                $num_args = func_num_args();
-               
+
                if ($num_args == 1){
                        $arg = func_get_arg(0);
                        if (is_string($arg)) {
                                $conn = mapi_get_current_conn();
                                if ($conn != NULL) {
                                        return mapi_execute($conn, $arg);
-                               } 
+                               }
                        }
-                       
+
                } else {
                        return mapi_execute($connection, $query);
                }
-               
+
                return FALSE;
        }
-       
+
        /**
         * Returns the number of rows in the query result.
         *
@@ -205,7 +205,7 @@
         *
         * @param resouce the query resource
         * @return int the number of fields in the result; FALSE if the query 
did not return any result set
-        */     
+        */
        function monetdb_num_fields($hdl) {
        if ($hdl["operation"] == Q_TABLE || $hdl["operation"] == Q_BLOCK ) {
                        return $hdl["query"]["fields"];
@@ -213,28 +213,28 @@
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to