]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/DB/mssql.php
Merge branch 'doc-backup-restore-def-vals' into 'nightly'
[quix0rs-gnu-social.git] / extlib / DB / mssql.php
index 1aad756712d6163806843c9921fe1bc7c24014d5..d68ebfa61ef51fd8bc9e173d9b4b5d3a3b15434a 100644 (file)
@@ -6,7 +6,7 @@
  * The PEAR DB driver for PHP's mssql extension
  * for interacting with Microsoft SQL Server databases
  *
- * PHP versions 4 and 5
+ * PHP version 5
  *
  * LICENSE: This source file is subject to version 3.0 of the PHP license
  * that is available through the world-wide-web at the following URI:
@@ -20,7 +20,7 @@
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: mssql.php,v 1.92 2007/09/21 13:40:41 aharvey Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/DB
  */
 
@@ -49,7 +49,7 @@ require_once 'DB/common.php';
  * @author     Daniel Convissor <danielc@php.net>
  * @copyright  1997-2007 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    Release: 1.7.14RC1
+ * @version    Release: 1.9.2
  * @link       http://pear.php.net/package/DB
  */
 class DB_mssql extends DB_common
@@ -156,7 +156,7 @@ class DB_mssql extends DB_common
     /**
      * The quantity of transactions begun
      *
-     * {@internal  While this is private, it cannot actually be designated
+     * {@internal  While this is private, it can't actually be designated
      * private in PHP 5 because it is directly accessed in the test suite.}}
      *
      * @var integer
@@ -179,13 +179,13 @@ class DB_mssql extends DB_common
     // {{{ constructor
 
     /**
-     * This constructor calls <kbd>$this->DB_common()</kbd>
+     * This constructor calls <kbd>parent::__construct()</kbd>
      *
      * @return void
      */
-    function DB_mssql()
+    function __construct()
     {
-        $this->DB_common();
+        parent::__construct();
     }
 
     // }}}
@@ -324,7 +324,7 @@ class DB_mssql extends DB_common
      * See DB_result::fetchInto() for more information.
      *
      * This method is not meant to be called directly.  Use
-     * DB_result::fetchInto() instead.  It cannot be declared "protected"
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
      * because DB_result is a separate object.
      *
      * @param resource $result    the query result resource
@@ -371,7 +371,7 @@ class DB_mssql extends DB_common
      * Deletes the result set and frees the memory occupied by the result set
      *
      * This method is not meant to be called directly.  Use
-     * DB_result::free() instead.  It cannot be declared "protected"
+     * DB_result::free() instead.  It can't be declared "protected"
      * because DB_result is a separate object.
      *
      * @param resource $result  PHP's query result resource
@@ -392,7 +392,7 @@ class DB_mssql extends DB_common
      * Gets the number of columns in a result set
      *
      * This method is not meant to be called directly.  Use
-     * DB_result::numCols() instead.  It cannot be declared "protected"
+     * DB_result::numCols() instead.  It can't be declared "protected"
      * because DB_result is a separate object.
      *
      * @param resource $result  PHP's query result resource
@@ -417,7 +417,7 @@ class DB_mssql extends DB_common
      * Gets the number of rows in a result set
      *
      * This method is not meant to be called directly.  Use
-     * DB_result::numRows() instead.  It cannot be declared "protected"
+     * DB_result::numRows() instead.  It can't be declared "protected"
      * because DB_result is a separate object.
      *
      * @param resource $result  PHP's query result resource
@@ -623,6 +623,27 @@ class DB_mssql extends DB_common
         return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
     }
 
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string in a manner suitable for SQL Server.
+     *
+     * @param string $str  the string to be escaped
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return str_replace(
+            array("'", "\\\r\n", "\\\n"),
+            array("''", "\\\\\r\n\r\n", "\\\\\n\n"),
+            $str
+        );
+    }
+
     // }}}
     // {{{ quoteIdentifier()