Remove unused files.
authorsoranzo <soranzo>
Thu, 11 Jan 2007 01:15:55 +0000 (01:15 +0000)
committersoranzo <soranzo>
Thu, 11 Jan 2007 01:15:55 +0000 (01:15 +0000)
libraries/adodb/adodb-errorhandler.inc.php [deleted file]
libraries/adodb/adodb-errorpear.inc.php [deleted file]
libraries/adodb/adodb-exceptions.inc.php [deleted file]
libraries/adodb/adodb-pager.inc.php [deleted file]
libraries/adodb/adodb-pear.inc.php [deleted file]
libraries/adodb/adodb-xmlschema.inc.php [deleted file]
libraries/adodb/pivottable.inc.php [deleted file]
libraries/adodb/rsfilter.inc.php [deleted file]
libraries/adodb/xmlschema.dtd [deleted file]

diff --git a/libraries/adodb/adodb-errorhandler.inc.php b/libraries/adodb/adodb-errorhandler.inc.php
deleted file mode 100755 (executable)
index a6f92d5..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php\r
-/**\r
- * @version V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license.\r
- * Whenever there is any discrepancy between the two licenses,\r
- * the BSD license will take precedence.\r
- *\r
- * Set tabs to 4 for best viewing.\r
- *\r
- * Latest version is available at http://php.weblogs.com\r
- *\r
-*/\r
-\r
-\r
-// added Claudio Bustos  clbustos#entelchile.net\r
-if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR); \r
-\r
-if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_Handler');\r
-\r
-/**\r
-* Default Error Handler. This will be called with the following params\r
-*\r
-* @param $dbms         the RDBMS you are connecting to\r
-* @param $fn           the name of the calling function (in uppercase)\r
-* @param $errno                the native error number from the database\r
-* @param $errmsg       the native error msg from the database\r
-* @param $p1           $fn specific parameter - see below\r
-* @param $p2           $fn specific parameter - see below\r
-* @param $thisConn     $current connection object - can be false if no connection object created\r
-*/\r
-function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection)\r
-{\r
-       if (error_reporting() == 0) return; // obey @ protocol\r
-       switch($fn) {\r
-       case 'EXECUTE':\r
-               $sql = $p1;\r
-               $inputparams = $p2;\r
-\r
-               $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n";\r
-               break;\r
-\r
-       case 'PCONNECT':\r
-       case 'CONNECT':\r
-               $host = $p1;\r
-               $database = $p2;\r
-\r
-               $s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n";\r
-               break;\r
-       default:\r
-               $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";\r
-               break;\r
-       }\r
-       /*\r
-       * Log connection error somewhere\r
-       *       0 message is sent to PHP's system logger, using the Operating System's system\r
-       *               logging mechanism or a file, depending on what the error_log configuration\r
-       *               directive is set to.\r
-       *       1 message is sent by email to the address in the destination parameter.\r
-       *               This is the only message type where the fourth parameter, extra_headers is used.\r
-       *               This message type uses the same internal function as mail() does.\r
-       *       2 message is sent through the PHP debugging connection.\r
-       *               This option is only available if remote debugging has been enabled.\r
-       *               In this case, the destination parameter specifies the host name or IP address\r
-       *               and optionally, port number, of the socket receiving the debug information.\r
-       *       3 message is appended to the file destination\r
-       */\r
-       if (defined('ADODB_ERROR_LOG_TYPE')) {\r
-               $t = date('Y-m-d H:i:s');\r
-               if (defined('ADODB_ERROR_LOG_DEST'))\r
-                       error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);\r
-               else\r
-                       error_log("($t) $s", ADODB_ERROR_LOG_TYPE);\r
-       }\r
-\r
-\r
-       //print "<p>$s</p>";\r
-       trigger_error($s,ADODB_ERROR_HANDLER_TYPE); \r
-}\r
-?>\r
diff --git a/libraries/adodb/adodb-errorpear.inc.php b/libraries/adodb/adodb-errorpear.inc.php
deleted file mode 100755 (executable)
index 011e9a6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php\r
-/** \r
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license. \r
-  Whenever there is any discrepancy between the two licenses, \r
-  the BSD license will take precedence. \r
- *\r
- * Set tabs to 4 for best viewing.\r
- * \r
- * Latest version is available at http://php.weblogs.com\r
- * \r
-*/\r
-include_once('PEAR.php');\r
-\r
-if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR');\r
-\r
-/*\r
-* Enabled the following if you want to terminate scripts when an error occurs\r
-*/\r
-//PEAR::setErrorHandling (PEAR_ERROR_DIE);\r
-\r
-/*\r
-* Name of the PEAR_Error derived class to call.\r
-*/\r
-if (!defined('ADODB_PEAR_ERROR_CLASS')) define('ADODB_PEAR_ERROR_CLASS','PEAR_Error');\r
-\r
-/*\r
-* Store the last PEAR_Error object here\r
-*/\r
-global $ADODB_Last_PEAR_Error; $ADODB_Last_PEAR_Error = false;\r
-\r
-  /**\r
-* Error Handler with PEAR support. This will be called with the following params\r
-*\r
-* @param $dbms         the RDBMS you are connecting to\r
-* @param $fn           the name of the calling function (in uppercase)\r
-* @param $errno                the native error number from the database \r
-* @param $errmsg       the native error msg from the database\r
-* @param $p1           $fn specific parameter - see below\r
-* @param $P2           $fn specific parameter - see below\r
-       */\r
-function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)\r
-{\r
-global $ADODB_Last_PEAR_Error;\r
-       \r
-       if (error_reporting() == 0) return; // obey @ protocol\r
-       switch($fn) {\r
-       case 'EXECUTE':\r
-               $sql = $p1;\r
-               $inputparams = $p2;\r
-               \r
-               $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")";\r
-               break;\r
-               \r
-       case 'PCONNECT':\r
-       case 'CONNECT':\r
-               $host = $p1;\r
-               $database = $p2;\r
-               \r
-               $s = "$dbms error: [$errno: $errmsg] in $fn('$host', ?, ?, '$database')";\r
-               break;\r
-               \r
-       default:\r
-               $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";\r
-               break;\r
-       }\r
-       \r
-       $class = ADODB_PEAR_ERROR_CLASS;\r
-       $ADODB_Last_PEAR_Error = new $class($s, $errno,\r
-               $GLOBALS['_PEAR_default_error_mode'],\r
-               $GLOBALS['_PEAR_default_error_options'], \r
-               $errmsg);\r
-               \r
-       //print "<p>!$s</p>";\r
-}\r
-\r
-/**\r
-* Returns last PEAR_Error object. This error might be for an error that\r
-* occured several sql statements ago.\r
-*/\r
-function &ADODB_PEAR_Error()\r
-{\r
-global $ADODB_Last_PEAR_Error;\r
-\r
-       return $ADODB_Last_PEAR_Error;\r
-}\r
-               \r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/adodb-exceptions.inc.php b/libraries/adodb/adodb-exceptions.inc.php
deleted file mode 100755 (executable)
index 693b049..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php\r
-\r
-/**\r
- * @version V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license.\r
- * Whenever there is any discrepancy between the two licenses,\r
- * the BSD license will take precedence.\r
- *\r
- * Set tabs to 4 for best viewing.\r
- *\r
- * Latest version is available at http://php.weblogs.com\r
- *\r
- * Exception-handling code using PHP5 exceptions (try-catch-throw).\r
- */\r
-\r
-\r
-if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR); \r
-define('ADODB_ERROR_HANDLER','adodb_throw');\r
-\r
-class ADODB_Exception extends Exception {\r
-var $dbms;\r
-var $fn;\r
-var $sql = '';\r
-var $params = '';\r
-var $host = '';\r
-var $database = '';\r
-       \r
-       function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)\r
-       {\r
-               switch($fn) {\r
-               case 'EXECUTE':\r
-                       $this->sql = $p1;\r
-                       $this->params = $p2;\r
-                       $s = "$dbms error: [$errno: $errmsg] in $fn(\"$p1\")\n";\r
-                       break;\r
-       \r
-               case 'PCONNECT':\r
-               case 'CONNECT':\r
-                       $user = $thisConnection->user;\r
-                       $s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)\n";\r
-                       break;\r
-               default:\r
-                       $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";\r
-                       break;\r
-               }\r
-       \r
-               $this->dbms = $dbms;\r
-               $this->host = $thisConnection->host;\r
-               $this->database = $thisConnection->database;\r
-               $this->fn = $fn;\r
-               $this->msg = $errmsg;\r
-                               \r
-               if (!is_numeric($errno)) $errno = -1;\r
-               parent::__construct($s,$errno);\r
-       }\r
-}\r
-\r
-/**\r
-* Default Error Handler. This will be called with the following params\r
-*\r
-* @param $dbms         the RDBMS you are connecting to\r
-* @param $fn           the name of the calling function (in uppercase)\r
-* @param $errno                the native error number from the database\r
-* @param $errmsg       the native error msg from the database\r
-* @param $p1           $fn specific parameter - see below\r
-* @param $P2           $fn specific parameter - see below\r
-*/\r
-\r
-function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)\r
-{\r
-global $ADODB_EXCEPTION;\r
-       \r
-       if (error_reporting() == 0) return; // obey @ protocol\r
-       if (is_string($ADODB_EXCEPTION)) $errfn = $ADODB_EXCEPTION;\r
-       else $errfn = 'ADODB_EXCEPTION';\r
-       throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection);\r
-}\r
-\r
-\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/adodb-pager.inc.php b/libraries/adodb/adodb-pager.inc.php
deleted file mode 100644 (file)
index 5deb18e..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-<?php\r
-\r
-/*\r
-       V4.65 22 July 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
-         Released under both BSD license and Lesser GPL library license. \r
-         Whenever there is any discrepancy between the two licenses, \r
-         the BSD license will take precedence. \r
-         Set tabs to 4 for best viewing.\r
-\r
-       This class provides recordset pagination with \r
-       First/Prev/Next/Last links. \r
-       \r
-       Feel free to modify this class for your own use as\r
-       it is very basic. To learn how to use it, see the \r
-       example in adodb/tests/testpaging.php.\r
-       \r
-       "Pablo Costa" <pablo@cbsp.com.br> implemented Render_PageLinks().\r
-       \r
-       Please note, this class is entirely unsupported, \r
-       and no free support requests except for bug reports\r
-       will be entertained by the author.\r
-\r
-*/\r
-class ADODB_Pager {\r
-       var $id;        // unique id for pager (defaults to 'adodb')\r
-       var $db;        // ADODB connection object\r
-       var $sql;       // sql used\r
-       var $rs;        // recordset generated\r
-       var $curr_page; // current page number before Render() called, calculated in constructor\r
-       var $rows;              // number of rows per page\r
-    var $linksPerPage=10; // number of links per page in navigation bar\r
-    var $showPageLinks; \r
-\r
-       var $gridAttributes = 'width=100% border=1 bgcolor=white';\r
-       \r
-       // Localize text strings here\r
-       var $first = '<code>|&lt;</code>';\r
-       var $prev = '<code>&lt;&lt;</code>';\r
-       var $next = '<code>>></code>';\r
-       var $last = '<code>>|</code>';\r
-       var $moreLinks = '...';\r
-       var $startLinks = '...';\r
-       var $gridHeader = false;\r
-       var $htmlSpecialChars = true;\r
-       var $page = 'Page';\r
-       var $linkSelectedColor = 'red';\r
-       var $cache = 0;  #secs to cache with CachePageExecute()\r
-       \r
-       //----------------------------------------------\r
-       // constructor\r
-       //\r
-       // $db  adodb connection object\r
-       // $sql sql statement\r
-       // $id  optional id to identify which pager, \r
-       //              if you have multiple on 1 page. \r
-       //              $id should be only be [a-z0-9]*\r
-       //\r
-       function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false)\r
-       {\r
-       global $PHP_SELF;\r
-       \r
-               $curr_page = $id.'_curr_page';\r
-               if (empty($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];\r
-               \r
-               $this->sql = $sql;\r
-               $this->id = $id;\r
-               $this->db = $db;\r
-               $this->showPageLinks = $showPageLinks;\r
-               \r
-               $next_page = $id.'_next_page';  \r
-               \r
-               if (isset($_GET[$next_page])) {\r
-                       $_SESSION[$curr_page] = $_GET[$next_page];\r
-               }\r
-               if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page\r
-               \r
-               $this->curr_page = $_SESSION[$curr_page];\r
-               \r
-       }\r
-       \r
-       //---------------------------\r
-       // Display link to first page\r
-       function Render_First($anchor=true)\r
-       {\r
-       global $PHP_SELF;\r
-               if ($anchor) {\r
-       ?>\r
-               <a href="<?php echo $PHP_SELF,'?',$this->id;?>_next_page=1"><?php echo $this->first;?></a> &nbsp; \r
-       <?php\r
-               } else {\r
-                       print "$this->first &nbsp; ";\r
-               }\r
-       }\r
-       \r
-       //--------------------------\r
-       // Display link to next page\r
-       function render_next($anchor=true)\r
-       {\r
-       global $PHP_SELF;\r
-       \r
-               if ($anchor) {\r
-               ?>\r
-               <a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() + 1 ?>"><?php echo $this->next;?></a> &nbsp; \r
-               <?php\r
-               } else {\r
-                       print "$this->next &nbsp; ";\r
-               }\r
-       }\r
-       \r
-       //------------------\r
-       // Link to last page\r
-       // \r
-       // for better performance with large recordsets, you can set\r
-       // $this->db->pageExecuteCountRows = false, which disables\r
-       // last page counting.\r
-       function render_last($anchor=true)\r
-       {\r
-       global $PHP_SELF;\r
-       \r
-               if (!$this->db->pageExecuteCountRows) return;\r
-               \r
-               if ($anchor) {\r
-               ?>\r
-                       <a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->LastPageNo() ?>"><?php echo $this->last;?></a> &nbsp; \r
-               <?php\r
-               } else {\r
-                       print "$this->last &nbsp; ";\r
-               }\r
-       }\r
-       \r
-       //---------------------------------------------------\r
-       // original code by "Pablo Costa" <pablo@cbsp.com.br> \r
-        function render_pagelinks()\r
-        {\r
-        global $PHP_SELF;\r
-            $pages        = $this->rs->LastPageNo();\r
-            $linksperpage = $this->linksPerPage ? $this->linksPerPage : $pages;\r
-            for($i=1; $i <= $pages; $i+=$linksperpage)\r
-            {\r
-                if($this->rs->AbsolutePage() >= $i)\r
-                {\r
-                    $start = $i;\r
-                }\r
-            }\r
-                       $numbers = '';\r
-            $end = $start+$linksperpage-1;\r
-                       $link = $this->id . "_next_page";\r
-            if($end > $pages) $end = $pages;\r
-                       \r
-                       \r
-                       if ($this->startLinks && $start > 1) {\r
-                               $pos = $start - 1;\r
-                               $numbers .= "<a href=$PHP_SELF?$link=$pos>$this->startLinks</a>  ";\r
-            } \r
-                       \r
-                       for($i=$start; $i <= $end; $i++) {\r
-                if ($this->rs->AbsolutePage() == $i)\r
-                    $numbers .= "<font color=$this->linkSelectedColor><b>$i</b></font>  ";\r
-                else \r
-                     $numbers .= "<a href=$PHP_SELF?$link=$i>$i</a>  ";\r
-            \r
-            }\r
-                       if ($this->moreLinks && $end < $pages) \r
-                               $numbers .= "<a href=$PHP_SELF?$link=$i>$this->moreLinks</a>  ";\r
-            print $numbers . ' &nbsp; ';\r
-        }\r
-       // Link to previous page\r
-       function render_prev($anchor=true)\r
-       {\r
-       global $PHP_SELF;\r
-               if ($anchor) {\r
-       ?>\r
-               <a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->AbsolutePage() - 1 ?>"><?php echo $this->prev;?></a> &nbsp; \r
-       <?php \r
-               } else {\r
-                       print "$this->prev &nbsp; ";\r
-               }\r
-       }\r
-       \r
-       //--------------------------------------------------------\r
-       // Simply rendering of grid. You should override this for\r
-       // better control over the format of the grid\r
-       //\r
-       // We use output buffering to keep code clean and readable.\r
-       function RenderGrid()\r
-       {\r
-       global $gSQLBlockRows; // used by rs2html to indicate how many rows to display\r
-               include_once(ADODB_DIR.'/tohtml.inc.php');\r
-               ob_start();\r
-               $gSQLBlockRows = $this->rows;\r
-               rs2html($this->rs,$this->gridAttributes,$this->gridHeader,$this->htmlSpecialChars);\r
-               $s = ob_get_contents();\r
-               ob_end_clean();\r
-               return $s;\r
-       }\r
-       \r
-       //-------------------------------------------------------\r
-       // Navigation bar\r
-       //\r
-       // we use output buffering to keep the code easy to read.\r
-       function RenderNav()\r
-       {\r
-               ob_start();\r
-               if (!$this->rs->AtFirstPage()) {\r
-                       $this->Render_First();\r
-                       $this->Render_Prev();\r
-               } else {\r
-                       $this->Render_First(false);\r
-                       $this->Render_Prev(false);\r
-               }\r
-        if ($this->showPageLinks){\r
-            $this->Render_PageLinks();\r
-        }\r
-               if (!$this->rs->AtLastPage()) {\r
-                       $this->Render_Next();\r
-                       $this->Render_Last();\r
-               } else {\r
-                       $this->Render_Next(false);\r
-                       $this->Render_Last(false);\r
-               }\r
-               $s = ob_get_contents();\r
-               ob_end_clean();\r
-               return $s;\r
-       }\r
-       \r
-       //-------------------\r
-       // This is the footer\r
-       function RenderPageCount()\r
-       {\r
-               if (!$this->db->pageExecuteCountRows) return '';\r
-               $lastPage = $this->rs->LastPageNo();\r
-               if ($lastPage == -1) $lastPage = 1; // check for empty rs.\r
-               if ($this->curr_page > $lastPage) $this->curr_page = 1;\r
-               return "<font size=-1>$this->page ".$this->curr_page."/".$lastPage."</font>";\r
-       }\r
-       \r
-       //-----------------------------------\r
-       // Call this class to draw everything.\r
-       function Render($rows=10)\r
-       {\r
-       global $ADODB_COUNTRECS;\r
-       \r
-               $this->rows = $rows;\r
-               \r
-               if ($this->db->dataProvider == 'informix') $this->db->cursorType = IFX_SCROLL;\r
-               \r
-               $savec = $ADODB_COUNTRECS;\r
-               if ($this->db->pageExecuteCountRows) $ADODB_COUNTRECS = true;\r
-               if ($this->cache)\r
-                       $rs = &$this->db->CachePageExecute($this->cache,$this->sql,$rows,$this->curr_page);\r
-               else\r
-                       $rs = &$this->db->PageExecute($this->sql,$rows,$this->curr_page);\r
-               $ADODB_COUNTRECS = $savec;\r
-               \r
-               $this->rs = &$rs;\r
-               if (!$rs) {\r
-                       print "<h3>Query failed: $this->sql</h3>";\r
-                       return;\r
-               }\r
-               \r
-               if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage())) \r
-                       $header = $this->RenderNav();\r
-               else\r
-                       $header = "&nbsp;";\r
-               \r
-               $grid = $this->RenderGrid();\r
-               $footer = $this->RenderPageCount();\r
-               $rs->Close();\r
-               $this->rs = false;\r
-               \r
-               $this->RenderLayout($header,$grid,$footer);\r
-       }\r
-       \r
-       //------------------------------------------------------\r
-       // override this to control overall layout and formating\r
-       function RenderLayout($header,$grid,$footer,$attributes='border=1 bgcolor=beige')\r
-       {\r
-               echo "<table ".$attributes."><tr><td>",\r
-                               $header,\r
-                       "</td></tr><tr><td>",\r
-                               $grid,\r
-                       "</td></tr><tr><td>",\r
-                               $footer,\r
-                       "</td></tr></table>";\r
-       }\r
-}\r
-\r
-\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/adodb-pear.inc.php b/libraries/adodb/adodb-pear.inc.php
deleted file mode 100755 (executable)
index 2ed5213..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-<?php\r
-/** \r
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license. \r
- * Whenever there is any discrepancy between the two licenses, \r
- * the BSD license will take precedence. \r
- *\r
- * Set tabs to 4 for best viewing.\r
- * \r
- * PEAR DB Emulation Layer for ADODB.\r
- *\r
- * The following code is modelled on PEAR DB code by Stig Bakken <ssb@fast.no>                                                            |\r
- * and Tomas V.V.Cox <cox@idecnet.com>.        Portions (c)1997-2002 The PHP Group.\r
- */\r
-\r
- /*\r
- We support:\r
\r
- DB_Common\r
- ---------\r
-       query - returns PEAR_Error on error\r
-       limitQuery - return PEAR_Error on error\r
-       prepare - does not return PEAR_Error on error\r
-       execute - does not return PEAR_Error on error\r
-       setFetchMode - supports ASSOC and ORDERED\r
-       errorNative\r
-       quote\r
-       nextID\r
-       disconnect\r
-       \r
-       getOne\r
-       getAssoc\r
-       getRow\r
-       getCol\r
-       getAll\r
-       \r
- DB_Result\r
- ---------\r
-       numRows - returns -1 if not supported\r
-       numCols\r
-       fetchInto - does not support passing of fetchmode\r
-       fetchRows - does not support passing of fetchmode\r
-       free\r
- */\r
\r
-define('ADODB_PEAR',dirname(__FILE__));\r
-include_once "PEAR.php";\r
-include_once ADODB_PEAR."/adodb-errorpear.inc.php";\r
-include_once ADODB_PEAR."/adodb.inc.php";\r
-\r
-if (!defined('DB_OK')) {\r
-define("DB_OK",        1);\r
-define("DB_ERROR",-1);\r
-\r
-// autoExecute constants\r
-define('DB_AUTOQUERY_INSERT', 1);\r
-define('DB_AUTOQUERY_UPDATE', 2);\r
-\r
-/**\r
- * This is a special constant that tells DB the user hasn't specified\r
- * any particular get mode, so the default should be used.\r
- */\r
-\r
-define('DB_FETCHMODE_DEFAULT', 0);\r
-\r
-/**\r
- * Column data indexed by numbers, ordered from 0 and up\r
- */\r
-\r
-define('DB_FETCHMODE_ORDERED', 1);\r
-\r
-/**\r
- * Column data indexed by column names\r
- */\r
-\r
-define('DB_FETCHMODE_ASSOC', 2);\r
-\r
-/* for compatibility */\r
-\r
-define('DB_GETMODE_ORDERED', DB_FETCHMODE_ORDERED);\r
-define('DB_GETMODE_ASSOC',   DB_FETCHMODE_ASSOC);\r
-\r
-/**\r
- * these are constants for the tableInfo-function\r
- * they are bitwised or'ed. so if there are more constants to be defined\r
- * in the future, adjust DB_TABLEINFO_FULL accordingly\r
- */\r
-\r
-define('DB_TABLEINFO_ORDER', 1);\r
-define('DB_TABLEINFO_ORDERTABLE', 2);\r
-define('DB_TABLEINFO_FULL', 3);\r
-}\r
-\r
-/**\r
- * The main "DB" class is simply a container class with some static\r
- * methods for creating DB objects as well as some utility functions\r
- * common to all parts of DB.\r
- *\r
- */\r
-\r
-class DB\r
-{\r
-       /**\r
-        * Create a new DB object for the specified database type\r
-        *\r
-        * @param $type string database type, for example "mysql"\r
-        *\r
-        * @return object a newly created DB object, or a DB error code on\r
-        * error\r
-        */\r
-\r
-       function &factory($type)\r
-       {\r
-               include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");\r
-               $obj = &NewADOConnection($type);\r
-               if (!is_object($obj)) $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);\r
-               return $obj;\r
-       }\r
-\r
-       /**\r
-        * Create a new DB object and connect to the specified database\r
-        *\r
-        * @param $dsn mixed "data source name", see the DB::parseDSN\r
-        * method for a description of the dsn format.  Can also be\r
-        * specified as an array of the format returned by DB::parseDSN.\r
-        *\r
-        * @param $options mixed if boolean (or scalar), tells whether\r
-        * this connection should be persistent (for backends that support\r
-        * this).  This parameter can also be an array of options, see\r
-        * DB_common::setOption for more information on connection\r
-        * options.\r
-        *\r
-        * @return object a newly created DB connection object, or a DB\r
-        * error object on error\r
-        *\r
-        * @see DB::parseDSN\r
-        * @see DB::isError\r
-        */\r
-       function &connect($dsn, $options = false)\r
-       {\r
-               if (is_array($dsn)) {\r
-                       $dsninfo = $dsn;\r
-               } else {\r
-                       $dsninfo = DB::parseDSN($dsn);\r
-               }\r
-               switch ($dsninfo["phptype"]) {\r
-                       case 'pgsql':   $type = 'postgres7'; break;\r
-                       case 'ifx':             $type = 'informix9'; break;\r
-                       default:                $type = $dsninfo["phptype"]; break;\r
-               }\r
-\r
-               if (is_array($options) && isset($options["debug"]) &&\r
-                       $options["debug"] >= 2) {\r
-                       // expose php errors with sufficient debug level\r
-                        @include_once("adodb-$type.inc.php");\r
-               } else {\r
-                        @include_once("adodb-$type.inc.php");\r
-               }\r
-\r
-               @$obj =& NewADOConnection($type);\r
-               if (!is_object($obj)) {\r
-                       $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);\r
-                       return $obj;\r
-               }\r
-               if (is_array($options)) {\r
-                       foreach($options as $k => $v) {\r
-                               switch(strtolower($k)) {\r
-                               case 'persist':\r
-                               case 'persistent':      $persist = $v; break;\r
-                               #ibase\r
-                               case 'dialect':         $obj->dialect = $v; break;\r
-                               case 'charset':         $obj->charset = $v; break;\r
-                               case 'buffers':         $obj->buffers = $v; break;\r
-                               #ado\r
-                               case 'charpage':        $obj->charPage = $v; break;\r
-                               #mysql\r
-                               case 'clientflags': $obj->clientFlags = $v; break;\r
-                               }\r
-                       }\r
-               } else {\r
-                       $persist = false;\r
-               }\r
-\r
-               if (isset($dsninfo['socket'])) $dsninfo['hostspec'] .= ':'.$dsninfo['socket'];\r
-               else if (isset($dsninfo['port'])) $dsninfo['hostspec'] .= ':'.$dsninfo['port'];\r
-               \r
-               if($persist) $ok = $obj->PConnect($dsninfo['hostspec'], $dsninfo['username'],$dsninfo['password'],$dsninfo['database']);\r
-               else  $ok = $obj->Connect($dsninfo['hostspec'], $dsninfo['username'],$dsninfo['password'],$dsninfo['database']);\r
-               \r
-               if (!$ok) $obj = ADODB_PEAR_Error();\r
-               return $obj;\r
-       }\r
-\r
-       /**\r
-        * Return the DB API version\r
-        *\r
-        * @return int the DB API version number\r
-        */\r
-       function apiVersion()\r
-       {\r
-               return 2;\r
-       }\r
-\r
-       /**\r
-        * Tell whether a result code from a DB method is an error\r
-        *\r
-        * @param $value int result code\r
-        *\r
-        * @return bool whether $value is an error\r
-        */\r
-       function isError($value)\r
-       {\r
-               if (!is_object($value)) return false;\r
-               $class = get_class($value);\r
-               return $class == 'pear_error' || is_subclass_of($value, 'pear_error') || \r
-                               $class == 'db_error' || is_subclass_of($value, 'db_error');\r
-       }\r
-\r
-\r
-       /**\r
-        * Tell whether a result code from a DB method is a warning.\r
-        * Warnings differ from errors in that they are generated by DB,\r
-        * and are not fatal.\r
-        *\r
-        * @param $value mixed result value\r
-        *\r
-        * @return bool whether $value is a warning\r
-        */\r
-       function isWarning($value)\r
-       {\r
-               return false;\r
-               /*\r
-               return is_object($value) &&\r
-                       (get_class( $value ) == "db_warning" ||\r
-                        is_subclass_of($value, "db_warning"));*/\r
-       }\r
-\r
-       /**\r
-        * Parse a data source name\r
-        *\r
-        * @param $dsn string Data Source Name to be parsed\r
-        *\r
-        * @return array an associative array with the following keys:\r
-        *\r
-        *  phptype: Database backend used in PHP (mysql, odbc etc.)\r
-        *  dbsyntax: Database used with regards to SQL syntax etc.\r
-        *  protocol: Communication protocol to use (tcp, unix etc.)\r
-        *  hostspec: Host specification (hostname[:port])\r
-        *  database: Database to use on the DBMS server\r
-        *  username: User name for login\r
-        *  password: Password for login\r
-        *\r
-        * The format of the supplied DSN is in its fullest form:\r
-        *\r
-        *  phptype(dbsyntax)://username:password@protocol+hostspec/database\r
-        *\r
-        * Most variations are allowed:\r
-        *\r
-        *  phptype://username:password@protocol+hostspec:110//usr/db_file.db\r
-        *  phptype://username:password@hostspec/database_name\r
-        *  phptype://username:password@hostspec\r
-        *  phptype://username@hostspec\r
-        *  phptype://hostspec/database\r
-        *  phptype://hostspec\r
-        *  phptype(dbsyntax)\r
-        *  phptype\r
-        *\r
-        * @author Tomas V.V.Cox <cox@idecnet.com>\r
-        */\r
-       function parseDSN($dsn)\r
-       {\r
-               if (is_array($dsn)) {\r
-                       return $dsn;\r
-               }\r
-\r
-               $parsed = array(\r
-                       'phptype'  => false,\r
-                       'dbsyntax' => false,\r
-                       'protocol' => false,\r
-                       'hostspec' => false,\r
-                       'database' => false,\r
-                       'username' => false,\r
-                       'password' => false\r
-               );\r
-\r
-               // Find phptype and dbsyntax\r
-               if (($pos = strpos($dsn, '://')) !== false) {\r
-                       $str = substr($dsn, 0, $pos);\r
-                       $dsn = substr($dsn, $pos + 3);\r
-               } else {\r
-                       $str = $dsn;\r
-                       $dsn = NULL;\r
-               }\r
-\r
-               // Get phptype and dbsyntax\r
-               // $str => phptype(dbsyntax)\r
-               if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {\r
-                       $parsed['phptype'] = $arr[1];\r
-                       $parsed['dbsyntax'] = (empty($arr[2])) ? $arr[1] : $arr[2];\r
-               } else {\r
-                       $parsed['phptype'] = $str;\r
-                       $parsed['dbsyntax'] = $str;\r
-               }\r
-\r
-               if (empty($dsn)) {\r
-                       return $parsed;\r
-               }\r
-\r
-               // Get (if found): username and password\r
-               // $dsn => username:password@protocol+hostspec/database\r
-               if (($at = strpos($dsn,'@')) !== false) {\r
-                       $str = substr($dsn, 0, $at);\r
-                       $dsn = substr($dsn, $at + 1);\r
-                       if (($pos = strpos($str, ':')) !== false) {\r
-                               $parsed['username'] = urldecode(substr($str, 0, $pos));\r
-                               $parsed['password'] = urldecode(substr($str, $pos + 1));\r
-                       } else {\r
-                               $parsed['username'] = urldecode($str);\r
-                       }\r
-               }\r
-\r
-               // Find protocol and hostspec\r
-               // $dsn => protocol+hostspec/database\r
-               if (($pos=strpos($dsn, '/')) !== false) {\r
-                       $str = substr($dsn, 0, $pos);\r
-                       $dsn = substr($dsn, $pos + 1);\r
-               } else {\r
-                       $str = $dsn;\r
-                       $dsn = NULL;\r
-               }\r
-\r
-               // Get protocol + hostspec\r
-               // $str => protocol+hostspec\r
-               if (($pos=strpos($str, '+')) !== false) {\r
-                       $parsed['protocol'] = substr($str, 0, $pos);\r
-                       $parsed['hostspec'] = urldecode(substr($str, $pos + 1));\r
-               } else {\r
-                       $parsed['hostspec'] = urldecode($str);\r
-               }\r
-\r
-               // Get dabase if any\r
-               // $dsn => database\r
-               if (!empty($dsn)) {\r
-                       $parsed['database'] = $dsn;\r
-               }\r
-\r
-               return $parsed;\r
-       }\r
-\r
-       /**\r
-        * Load a PHP database extension if it is not loaded already.\r
-        *\r
-        * @access public\r
-        *\r
-        * @param $name the base name of the extension (without the .so or\r
-        * .dll suffix)\r
-        *\r
-        * @return bool true if the extension was already or successfully\r
-        * loaded, false if it could not be loaded\r
-        */\r
-       function assertExtension($name)\r
-       {\r
-               if (!extension_loaded($name)) {\r
-                       $dlext = (strncmp(PHP_OS,'WIN',3) === 0) ? '.dll' : '.so';\r
-                       @dl($name . $dlext);\r
-               }\r
-               if (!extension_loaded($name)) {\r
-                       return false;\r
-               }\r
-               return true;\r
-       }\r
-}\r
-\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/adodb-xmlschema.inc.php b/libraries/adodb/adodb-xmlschema.inc.php
deleted file mode 100755 (executable)
index 7b93a65..0000000
+++ /dev/null
@@ -1,2195 +0,0 @@
-<?php\r
-// Copyright (c) 2004 ars Cognita Inc., all rights reserved\r
-/* ******************************************************************************\r
-    Released under both BSD license and Lesser GPL library license. \r
-       Whenever there is any discrepancy between the two licenses, \r
-       the BSD license will take precedence. \r
-*******************************************************************************/\r
-/**\r
- * xmlschema is a class that allows the user to quickly and easily\r
- * build a database on any ADOdb-supported platform using a simple\r
- * XML schema.\r
- *\r
- * Last Editor: $Author: chriskl $\r
- * @author Richard Tango-Lowy & Dan Cech\r
- * @version $Revision: 1.1 $\r
- *\r
- * @package axmls\r
- * @tutorial getting_started.pkg\r
- */\r
-\r
-/**\r
-* Debug on or off\r
-*/\r
-if( !defined( 'XMLS_DEBUG' ) ) {\r
-       define( 'XMLS_DEBUG', FALSE );\r
-}\r
-\r
-/**\r
-* Default prefix key\r
-*/\r
-if( !defined( 'XMLS_PREFIX' ) ) {\r
-       define( 'XMLS_PREFIX', '%%P' );\r
-}\r
-\r
-/**\r
-* Maximum length allowed for object prefix\r
-*/\r
-if( !defined( 'XMLS_PREFIX_MAXLEN' ) ) {\r
-       define( 'XMLS_PREFIX_MAXLEN', 10 );\r
-}\r
-\r
-/**\r
-* Execute SQL inline as it is generated\r
-*/\r
-if( !defined( 'XMLS_EXECUTE_INLINE' ) ) {\r
-       define( 'XMLS_EXECUTE_INLINE', FALSE );\r
-}\r
-\r
-/**\r
-* Continue SQL Execution if an error occurs?\r
-*/\r
-if( !defined( 'XMLS_CONTINUE_ON_ERROR' ) ) {\r
-       define( 'XMLS_CONTINUE_ON_ERROR', FALSE );\r
-}\r
-\r
-/**\r
-* Current Schema Version\r
-*/\r
-if( !defined( 'XMLS_SCHEMA_VERSION' ) ) {\r
-       define( 'XMLS_SCHEMA_VERSION', '0.2' );\r
-}\r
-\r
-/**\r
-* Default Schema Version.  Used for Schemas without an explicit version set.\r
-*/\r
-if( !defined( 'XMLS_DEFAULT_SCHEMA_VERSION' ) ) {\r
-       define( 'XMLS_DEFAULT_SCHEMA_VERSION', '0.1' );\r
-}\r
-\r
-/**\r
-* Default Schema Version.  Used for Schemas without an explicit version set.\r
-*/\r
-if( !defined( 'XMLS_DEFAULT_UPGRADE_METHOD' ) ) {\r
-       define( 'XMLS_DEFAULT_UPGRADE_METHOD', 'ALTER' );\r
-}\r
-\r
-/**\r
-* Include the main ADODB library\r
-*/\r
-if( !defined( '_ADODB_LAYER' ) ) {\r
-       require( 'adodb.inc.php' );\r
-       require( 'adodb-datadict.inc.php' );\r
-}\r
-\r
-/**\r
-* Abstract DB Object. This class provides basic methods for database objects, such\r
-* as tables and indexes.\r
-*\r
-* @package axmls\r
-* @access private\r
-*/\r
-class dbObject {\r
-       \r
-       /**\r
-       * var object Parent\r
-       */\r
-       var $parent;\r
-       \r
-       /**\r
-       * var string current element\r
-       */\r
-       var $currentElement;\r
-       \r
-       /**\r
-       * NOP\r
-       */\r
-       function dbObject( &$parent, $attributes = NULL ) {\r
-               $this->parent =& $parent;\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               \r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-               \r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               \r
-       }\r
-       \r
-       function create() {\r
-               return array();\r
-       }\r
-       \r
-       /**\r
-       * Destroys the object\r
-       */\r
-       function destroy() {\r
-               unset( $this );\r
-       }\r
-       \r
-       /**\r
-       * Checks whether the specified RDBMS is supported by the current\r
-       * database object or its ranking ancestor.\r
-       *\r
-       * @param string $platform RDBMS platform name (from ADODB platform list).\r
-       * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.\r
-       */\r
-       function supportedPlatform( $platform = NULL ) {\r
-               return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;\r
-       }\r
-       \r
-       /**\r
-       * Returns the prefix set by the ranking ancestor of the database object.\r
-       *\r
-       * @param string $name Prefix string.\r
-       * @return string Prefix.\r
-       */\r
-       function prefix( $name = '' ) {\r
-               return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;\r
-       }\r
-       \r
-       /**\r
-       * Extracts a field ID from the specified field.\r
-       *\r
-       * @param string $field Field.\r
-       * @return string Field ID.\r
-       */\r
-       function FieldID( $field ) {\r
-               return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );\r
-       }\r
-}\r
-\r
-/**\r
-* Creates a table object in ADOdb's datadict format\r
-*\r
-* This class stores information about a database table. As charactaristics\r
-* of the table are loaded from the external source, methods and properties\r
-* of this class are used to build up the table description in ADOdb's\r
-* datadict format.\r
-*\r
-* @package axmls\r
-* @access private\r
-*/\r
-class dbTable extends dbObject {\r
-       \r
-       /**\r
-       * @var string Table name\r
-       */\r
-       var $name;\r
-       \r
-       /**\r
-       * @var array Field specifier: Meta-information about each field\r
-       */\r
-       var $fields = array();\r
-       \r
-       /**\r
-       * @var array List of table indexes.\r
-       */\r
-       var $indexes = array();\r
-       \r
-       /**\r
-       * @var array Table options: Table-level options\r
-       */\r
-       var $opts = array();\r
-       \r
-       /**\r
-       * @var string Field index: Keeps track of which field is currently being processed\r
-       */\r
-       var $current_field;\r
-       \r
-       /**\r
-       * @var boolean Mark table for destruction\r
-       * @access private\r
-       */\r
-       var $drop_table;\r
-       \r
-       /**\r
-       * @var boolean Mark field for destruction (not yet implemented)\r
-       * @access private\r
-       */\r
-       var $drop_field = array();\r
-       \r
-       /**\r
-       * Iniitializes a new table object.\r
-       *\r
-       * @param string $prefix DB Object prefix\r
-       * @param array $attributes Array of table attributes.\r
-       */\r
-       function dbTable( &$parent, $attributes = NULL ) {\r
-               $this->parent =& $parent;\r
-               $this->name = $this->prefix($attributes['NAME']);\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements. Elements currently \r
-       * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT. \r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               $this->currentElement = strtoupper( $tag );\r
-               \r
-               switch( $this->currentElement ) {\r
-                       case 'INDEX':\r
-                               if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {\r
-                                       xml_set_object( $parser, $this->addIndex( $attributes ) );\r
-                               }\r
-                               break;\r
-                       case 'DATA':\r
-                               if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {\r
-                                       xml_set_object( $parser, $this->addData( $attributes ) );\r
-                               }\r
-                               break;\r
-                       case 'DROP':\r
-                               $this->drop();\r
-                               break;\r
-                       case 'FIELD':\r
-                               // Add a field\r
-                               $fieldName = $attributes['NAME'];\r
-                               $fieldType = $attributes['TYPE'];\r
-                               $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;\r
-                               $fieldOpts = isset( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;\r
-                               \r
-                               $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );\r
-                               break;\r
-                       case 'KEY':\r
-                       case 'NOTNULL':\r
-                       case 'AUTOINCREMENT':\r
-                               // Add a field option\r
-                               $this->addFieldOpt( $this->current_field, $this->currentElement );\r
-                               break;\r
-                       case 'DEFAULT':\r
-                               // Add a field option to the table object\r
-                               \r
-                               // Work around ADOdb datadict issue that misinterprets empty strings.\r
-                               if( $attributes['VALUE'] == '' ) {\r
-                                       $attributes['VALUE'] = " '' ";\r
-                               }\r
-                               \r
-                               $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );\r
-                               break;\r
-                       case 'DEFDATE':\r
-                       case 'DEFTIMESTAMP':\r
-                               // Add a field option to the table object\r
-                               $this->addFieldOpt( $this->current_field, $this->currentElement );\r
-                               break;\r
-                       default:\r
-                               // print_r( array( $tag, $attributes ) );\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-               switch( $this->currentElement ) {\r
-                       // Table constraint\r
-                       case 'CONSTRAINT':\r
-                               if( isset( $this->current_field ) ) {\r
-                                       $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );\r
-                               } else {\r
-                                       $this->addTableOpt( $cdata );\r
-                               }\r
-                               break;\r
-                       // Table option\r
-                       case 'OPT':\r
-                               $this->addTableOpt( $cdata );\r
-                               break;\r
-                       default:\r
-                               \r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               $this->currentElement = '';\r
-               \r
-               switch( strtoupper( $tag ) ) {\r
-                       case 'TABLE':\r
-                               $this->parent->addSQL( $this->create( $this->parent ) );\r
-                               xml_set_object( $parser, $this->parent );\r
-                               $this->destroy();\r
-                               break;\r
-                       case 'FIELD':\r
-                               unset($this->current_field);\r
-                               break;\r
-\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Adds an index to a table object\r
-       *\r
-       * @param array $attributes Index attributes\r
-       * @return object dbIndex object\r
-       */\r
-       function &addIndex( $attributes ) {\r
-               $name = strtoupper( $attributes['NAME'] );\r
-               $this->indexes[$name] =& new dbIndex( $this, $attributes );\r
-               return $this->indexes[$name];\r
-       }\r
-       \r
-       /**\r
-       * Adds data to a table object\r
-       *\r
-       * @param array $attributes Data attributes\r
-       * @return object dbData object\r
-       */\r
-       function &addData( $attributes ) {\r
-               if( !isset( $this->data ) ) {\r
-                       $this->data =& new dbData( $this, $attributes );\r
-               }\r
-               return $this->data;\r
-       }\r
-       \r
-       /**\r
-       * Adds a field to a table object\r
-       *\r
-       * $name is the name of the table to which the field should be added. \r
-       * $type is an ADODB datadict field type. The following field types\r
-       * are supported as of ADODB 3.40:\r
-       *       - C:  varchar\r
-       *       - X:  CLOB (character large object) or largest varchar size\r
-       *          if CLOB is not supported\r
-       *       - C2: Multibyte varchar\r
-       *       - X2: Multibyte CLOB\r
-       *       - B:  BLOB (binary large object)\r
-       *       - D:  Date (some databases do not support this, and we return a datetime type)\r
-       *       - T:  Datetime or Timestamp\r
-       *       - L:  Integer field suitable for storing booleans (0 or 1)\r
-       *       - I:  Integer (mapped to I4)\r
-       *       - I1: 1-byte integer\r
-       *       - I2: 2-byte integer\r
-       *       - I4: 4-byte integer\r
-       *       - I8: 8-byte integer\r
-       *       - F:  Floating point number\r
-       *       - N:  Numeric or decimal number\r
-       *\r
-       * @param string $name Name of the table to which the field will be added.\r
-       * @param string $type   ADODB datadict field type.\r
-       * @param string $size   Field size\r
-       * @param array $opts    Field options array\r
-       * @return array Field specifier array\r
-       */\r
-       function addField( $name, $type, $size = NULL, $opts = NULL ) {\r
-               $field_id = $this->FieldID( $name );\r
-               \r
-               // Set the field index so we know where we are\r
-               $this->current_field = $field_id;\r
-               \r
-               // Set the field name (required)\r
-               $this->fields[$field_id]['NAME'] = $name;\r
-               \r
-               // Set the field type (required)\r
-               $this->fields[$field_id]['TYPE'] = $type;\r
-               \r
-               // Set the field size (optional)\r
-               if( isset( $size ) ) {\r
-                       $this->fields[$field_id]['SIZE'] = $size;\r
-               }\r
-               \r
-               // Set the field options\r
-               if( isset( $opts ) ) {\r
-                       $this->fields[$field_id]['OPTS'][] = $opts;\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Adds a field option to the current field specifier\r
-       *\r
-       * This method adds a field option allowed by the ADOdb datadict \r
-       * and appends it to the given field.\r
-       *\r
-       * @param string $field  Field name\r
-       * @param string $opt ADOdb field option\r
-       * @param mixed $value Field option value\r
-       * @return array Field specifier array\r
-       */\r
-       function addFieldOpt( $field, $opt, $value = NULL ) {\r
-               if( !isset( $value ) ) {\r
-                       $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;\r
-               // Add the option and value\r
-               } else {\r
-                       $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Adds an option to the table\r
-       *\r
-       * This method takes a comma-separated list of table-level options\r
-       * and appends them to the table object.\r
-       *\r
-       * @param string $opt Table option\r
-       * @return array Options\r
-       */\r
-       function addTableOpt( $opt ) {\r
-               $this->opts[] = $opt;\r
-               \r
-               return $this->opts;\r
-       }\r
-       \r
-       /**\r
-       * Generates the SQL that will create the table in the database\r
-       *\r
-       * @param object $xmls adoSchema object\r
-       * @return array Array containing table creation SQL\r
-       */\r
-       function create( &$xmls ) {\r
-               $sql = array();\r
-               \r
-               // drop any existing indexes\r
-               if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {\r
-                       foreach( $legacy_indexes as $index => $index_details ) {\r
-                               $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );\r
-                       }\r
-               }\r
-               \r
-               // remove fields to be dropped from table object\r
-               foreach( $this->drop_field as $field ) {\r
-                       unset( $this->fields[$field] );\r
-               }\r
-               \r
-               // if table exists\r
-               if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {\r
-                       // drop table\r
-                       if( $this->drop_table ) {\r
-                               $sql[] = $xmls->dict->DropTableSQL( $this->name );\r
-                               \r
-                               return $sql;\r
-                       }\r
-                       \r
-                       // drop any existing fields not in schema\r
-                       foreach( $legacy_fields as $field_id => $field ) {\r
-                               if( !isset( $this->fields[$field_id] ) ) {\r
-                                       $sql[] = $xmls->dict->DropColumnSQL( $this->name, '`'.$field->name.'`' );\r
-                               }\r
-                       }\r
-               // if table doesn't exist\r
-               } else {\r
-                       if( $this->drop_table ) {\r
-                               return $sql;\r
-                       }\r
-                       \r
-                       $legacy_fields = array();\r
-               }\r
-               \r
-               // Loop through the field specifier array, building the associative array for the field options\r
-               $fldarray = array();\r
-               \r
-               foreach( $this->fields as $field_id => $finfo ) {\r
-                       // Set an empty size if it isn't supplied\r
-                       if( !isset( $finfo['SIZE'] ) ) {\r
-                               $finfo['SIZE'] = '';\r
-                       }\r
-                       \r
-                       // Initialize the field array with the type and size\r
-                       $fldarray[$field_id] = array(\r
-                               'NAME' => $finfo['NAME'],\r
-                               'TYPE' => $finfo['TYPE'],\r
-                               'SIZE' => $finfo['SIZE']\r
-                       );\r
-                       \r
-                       // Loop through the options array and add the field options. \r
-                       if( isset( $finfo['OPTS'] ) ) {\r
-                               foreach( $finfo['OPTS'] as $opt ) {\r
-                                       // Option has an argument.\r
-                                       if( is_array( $opt ) ) {\r
-                                               $key = key( $opt );\r
-                                               $value = $opt[key( $opt )];\r
-                                               @$fldarray[$field_id][$key] .= $value;\r
-                                       // Option doesn't have arguments\r
-                                       } else {\r
-                                               $fldarray[$field_id][$opt] = $opt;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               if( empty( $legacy_fields ) ) {\r
-                       // Create the new table\r
-                       $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );\r
-                       logMsg( end( $sql ), 'Generated CreateTableSQL' );\r
-               } else {\r
-                       // Upgrade an existing table\r
-                       logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );\r
-                       switch( $xmls->upgrade ) {\r
-                               // Use ChangeTableSQL\r
-                               case 'ALTER':\r
-                                       logMsg( 'Generated ChangeTableSQL (ALTERing table)' );\r
-                                       $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );\r
-                                       break;\r
-                               case 'REPLACE':\r
-                                       logMsg( 'Doing upgrade REPLACE (testing)' );\r
-                                       $sql[] = $xmls->dict->DropTableSQL( $this->name );\r
-                                       $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );\r
-                                       break;\r
-                               // ignore table\r
-                               default:\r
-                                       return array();\r
-                       }\r
-               }\r
-               \r
-               foreach( $this->indexes as $index ) {\r
-                       $sql[] = $index->create( $xmls );\r
-               }\r
-               \r
-               if( isset( $this->data ) ) {\r
-                       $sql[] = $this->data->create( $xmls );\r
-               }\r
-               \r
-               return $sql;\r
-       }\r
-       \r
-       /**\r
-       * Marks a field or table for destruction\r
-       */\r
-       function drop() {\r
-               if( isset( $this->current_field ) ) {\r
-                       // Drop the current field\r
-                       logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );\r
-                       // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );\r
-                       $this->drop_field[$this->current_field] = $this->current_field;\r
-               } else {\r
-                       // Drop the current table\r
-                       logMsg( "Dropping table '{$this->name}'" );\r
-                       // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );\r
-                       $this->drop_table = TRUE;\r
-               }\r
-       }\r
-}\r
-\r
-/**\r
-* Creates an index object in ADOdb's datadict format\r
-*\r
-* This class stores information about a database index. As charactaristics\r
-* of the index are loaded from the external source, methods and properties\r
-* of this class are used to build up the index description in ADOdb's\r
-* datadict format.\r
-*\r
-* @package axmls\r
-* @access private\r
-*/\r
-class dbIndex extends dbObject {\r
-       \r
-       /**\r
-       * @var string   Index name\r
-       */\r
-       var $name;\r
-       \r
-       /**\r
-       * @var array    Index options: Index-level options\r
-       */\r
-       var $opts = array();\r
-       \r
-       /**\r
-       * @var array    Indexed fields: Table columns included in this index\r
-       */\r
-       var $columns = array();\r
-       \r
-       /**\r
-       * @var boolean Mark index for destruction\r
-       * @access private\r
-       */\r
-       var $drop = FALSE;\r
-       \r
-       /**\r
-       * Initializes the new dbIndex object.\r
-       *\r
-       * @param object $parent Parent object\r
-       * @param array $attributes Attributes\r
-       *\r
-       * @internal\r
-       */\r
-       function dbIndex( &$parent, $attributes = NULL ) {\r
-               $this->parent =& $parent;\r
-               \r
-               $this->name = $this->prefix ($attributes['NAME']);\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements\r
-       *\r
-       * Processes XML opening tags. \r
-       * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH. \r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               $this->currentElement = strtoupper( $tag );\r
-               \r
-               switch( $this->currentElement ) {\r
-                       case 'DROP':\r
-                               $this->drop();\r
-                               break;\r
-                       case 'CLUSTERED':\r
-                       case 'BITMAP':\r
-                       case 'UNIQUE':\r
-                       case 'FULLTEXT':\r
-                       case 'HASH':\r
-                               // Add index Option\r
-                               $this->addIndexOpt( $this->currentElement );\r
-                               break;\r
-                       default:\r
-                               // print_r( array( $tag, $attributes ) );\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       *\r
-       * Processes XML cdata.\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-               switch( $this->currentElement ) {\r
-                       // Index field name\r
-                       case 'COL':\r
-                               $this->addField( $cdata );\r
-                               break;\r
-                       default:\r
-                               \r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               $this->currentElement = '';\r
-               \r
-               switch( strtoupper( $tag ) ) {\r
-                       case 'INDEX':\r
-                               xml_set_object( $parser, $this->parent );\r
-                               break;\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Adds a field to the index\r
-       *\r
-       * @param string $name Field name\r
-       * @return string Field list\r
-       */\r
-       function addField( $name ) {\r
-               $this->columns[$this->FieldID( $name )] = $name;\r
-               \r
-               // Return the field list\r
-               return $this->columns;\r
-       }\r
-       \r
-       /**\r
-       * Adds options to the index\r
-       *\r
-       * @param string $opt Comma-separated list of index options.\r
-       * @return string Option list\r
-       */\r
-       function addIndexOpt( $opt ) {\r
-               $this->opts[] = $opt;\r
-               \r
-               // Return the options list\r
-               return $this->opts;\r
-       }\r
-       \r
-       /**\r
-       * Generates the SQL that will create the index in the database\r
-       *\r
-       * @param object $xmls adoSchema object\r
-       * @return array Array containing index creation SQL\r
-       */\r
-       function create( &$xmls ) {\r
-               if( $this->drop ) {\r
-                       return NULL;\r
-               }\r
-               \r
-               // eliminate any columns that aren't in the table\r
-               foreach( $this->columns as $id => $col ) {\r
-                       if( !isset( $this->parent->fields[$id] ) ) {\r
-                               unset( $this->columns[$id] );\r
-                       }\r
-               }\r
-               \r
-               return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );\r
-       }\r
-       \r
-       /**\r
-       * Marks an index for destruction\r
-       */\r
-       function drop() {\r
-               $this->drop = TRUE;\r
-       }\r
-}\r
-\r
-/**\r
-* Creates a data object in ADOdb's datadict format\r
-*\r
-* This class stores information about table data.\r
-*\r
-* @package axmls\r
-* @access private\r
-*/\r
-class dbData extends dbObject {\r
-       \r
-       var $data = array();\r
-       \r
-       var $row;\r
-       \r
-       /**\r
-       * Initializes the new dbIndex object.\r
-       *\r
-       * @param object $parent Parent object\r
-       * @param array $attributes Attributes\r
-       *\r
-       * @internal\r
-       */\r
-       function dbData( &$parent, $attributes = NULL ) {\r
-               $this->parent =& $parent;\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements\r
-       *\r
-       * Processes XML opening tags. \r
-       * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH. \r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               $this->currentElement = strtoupper( $tag );\r
-               \r
-               switch( $this->currentElement ) {\r
-                       case 'ROW':\r
-                               $this->row = count( $this->data );\r
-                               $this->data[$this->row] = array();\r
-                               break;\r
-                       case 'F':\r
-                               $this->addField($attributes);\r
-                       default:\r
-                               // print_r( array( $tag, $attributes ) );\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       *\r
-       * Processes XML cdata.\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-               switch( $this->currentElement ) {\r
-                       // Index field name\r
-                       case 'F':\r
-                               $this->addData( $cdata );\r
-                               break;\r
-                       default:\r
-                               \r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               $this->currentElement = '';\r
-               \r
-               switch( strtoupper( $tag ) ) {\r
-                       case 'DATA':\r
-                               xml_set_object( $parser, $this->parent );\r
-                               break;\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Adds a field to the index\r
-       *\r
-       * @param string $name Field name\r
-       * @return string Field list\r
-       */\r
-       function addField( $attributes ) {\r
-               if( isset( $attributes['NAME'] ) ) {\r
-                       $name = $attributes['NAME'];\r
-               } else {\r
-                       $name = count($this->data[$this->row]);\r
-               }\r
-               \r
-               // Set the field index so we know where we are\r
-               $this->current_field = $this->FieldID( $name );\r
-       }\r
-       \r
-       /**\r
-       * Adds options to the index\r
-       *\r
-       * @param string $opt Comma-separated list of index options.\r
-       * @return string Option list\r
-       */\r
-       function addData( $cdata ) {\r
-               if( !isset( $this->data[$this->row] ) ) {\r
-                       $this->data[$this->row] = array();\r
-               }\r
-               \r
-               if( !isset( $this->data[$this->row][$this->current_field] ) ) {\r
-                       $this->data[$this->row][$this->current_field] = '';\r
-               }\r
-               \r
-               $this->data[$this->row][$this->current_field] .= $cdata;\r
-       }\r
-       \r
-       /**\r
-       * Generates the SQL that will create the index in the database\r
-       *\r
-       * @param object $xmls adoSchema object\r
-       * @return array Array containing index creation SQL\r
-       */\r
-       function create( &$xmls ) {\r
-               $table = $xmls->dict->TableName($this->parent->name);\r
-               $table_field_count = count($this->parent->fields);\r
-               $sql = array();\r
-               \r
-               // eliminate any columns that aren't in the table\r
-               foreach( $this->data as $row ) {\r
-                       $table_fields = $this->parent->fields;\r
-                       $fields = array();\r
-                       \r
-                       foreach( $row as $field_id => $field_data ) {\r
-                               if( !array_key_exists( $field_id, $table_fields ) ) {\r
-                                       if( is_numeric( $field_id ) ) {\r
-                                               $field_id = reset( array_keys( $table_fields ) );\r
-                                       } else {\r
-                                               continue;\r
-                                       }\r
-                               }\r
-                               \r
-                               $name = $table_fields[$field_id]['NAME'];\r
-                               \r
-                               switch( $table_fields[$field_id]['TYPE'] ) {\r
-                                       case 'C':\r
-                                       case 'C2':\r
-                                       case 'X':\r
-                                       case 'X2':\r
-                                               $fields[$name] = $xmls->db->qstr( $field_data );\r
-                                               break;\r
-                                       case 'I':\r
-                                       case 'I1':\r
-                                       case 'I2':\r
-                                       case 'I4':\r
-                                       case 'I8':\r
-                                               $fields[$name] = intval($field_data);\r
-                                               break;\r
-                                       default:\r
-                                               $fields[$name] = $field_data;\r
-                               }\r
-                               \r
-                               unset($table_fields[$field_id]);\r
-                       }\r
-                       \r
-                       // check that at least 1 column is specified\r
-                       if( empty( $fields ) ) {\r
-                               continue;\r
-                       }\r
-                       \r
-                       // check that no required columns are missing\r
-                       if( count( $fields ) < $table_field_count ) {\r
-                               foreach( $table_fields as $field ) {\r
-                                       if (isset( $field['OPTS'] ))\r
-                                               if( ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {\r
-                                                       continue(2);\r
-                                               }\r
-                               }\r
-                       }\r
-                       \r
-                       $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';\r
-               }\r
-               \r
-               return $sql;\r
-       }\r
-}\r
-\r
-/**\r
-* Creates the SQL to execute a list of provided SQL queries\r
-*\r
-* @package axmls\r
-* @access private\r
-*/\r
-class dbQuerySet extends dbObject {\r
-       \r
-       /**\r
-       * @var array    List of SQL queries\r
-       */\r
-       var $queries = array();\r
-       \r
-       /**\r
-       * @var string   String used to build of a query line by line\r
-       */\r
-       var $query;\r
-       \r
-       /**\r
-       * @var string   Query prefix key\r
-       */\r
-       var $prefixKey = '';\r
-       \r
-       /**\r
-       * @var boolean  Auto prefix enable (TRUE)\r
-       */\r
-       var $prefixMethod = 'AUTO';\r
-       \r
-       /**\r
-       * Initializes the query set.\r
-       *\r
-       * @param object $parent Parent object\r
-       * @param array $attributes Attributes\r
-       */\r
-       function dbQuerySet( &$parent, $attributes = NULL ) {\r
-               $this->parent =& $parent;\r
-                       \r
-               // Overrides the manual prefix key\r
-               if( isset( $attributes['KEY'] ) ) {\r
-                       $this->prefixKey = $attributes['KEY'];\r
-               }\r
-               \r
-               $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';\r
-               \r
-               // Enables or disables automatic prefix prepending\r
-               switch( $prefixMethod ) {\r
-                       case 'AUTO':\r
-                               $this->prefixMethod = 'AUTO';\r
-                               break;\r
-                       case 'MANUAL':\r
-                               $this->prefixMethod = 'MANUAL';\r
-                               break;\r
-                       case 'NONE':\r
-                               $this->prefixMethod = 'NONE';\r
-                               break;\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements. Elements currently \r
-       * processed are: QUERY. \r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               $this->currentElement = strtoupper( $tag );\r
-               \r
-               switch( $this->currentElement ) {\r
-                       case 'QUERY':\r
-                               // Create a new query in a SQL queryset.\r
-                               // Ignore this query set if a platform is specified and it's different than the \r
-                               // current connection platform.\r
-                               if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {\r
-                                       $this->newQuery();\r
-                               } else {\r
-                                       $this->discardQuery();\r
-                               }\r
-                               break;\r
-                       default:\r
-                               // print_r( array( $tag, $attributes ) );\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-               switch( $this->currentElement ) {\r
-                       // Line of queryset SQL data\r
-                       case 'QUERY':\r
-                               $this->buildQuery( $cdata );\r
-                               break;\r
-                       default:\r
-                               \r
-               }\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               $this->currentElement = '';\r
-               \r
-               switch( strtoupper( $tag ) ) {\r
-                       case 'QUERY':\r
-                               // Add the finished query to the open query set.\r
-                               $this->addQuery();\r
-                               break;\r
-                       case 'SQL':\r
-                               $this->parent->addSQL( $this->create( $this->parent ) );\r
-                               xml_set_object( $parser, $this->parent );\r
-                               $this->destroy();\r
-                               break;\r
-                       default:\r
-                               \r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Re-initializes the query.\r
-       *\r
-       * @return boolean TRUE\r
-       */\r
-       function newQuery() {\r
-               $this->query = '';\r
-               \r
-               return TRUE;\r
-       }\r
-       \r
-       /**\r
-       * Discards the existing query.\r
-       *\r
-       * @return boolean TRUE\r
-       */\r
-       function discardQuery() {\r
-               unset( $this->query );\r
-               \r
-               return TRUE;\r
-       }\r
-       \r
-       /** \r
-       * Appends a line to a query that is being built line by line\r
-       *\r
-       * @param string $data Line of SQL data or NULL to initialize a new query\r
-       * @return string SQL query string.\r
-       */\r
-       function buildQuery( $sql = NULL ) {\r
-               if( !isset( $this->query ) OR empty( $sql ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               $this->query .= $sql;\r
-               \r
-               return $this->query;\r
-       }\r
-       \r
-       /**\r
-       * Adds a completed query to the query list\r
-       *\r
-       * @return string        SQL of added query\r
-       */\r
-       function addQuery() {\r
-               if( !isset( $this->query ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               $this->queries[] = $return = trim($this->query);\r
-               \r
-               unset( $this->query );\r
-               \r
-               return $return;\r
-       }\r
-       \r
-       /**\r
-       * Creates and returns the current query set\r
-       *\r
-       * @param object $xmls adoSchema object\r
-       * @return array Query set\r
-       */\r
-       function create( &$xmls ) {\r
-               foreach( $this->queries as $id => $query ) {\r
-                       switch( $this->prefixMethod ) {\r
-                               case 'AUTO':\r
-                                       // Enable auto prefix replacement\r
-                                       \r
-                                       // Process object prefix.\r
-                                       // Evaluate SQL statements to prepend prefix to objects\r
-                                       $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );\r
-                                       $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );\r
-                                       $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );\r
-                                       \r
-                                       // SELECT statements aren't working yet\r
-                                       #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );\r
-                                       \r
-                               case 'MANUAL':\r
-                                       // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.\r
-                                       // If prefixKey is not set, we use the default constant XMLS_PREFIX\r
-                                       if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {\r
-                                               // Enable prefix override\r
-                                               $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );\r
-                                       } else {\r
-                                               // Use default replacement\r
-                                               $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );\r
-                                       }\r
-                       }\r
-                       \r
-                       $this->queries[$id] = trim( $query );\r
-               }\r
-               \r
-               // Return the query set array\r
-               return $this->queries;\r
-       }\r
-       \r
-       /**\r
-       * Rebuilds the query with the prefix attached to any objects\r
-       *\r
-       * @param string $regex Regex used to add prefix\r
-       * @param string $query SQL query string\r
-       * @param string $prefix Prefix to be appended to tables, indices, etc.\r
-       * @return string Prefixed SQL query string.\r
-       */\r
-       function prefixQuery( $regex, $query, $prefix = NULL ) {\r
-               if( !isset( $prefix ) ) {\r
-                       return $query;\r
-               }\r
-               \r
-               if( preg_match( $regex, $query, $match ) ) {\r
-                       $preamble = $match[1];\r
-                       $postamble = $match[5];\r
-                       $objectList = explode( ',', $match[3] );\r
-                       // $prefix = $prefix . '_';\r
-                       \r
-                       $prefixedList = '';\r
-                       \r
-                       foreach( $objectList as $object ) {\r
-                               if( $prefixedList !== '' ) {\r
-                                       $prefixedList .= ', ';\r
-                               }\r
-                               \r
-                               $prefixedList .= $prefix . trim( $object );\r
-                       }\r
-                       \r
-                       $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;\r
-               }\r
-               \r
-               return $query;\r
-       }\r
-}\r
-\r
-/**\r
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements\r
-* \r
-* This class is used to load and parse the XML file, to create an array of SQL statements\r
-* that can be used to build a database, and to build the database using the SQL array.\r
-*\r
-* @tutorial getting_started.pkg\r
-*\r
-* @author Richard Tango-Lowy & Dan Cech\r
-* @version $Revision: 1.1 $\r
-*\r
-* @package axmls\r
-*/\r
-class adoSchema {\r
-       \r
-       /**\r
-       * @var array    Array containing SQL queries to generate all objects\r
-       * @access private\r
-       */\r
-       var $sqlArray;\r
-       \r
-       /**\r
-       * @var object   ADOdb connection object\r
-       * @access private\r
-       */\r
-       var $db;\r
-       \r
-       /**\r
-       * @var object   ADOdb Data Dictionary\r
-       * @access private\r
-       */\r
-       var $dict;\r
-       \r
-       /**\r
-       * @var string Current XML element\r
-       * @access private\r
-       */\r
-       var $currentElement = '';\r
-       \r
-       /**\r
-       * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database\r
-       * @access private\r
-       */\r
-       var $upgrade = '';\r
-       \r
-       /**\r
-       * @var string Optional object prefix\r
-       * @access private\r
-       */\r
-       var $objectPrefix = '';\r
-       \r
-       /**\r
-       * @var long     Original Magic Quotes Runtime value\r
-       * @access private\r
-       */\r
-       var $mgq;\r
-       \r
-       /**\r
-       * @var long     System debug\r
-       * @access private\r
-       */\r
-       var $debug;\r
-       \r
-       /**\r
-       * @var string Regular expression to find schema version\r
-       * @access private\r
-       */\r
-       var $versionRegex = '/<schema.*?( version="([^"]*)")?.*?>/';\r
-       \r
-       /**\r
-       * @var string Current schema version\r
-       * @access private\r
-       */\r
-       var $schemaVersion;\r
-       \r
-       /**\r
-       * @var int      Success of last Schema execution\r
-       */\r
-       var $success;\r
-       \r
-       /**\r
-       * @var bool     Execute SQL inline as it is generated\r
-       */\r
-       var $executeInline;\r
-       \r
-       /**\r
-       * @var bool     Continue SQL execution if errors occur\r
-       */\r
-       var $continueOnError;\r
-       \r
-       /**\r
-       * Creates an adoSchema object\r
-       *\r
-       * Creating an adoSchema object is the first step in processing an XML schema.\r
-       * The only parameter is an ADOdb database connection object, which must already\r
-       * have been created.\r
-       *\r
-       * @param object $db ADOdb database connection object.\r
-       */\r
-       function adoSchema( &$db ) {\r
-               // Initialize the environment\r
-               $this->mgq = get_magic_quotes_runtime();\r
-               set_magic_quotes_runtime(0);\r
-               \r
-               $this->db =& $db;\r
-               $this->debug = $this->db->debug;\r
-               $this->dict = NewDataDictionary( $this->db );\r
-               $this->sqlArray = array();\r
-               $this->schemaVersion = XMLS_SCHEMA_VERSION;\r
-               $this->executeInline( XMLS_EXECUTE_INLINE );\r
-               $this->continueOnError( XMLS_CONTINUE_ON_ERROR );\r
-               $this->setUpgradeMethod();\r
-       }\r
-       \r
-       /**\r
-       * Sets the method to be used for upgrading an existing database\r
-       *\r
-       * Use this method to specify how existing database objects should be upgraded.\r
-       * The method option can be set to ALTER, REPLACE, BEST, or NONE. ALTER attempts to\r
-       * alter each database object directly, REPLACE attempts to rebuild each object\r
-       * from scratch, BEST attempts to determine the best upgrade method for each\r
-       * object, and NONE disables upgrading.\r
-       *\r
-       * This method is not yet used by AXMLS, but exists for backward compatibility.\r
-       * The ALTER method is automatically assumed when the adoSchema object is\r
-       * instantiated; other upgrade methods are not currently supported.\r
-       *\r
-       * @param string $method Upgrade method (ALTER|REPLACE|BEST|NONE)\r
-       * @returns string Upgrade method used\r
-       */\r
-       function SetUpgradeMethod( $method = '' ) {\r
-               if( !is_string( $method ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               $method = strtoupper( $method );\r
-               \r
-               // Handle the upgrade methods\r
-               switch( $method ) {\r
-                       case 'ALTER':\r
-                               $this->upgrade = $method;\r
-                               break;\r
-                       case 'REPLACE':\r
-                               $this->upgrade = $method;\r
-                               break;\r
-                       case 'BEST':\r
-                               $this->upgrade = 'ALTER';\r
-                               break;\r
-                       case 'NONE':\r
-                               $this->upgrade = 'NONE';\r
-                               break;\r
-                       default:\r
-                               // Use default if no legitimate method is passed.\r
-                               $this->upgrade = XMLS_DEFAULT_UPGRADE_METHOD;\r
-               }\r
-               \r
-               return $this->upgrade;\r
-       }\r
-       \r
-       /**\r
-       * Enables/disables inline SQL execution.\r
-       *\r
-       * Call this method to enable or disable inline execution of the schema. If the mode is set to TRUE (inline execution),\r
-       * AXMLS applies the SQL to the database immediately as each schema entity is parsed. If the mode\r
-       * is set to FALSE (post execution), AXMLS parses the entire schema and you will need to call adoSchema::ExecuteSchema()\r
-       * to apply the schema to the database.\r
-       *\r
-       * @param bool $mode execute\r
-       * @return bool current execution mode\r
-       *\r
-       * @see ParseSchema(), ExecuteSchema()\r
-       */\r
-       function ExecuteInline( $mode = NULL ) {\r
-               if( is_bool( $mode ) ) {\r
-                       $this->executeInline = $mode;\r
-               }\r
-               \r
-               return $this->executeInline;\r
-       }\r
-       \r
-       /**\r
-       * Enables/disables SQL continue on error.\r
-       *\r
-       * Call this method to enable or disable continuation of SQL execution if an error occurs.\r
-       * If the mode is set to TRUE (continue), AXMLS will continue to apply SQL to the database, even if an error occurs.\r
-       * If the mode is set to FALSE (halt), AXMLS will halt execution of generated sql if an error occurs, though parsing\r
-       * of the schema will continue.\r
-       *\r
-       * @param bool $mode execute\r
-       * @return bool current continueOnError mode\r
-       *\r
-       * @see addSQL(), ExecuteSchema()\r
-       */\r
-       function ContinueOnError( $mode = NULL ) {\r
-               if( is_bool( $mode ) ) {\r
-                       $this->continueOnError = $mode;\r
-               }\r
-               \r
-               return $this->continueOnError;\r
-       }\r
-       \r
-       /**\r
-       * Loads an XML schema from a file and converts it to SQL.\r
-       *\r
-       * Call this method to load the specified schema (see the DTD for the proper format) from\r
-       * the filesystem and generate the SQL necessary to create the database described. \r
-       * @see ParseSchemaString()\r
-       *\r
-       * @param string $file Name of XML schema file.\r
-       * @param bool $returnSchema Return schema rather than parsing.\r
-       * @return array Array of SQL queries, ready to execute\r
-       */\r
-       function ParseSchema( $filename, $returnSchema = FALSE ) {\r
-               return $this->ParseSchemaString( $this->ConvertSchemaFile( $filename ), $returnSchema );\r
-       }\r
-       \r
-       /**\r
-       * Loads an XML schema from a file and converts it to SQL.\r
-       *\r
-       * Call this method to load the specified schema from a file (see the DTD for the proper format) \r
-       * and generate the SQL necessary to create the database described by the schema.\r
-       *\r
-       * @param string $file Name of XML schema file.\r
-       * @param bool $returnSchema Return schema rather than parsing.\r
-       * @return array Array of SQL queries, ready to execute.\r
-       *\r
-       * @deprecated Replaced by adoSchema::ParseSchema() and adoSchema::ParseSchemaString()\r
-       * @see ParseSchema(), ParseSchemaString()\r
-       */\r
-       function ParseSchemaFile( $filename, $returnSchema = FALSE ) {\r
-               // Open the file\r
-               if( !($fp = fopen( $filename, 'r' )) ) {\r
-                       // die( 'Unable to open file' );\r
-                       return FALSE;\r
-               }\r
-               \r
-               // do version detection here\r
-               if( $this->SchemaFileVersion( $filename ) != $this->schemaVersion ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               if ( $returnSchema )\r
-               {\r
-                       return $xmlstring;\r
-               }\r
-               \r
-               $this->success = 2;\r
-               \r
-               $xmlParser = $this->create_parser();\r
-               \r
-               // Process the file\r
-               while( $data = fread( $fp, 4096 ) ) {\r
-                       if( !xml_parse( $xmlParser, $data, feof( $fp ) ) ) {\r
-                               die( sprintf(\r
-                                       "XML error: %s at line %d",\r
-                                       xml_error_string( xml_get_error_code( $xmlParser) ),\r
-                                       xml_get_current_line_number( $xmlParser)\r
-                               ) );\r
-                       }\r
-               }\r
-               \r
-               xml_parser_free( $xmlParser );\r
-               \r
-               return $this->sqlArray;\r
-       }\r
-       \r
-       /**\r
-       * Converts an XML schema string to SQL.\r
-       *\r
-       * Call this method to parse a string containing an XML schema (see the DTD for the proper format)\r
-       * and generate the SQL necessary to create the database described by the schema. \r
-       * @see ParseSchema()\r
-       *\r
-       * @param string $xmlstring XML schema string.\r
-       * @param bool $returnSchema Return schema rather than parsing.\r
-       * @return array Array of SQL queries, ready to execute.\r
-       */\r
-       function ParseSchemaString( $xmlstring, $returnSchema = FALSE ) {\r
-               if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               // do version detection here\r
-               if( $this->SchemaStringVersion( $xmlstring ) != $this->schemaVersion ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               if ( $returnSchema )\r
-               {\r
-                       return $xmlstring;\r
-               }\r
-               \r
-               $this->success = 2;\r
-               \r
-               $xmlParser = $this->create_parser();\r
-               \r
-               if( !xml_parse( $xmlParser, $xmlstring, TRUE ) ) {\r
-                       die( sprintf(\r
-                               "XML error: %s at line %d",\r
-                               xml_error_string( xml_get_error_code( $xmlParser) ),\r
-                               xml_get_current_line_number( $xmlParser)\r
-                       ) );\r
-               }\r
-               \r
-               xml_parser_free( $xmlParser );\r
-               \r
-               return $this->sqlArray;\r
-       }\r
-       \r
-       /**\r
-       * Loads an XML schema from a file and converts it to uninstallation SQL.\r
-       *\r
-       * Call this method to load the specified schema (see the DTD for the proper format) from\r
-       * the filesystem and generate the SQL necessary to remove the database described.\r
-       * @see RemoveSchemaString()\r
-       *\r
-       * @param string $file Name of XML schema file.\r
-       * @param bool $returnSchema Return schema rather than parsing.\r
-       * @return array Array of SQL queries, ready to execute\r
-       */\r
-       function RemoveSchema( $filename, $returnSchema = FALSE ) {\r
-               return $this->RemoveSchemaString( $this->ConvertSchemaFile( $filename ), $returnSchema );\r
-       }\r
-       \r
-       /**\r
-       * Converts an XML schema string to uninstallation SQL.\r
-       *\r
-       * Call this method to parse a string containing an XML schema (see the DTD for the proper format)\r
-       * and generate the SQL necessary to uninstall the database described by the schema. \r
-       * @see RemoveSchema()\r
-       *\r
-       * @param string $schema XML schema string.\r
-       * @param bool $returnSchema Return schema rather than parsing.\r
-       * @return array Array of SQL queries, ready to execute.\r
-       */\r
-       function RemoveSchemaString( $schema, $returnSchema = FALSE ) {\r
-               \r
-               // grab current version\r
-               if( !( $version = $this->SchemaStringVersion( $schema ) ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               return $this->ParseSchemaString( $this->TransformSchema( $schema, 'remove-' . $version), $returnSchema );\r
-       }\r
-       \r
-       /**\r
-       * Applies the current XML schema to the database (post execution).\r
-       *\r
-       * Call this method to apply the current schema (generally created by calling \r
-       * ParseSchema() or ParseSchemaString() ) to the database (creating the tables, indexes, \r
-       * and executing other SQL specified in the schema) after parsing.\r
-       * @see ParseSchema(), ParseSchemaString(), ExecuteInline()\r
-       *\r
-       * @param array $sqlArray Array of SQL statements that will be applied rather than\r
-       *               the current schema.\r
-       * @param boolean $continueOnErr Continue to apply the schema even if an error occurs.\r
-       * @returns integer 0 if failure, 1 if errors, 2 if successful.\r
-       */\r
-       function ExecuteSchema( $sqlArray = NULL, $continueOnErr =  NULL ) {\r
-               if( !is_bool( $continueOnErr ) ) {\r
-                       $continueOnErr = $this->ContinueOnError();\r
-               }\r
-               \r
-               if( !isset( $sqlArray ) ) {\r
-                       $sqlArray = $this->sqlArray;\r
-               }\r
-               \r
-               if( !is_array( $sqlArray ) ) {\r
-                       $this->success = 0;\r
-               } else {\r
-                       $this->success = $this->dict->ExecuteSQLArray( $sqlArray, $continueOnErr );\r
-               }\r
-               \r
-               return $this->success;\r
-       }\r
-       \r
-       /**\r
-       * Returns the current SQL array. \r
-       *\r
-       * Call this method to fetch the array of SQL queries resulting from \r
-       * ParseSchema() or ParseSchemaString(). \r
-       *\r
-       * @param string $format Format: HTML, TEXT, or NONE (PHP array)\r
-       * @return array Array of SQL statements or FALSE if an error occurs\r
-       */\r
-       function PrintSQL( $format = 'NONE' ) {\r
-               return $this->getSQL( $format, $sqlArray );\r
-       }\r
-       \r
-       /**\r
-       * Saves the current SQL array to the local filesystem as a list of SQL queries.\r
-       *\r
-       * Call this method to save the array of SQL queries (generally resulting from a\r
-       * parsed XML schema) to the filesystem.\r
-       *\r
-       * @param string $filename Path and name where the file should be saved.\r
-       * @return boolean TRUE if save is successful, else FALSE. \r
-       */\r
-       function SaveSQL( $filename = './schema.sql' ) {\r
-               \r
-               if( !isset( $sqlArray ) ) {\r
-                       $sqlArray = $this->sqlArray;\r
-               }\r
-               if( !isset( $sqlArray ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               $fp = fopen( $filename, "w" );\r
-               \r
-               foreach( $sqlArray as $key => $query ) {\r
-                       fwrite( $fp, $query . ";\n" );\r
-               }\r
-               fclose( $fp );\r
-       }\r
-       \r
-       /**\r
-       * Create an xml parser\r
-       *\r
-       * @return object PHP XML parser object\r
-       *\r
-       * @access private\r
-       */\r
-       function &create_parser() {\r
-               // Create the parser\r
-               $xmlParser = xml_parser_create();\r
-               xml_set_object( $xmlParser, $this );\r
-               \r
-               // Initialize the XML callback functions\r
-               xml_set_element_handler( $xmlParser, '_tag_open', '_tag_close' );\r
-               xml_set_character_data_handler( $xmlParser, '_tag_cdata' );\r
-               \r
-               return $xmlParser;\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process start elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_open( &$parser, $tag, $attributes ) {\r
-               switch( strtoupper( $tag ) ) {\r
-                       case 'TABLE':\r
-                               $this->obj = new dbTable( $this, $attributes );\r
-                               xml_set_object( $parser, $this->obj );\r
-                               break;\r
-                       case 'SQL':\r
-                               if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {\r
-                                       $this->obj = new dbQuerySet( $this, $attributes );\r
-                                       xml_set_object( $parser, $this->obj );\r
-                               }\r
-                               break;\r
-                       default:\r
-                               // print_r( array( $tag, $attributes ) );\r
-               }\r
-               \r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process CDATA elements\r
-       *\r
-       * @access private\r
-       */\r
-       function _tag_cdata( &$parser, $cdata ) {\r
-       }\r
-       \r
-       /**\r
-       * XML Callback to process end elements\r
-       *\r
-       * @access private\r
-       * @internal\r
-       */\r
-       function _tag_close( &$parser, $tag ) {\r
-               \r
-       }\r
-       \r
-       /**\r
-       * Converts an XML schema string to the specified DTD version.\r
-       *\r
-       * Call this method to convert a string containing an XML schema to a different AXMLS\r
-       * DTD version. For instance, to convert a schema created for an pre-1.0 version for \r
-       * AXMLS (DTD version 0.1) to a newer version of the DTD (e.g. 0.2). If no DTD version \r
-       * parameter is specified, the schema will be converted to the current DTD version. \r
-       * If the newFile parameter is provided, the converted schema will be written to the specified\r
-       * file.\r
-       * @see ConvertSchemaFile()\r
-       *\r
-       * @param string $schema String containing XML schema that will be converted.\r
-       * @param string $newVersion DTD version to convert to.\r
-       * @param string $newFile File name of (converted) output file.\r
-       * @return string Converted XML schema or FALSE if an error occurs.\r
-       */\r
-       function ConvertSchemaString( $schema, $newVersion = NULL, $newFile = NULL ) {\r
-               \r
-               // grab current version\r
-               if( !( $version = $this->SchemaStringVersion( $schema ) ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               if( !isset ($newVersion) ) {\r
-                       $newVersion = $this->schemaVersion;\r
-               }\r
-               \r
-               if( $version == $newVersion ) {\r
-                       $result = $schema;\r
-               } else {\r
-                       $result = $this->TransformSchema( $schema, 'convert-' . $version . '-' . $newVersion);\r
-               }\r
-               \r
-               if( is_string( $result ) AND is_string( $newFile ) AND ( $fp = fopen( $newFile, 'w' ) ) ) {\r
-                       fwrite( $fp, $result );\r
-                       fclose( $fp );\r
-               }\r
-               \r
-               return $result;\r
-       }\r
-       \r
-       /**\r
-       * Converts an XML schema file to the specified DTD version.\r
-       *\r
-       * Call this method to convert the specified XML schema file to a different AXMLS\r
-       * DTD version. For instance, to convert a schema created for an pre-1.0 version for \r
-       * AXMLS (DTD version 0.1) to a newer version of the DTD (e.g. 0.2). If no DTD version \r
-       * parameter is specified, the schema will be converted to the current DTD version. \r
-       * If the newFile parameter is provided, the converted schema will be written to the specified\r
-       * file.\r
-       * @see ConvertSchemaString()\r
-       *\r
-       * @param string $filename Name of XML schema file that will be converted.\r
-       * @param string $newVersion DTD version to convert to.\r
-       * @param string $newFile File name of (converted) output file.\r
-       * @return string Converted XML schema or FALSE if an error occurs.\r
-       */\r
-       function ConvertSchemaFile( $filename, $newVersion = NULL, $newFile = NULL ) {\r
-               \r
-               // grab current version\r
-               if( !( $version = $this->SchemaFileVersion( $filename ) ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               if( !isset ($newVersion) ) {\r
-                       $newVersion = $this->schemaVersion;\r
-               }\r
-               \r
-               if( $version == $newVersion ) {\r
-                       $result = file_get_contents( $filename );\r
-                       \r
-                       // remove unicode BOM if present\r
-                       if( substr( $result, 0, 3 ) == sprintf( '%c%c%c', 239, 187, 191 ) ) {\r
-                               $result = substr( $result, 3 );\r
-                       }\r
-               } else {\r
-                       $result = $this->TransformSchema( $filename, 'convert-' . $version . '-' . $newVersion, 'file' );\r
-               }\r
-               \r
-               if( is_string( $result ) AND is_string( $newFile ) AND ( $fp = fopen( $newFile, 'w' ) ) ) {\r
-                       fwrite( $fp, $result );\r
-                       fclose( $fp );\r
-               }\r
-               \r
-               return $result;\r
-       }\r
-       \r
-       function TransformSchema( $schema, $xsl, $schematype='string' )\r
-       {\r
-               // Fail if XSLT extension is not available\r
-               if( ! function_exists( 'xslt_create' ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               $xsl_file = dirname( __FILE__ ) . '/xsl/' . $xsl . '.xsl';\r
-               \r
-               // look for xsl\r
-               if( !is_readable( $xsl_file ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               switch( $schematype )\r
-               {\r
-                       case 'file':\r
-                               if( !is_readable( $schema ) ) {\r
-                                       return FALSE;\r
-                               }\r
-                               \r
-                               $schema = file_get_contents( $schema );\r
-                               break;\r
-                       case 'string':\r
-                       default:\r
-                               if( !is_string( $schema ) ) {\r
-                                       return FALSE;\r
-                               }\r
-               }\r
-               \r
-               $arguments = array (\r
-                       '/_xml' => $schema,\r
-                       '/_xsl' => file_get_contents( $xsl_file )\r
-               );\r
-               \r
-               // create an XSLT processor\r
-               $xh = xslt_create ();\r
-               \r
-               // set error handler\r
-               xslt_set_error_handler ($xh, array (&$this, 'xslt_error_handler'));\r
-               \r
-               // process the schema\r
-               $result = xslt_process ($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); \r
-               \r
-               xslt_free ($xh);\r
-               \r
-               return $result;\r
-       }\r
-       \r
-       /**\r
-       * Processes XSLT transformation errors\r
-       *\r
-       * @param object $parser XML parser object\r
-       * @param integer $errno Error number\r
-       * @param integer $level Error level\r
-       * @param array $fields Error information fields\r
-       *\r
-       * @access private\r
-       */\r
-       function xslt_error_handler( $parser, $errno, $level, $fields ) {\r
-               if( is_array( $fields ) ) {\r
-                       $msg = array(\r
-                               'Message Type' => ucfirst( $fields['msgtype'] ),\r
-                               'Message Code' => $fields['code'],\r
-                               'Message' => $fields['msg'],\r
-                               'Error Number' => $errno,\r
-                               'Level' => $level\r
-                       );\r
-                       \r
-                       switch( $fields['URI'] ) {\r
-                               case 'arg:/_xml':\r
-                                       $msg['Input'] = 'XML';\r
-                                       break;\r
-                               case 'arg:/_xsl':\r
-                                       $msg['Input'] = 'XSL';\r
-                                       break;\r
-                               default:\r
-                                       $msg['Input'] = $fields['URI'];\r
-                       }\r
-                       \r
-                       $msg['Line'] = $fields['line'];\r
-               } else {\r
-                       $msg = array(\r
-                               'Message Type' => 'Error',\r
-                               'Error Number' => $errno,\r
-                               'Level' => $level,\r
-                               'Fields' => var_export( $fields, TRUE )\r
-                       );\r
-               }\r
-               \r
-               $error_details = $msg['Message Type'] . ' in XSLT Transformation' . "\n"\r
-                                          . '<table>' . "\n";\r
-               \r
-               foreach( $msg as $label => $details ) {\r
-                       $error_details .= '<tr><td><b>' . $label . ': </b></td><td>' . htmlentities( $details ) . '</td></tr>' . "\n";\r
-               }\r
-               \r
-               $error_details .= '</table>';\r
-               \r
-               trigger_error( $error_details, E_USER_ERROR );\r
-       }\r
-       \r
-       /**\r
-       * Returns the AXMLS Schema Version of the requested XML schema file.\r
-       *\r
-       * Call this method to obtain the AXMLS DTD version of the requested XML schema file.\r
-       * @see SchemaStringVersion()\r
-       *\r
-       * @param string $filename AXMLS schema file\r
-       * @return string Schema version number or FALSE on error\r
-       */\r
-       function SchemaFileVersion( $filename ) {\r
-               // Open the file\r
-               if( !($fp = fopen( $filename, 'r' )) ) {\r
-                       // die( 'Unable to open file' );\r
-                       return FALSE;\r
-               }\r
-               \r
-               // Process the file\r
-               while( $data = fread( $fp, 4096 ) ) {\r
-                       if( preg_match( $this->versionRegex, $data, $matches ) ) {\r
-                               return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;\r
-                       }\r
-               }\r
-               \r
-               return FALSE;\r
-       }\r
-       \r
-       /**\r
-       * Returns the AXMLS Schema Version of the provided XML schema string.\r
-       *\r
-       * Call this method to obtain the AXMLS DTD version of the provided XML schema string.\r
-       * @see SchemaFileVersion()\r
-       *\r
-       * @param string $xmlstring XML schema string\r
-       * @return string Schema version number or FALSE on error\r
-       */\r
-       function SchemaStringVersion( $xmlstring ) {\r
-               if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {\r
-                       return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;\r
-               }\r
-               \r
-               return FALSE;\r
-       }\r
-       \r
-       /**\r
-       * Extracts an XML schema from an existing database.\r
-       *\r
-       * Call this method to create an XML schema string from an existing database.\r
-       * If the data parameter is set to TRUE, AXMLS will include the data from the database\r
-       * in the schema. \r
-       *\r
-       * @param boolean $data Include data in schema dump\r
-       * @return string Generated XML schema\r
-       */\r
-       function ExtractSchema( $data = FALSE ) {\r
-               $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );\r
-               \r
-               $schema = '<?xml version="1.0"?>' . "\n"\r
-                               . '<schema version="' . $this->schemaVersion . '">' . "\n";\r
-               \r
-               if( is_array( $tables = $this->db->MetaTables( 'TABLES' ) ) ) {\r
-                       foreach( $tables as $table ) {\r
-                               $schema .= '    <table name="' . $table . '">' . "\n";\r
-                               \r
-                               // grab details from database\r
-                               $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE 1=1' );\r
-                               $fields = $this->db->MetaColumns( $table );\r
-                               $indexes = $this->db->MetaIndexes( $table );\r
-                               \r
-                               if( is_array( $fields ) ) {\r
-                                       foreach( $fields as $details ) {\r
-                                               $extra = '';\r
-                                               $content = array();\r
-                                               \r
-                                               if( $details->max_length > 0 ) {\r
-                                                       $extra .= ' size="' . $details->max_length . '"';\r
-                                               }\r
-                                               \r
-                                               if( $details->primary_key ) {\r
-                                                       $content[] = '<KEY/>';\r
-                                               } elseif( $details->not_null ) {\r
-                                                       $content[] = '<NOTNULL/>';\r
-                                               }\r
-                                               \r
-                                               if( $details->has_default ) {\r
-                                                       $content[] = '<DEFAULT value="' . $details->default_value . '"/>';\r
-                                               }\r
-                                               \r
-                                               if( $details->auto_increment ) {\r
-                                                       $content[] = '<AUTOINCREMENT/>';\r
-                                               }\r
-                                               \r
-                                               // this stops the creation of 'R' columns,\r
-                                               // AUTOINCREMENT is used to create auto columns\r
-                                               $details->primary_key = 0;\r
-                                               $type = $rs->MetaType( $details );\r
-                                               \r
-                                               $schema .= '            <field name="' . $details->name . '" type="' . $type . '"' . $extra . '>';\r
-                                               \r
-                                               if( !empty( $content ) ) {\r
-                                                       $schema .= "\n                  " . implode( "\n                        ", $content ) . "\n             ";\r
-                                               }\r
-                                               \r
-                                               $schema .= '</field>' . "\n";\r
-                                       }\r
-                               }\r
-                               \r
-                               if( is_array( $indexes ) ) {\r
-                                       foreach( $indexes as $index => $details ) {\r
-                                               $schema .= '            <index name="' . $index . '">' . "\n";\r
-                                               \r
-                                               if( $details['unique'] ) {\r
-                                                       $schema .= '                    <UNIQUE/>' . "\n";\r
-                                               }\r
-                                               \r
-                                               foreach( $details['columns'] as $column ) {\r
-                                                       $schema .= '                    <col>' . $column . '</col>' . "\n";\r
-                                               }\r
-                                               \r
-                                               $schema .= '            </index>' . "\n";\r
-                                       }\r
-                               }\r
-                               \r
-                               if( $data ) {\r
-                                       $rs = $this->db->Execute( 'SELECT * FROM ' . $table );\r
-                                       \r
-                                       if( is_object( $rs ) ) {\r
-                                               $schema .= '            <data>' . "\n";\r
-                                               \r
-                                               while( $row = $rs->FetchRow() ) {\r
-                                                       foreach( $row as $key => $val ) {\r
-                                                               $row[$key] = htmlentities($val);\r
-                                                       }\r
-                                                       \r
-                                                       $schema .= '                    <row><f>' . implode( '</f><f>', $row ) . '</f></row>' . "\n";\r
-                                               }\r
-                                               \r
-                                               $schema .= '            </data>' . "\n";\r
-                                       }\r
-                               }\r
-                               \r
-                               $schema .= '    </table>' . "\n";\r
-                       }\r
-               }\r
-               \r
-               $this->db->SetFetchMode( $old_mode );\r
-               \r
-               $schema .= '</schema>';\r
-               return $schema;\r
-       }\r
-       \r
-       /**\r
-       * Sets a prefix for database objects\r
-       *\r
-       * Call this method to set a standard prefix that will be prepended to all database tables \r
-       * and indices when the schema is parsed. Calling setPrefix with no arguments clears the prefix.\r
-       *\r
-       * @param string $prefix Prefix that will be prepended.\r
-       * @param boolean $underscore If TRUE, automatically append an underscore character to the prefix.\r
-       * @return boolean TRUE if successful, else FALSE\r
-       */\r
-       function SetPrefix( $prefix = '', $underscore = TRUE ) {\r
-               switch( TRUE ) {\r
-                       // clear prefix\r
-                       case empty( $prefix ):\r
-                               logMsg( 'Cleared prefix' );\r
-                               $this->objectPrefix = '';\r
-                               return TRUE;\r
-                       // prefix too long\r
-                       case strlen( $prefix ) > XMLS_PREFIX_MAXLEN:\r
-                       // prefix contains invalid characters\r
-                       case !preg_match( '/^[a-z][a-z0-9_]+$/i', $prefix ):\r
-                               logMsg( 'Invalid prefix: ' . $prefix );\r
-                               return FALSE;\r
-               }\r
-               \r
-               if( $underscore AND substr( $prefix, -1 ) != '_' ) {\r
-                       $prefix .= '_';\r
-               }\r
-               \r
-               // prefix valid\r
-               logMsg( 'Set prefix: ' . $prefix );\r
-               $this->objectPrefix = $prefix;\r
-               return TRUE;\r
-       }\r
-       \r
-       /**\r
-       * Returns an object name with the current prefix prepended.\r
-       *\r
-       * @param string $name Name\r
-       * @return string        Prefixed name\r
-       *\r
-       * @access private\r
-       */\r
-       function prefix( $name = '' ) {\r
-               // if prefix is set\r
-               if( !empty( $this->objectPrefix ) ) {\r
-                       // Prepend the object prefix to the table name\r
-                       // prepend after quote if used\r
-                       return preg_replace( '/^(`?)(.+)$/', '$1' . $this->objectPrefix . '$2', $name );\r
-               }\r
-               \r
-               // No prefix set. Use name provided.\r
-               return $name;\r
-       }\r
-       \r
-       /**\r
-       * Checks if element references a specific platform\r
-       *\r
-       * @param string $platform Requested platform\r
-       * @returns boolean TRUE if platform check succeeds\r
-       *\r
-       * @access private\r
-       */\r
-       function supportedPlatform( $platform = NULL ) {\r
-               $regex = '/^(\w*\|)*' . $this->db->databaseType . '(\|\w*)*$/';\r
-               \r
-               if( !isset( $platform ) OR preg_match( $regex, $platform ) ) {\r
-                       logMsg( "Platform $platform is supported" );\r
-                       return TRUE;\r
-               } else {\r
-                       logMsg( "Platform $platform is NOT supported" );\r
-                       return FALSE;\r
-               }\r
-       }\r
-       \r
-       /**\r
-       * Clears the array of generated SQL.\r
-       *\r
-       * @access private\r
-       */\r
-       function clearSQL() {\r
-               $this->sqlArray = array();\r
-       }\r
-       \r
-       /**\r
-       * Adds SQL into the SQL array.\r
-       *\r
-       * @param mixed $sql SQL to Add\r
-       * @return boolean TRUE if successful, else FALSE.\r
-       *\r
-       * @access private\r
-       */      \r
-       function addSQL( $sql = NULL ) {\r
-               if( is_array( $sql ) ) {\r
-                       foreach( $sql as $line ) {\r
-                               $this->addSQL( $line );\r
-                       }\r
-                       \r
-                       return TRUE;\r
-               }\r
-               \r
-               if( is_string( $sql ) ) {\r
-                       $this->sqlArray[] = $sql;\r
-                       \r
-                       // if executeInline is enabled, and either no errors have occurred or continueOnError is enabled, execute SQL.\r
-                       if( $this->ExecuteInline() && ( $this->success == 2 || $this->ContinueOnError() ) ) {\r
-                               $saved = $this->db->debug;\r
-                               $this->db->debug = $this->debug;\r
-                               $ok = $this->db->Execute( $sql );\r
-                               $this->db->debug = $saved;\r
-                               \r
-                               if( !$ok ) {\r
-                                       if( $this->debug ) {\r
-                                               ADOConnection::outp( $this->db->ErrorMsg() );\r
-                                       }\r
-                                       \r
-                                       $this->success = 1;\r
-                               }\r
-                       }\r
-                       \r
-                       return TRUE;\r
-               }\r
-               \r
-               return FALSE;\r
-       }\r
-       \r
-       /**\r
-       * Gets the SQL array in the specified format.\r
-       *\r
-       * @param string $format Format\r
-       * @return mixed SQL\r
-       *       \r
-       * @access private\r
-       */\r
-       function getSQL( $format = NULL, $sqlArray = NULL ) {\r
-               if( !is_array( $sqlArray ) ) {\r
-                       $sqlArray = $this->sqlArray;\r
-               }\r
-               \r
-               if( !is_array( $sqlArray ) ) {\r
-                       return FALSE;\r
-               }\r
-               \r
-               switch( strtolower( $format ) ) {\r
-                       case 'string':\r
-                       case 'text':\r
-                               return !empty( $sqlArray ) ? implode( ";\n\n", $sqlArray ) . ';' : '';\r
-                       case'html':\r
-                               return !empty( $sqlArray ) ? nl2br( htmlentities( implode( ";\n\n", $sqlArray ) . ';' ) ) : '';\r
-               }\r
-               \r
-               return $this->sqlArray;\r
-       }\r
-       \r
-       /**\r
-       * Destroys an adoSchema object.\r
-       *\r
-       * Call this method to clean up after an adoSchema object that is no longer in use.\r
-       * @deprecated adoSchema now cleans up automatically.\r
-       */\r
-       function Destroy() {\r
-               set_magic_quotes_runtime( $this->mgq );\r
-               unset( $this );\r
-       }\r
-}\r
-\r
-/**\r
-* Message logging function\r
-*\r
-* @access private\r
-*/\r
-function logMsg( $msg, $title = NULL, $force = FALSE ) {\r
-       if( XMLS_DEBUG or $force ) {\r
-               echo '<pre>';\r
-               \r
-               if( isset( $title ) ) {\r
-                       echo '<h3>' . htmlentities( $title ) . '</h3>';\r
-               }\r
-               \r
-               if( is_object( $this ) ) {\r
-                       echo '[' . get_class( $this ) . '] ';\r
-               }\r
-               \r
-               print_r( $msg );\r
-               \r
-               echo '</pre>';\r
-       }\r
-}\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/pivottable.inc.php b/libraries/adodb/pivottable.inc.php
deleted file mode 100644 (file)
index 48788e6..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php\r
-/** \r
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license. \r
- * Whenever there is any discrepancy between the two licenses, \r
- * the BSD license will take precedence. \r
- *\r
- * Set tabs to 4 for best viewing.\r
- * \r
- * Latest version is available at http://php.weblogs.com\r
- *\r
- * Requires PHP4.01pl2 or later because it uses include_once\r
-*/\r
-\r
-/*\r
- * Concept from daniel.lucazeau@ajornet.com. \r
- *\r
- * @param db           Adodb database connection\r
- * @param tables       List of tables to join\r
- * @rowfields          List of fields to display on each row\r
- * @colfield           Pivot field to slice and display in columns, if we want to calculate\r
- *                                             ranges, we pass in an array (see example2)\r
- * @where                      Where clause. Optional.\r
- * @aggfield           This is the field to sum. Optional. \r
- *                                             Since 2.3.1, if you can use your own aggregate function \r
- *                                             instead of SUM, eg. $sumfield = 'AVG(fieldname)';\r
- * @sumlabel           Prefix to display in sum columns. Optional.\r
- * @aggfn                      Aggregate function to use (could be AVG, SUM, COUNT)\r
- * @showcount          Show count of records\r
- *\r
- * @returns                    Sql generated\r
- */\r
\r
- function PivotTableSQL($db,$tables,$rowfields,$colfield, $where=false,\r
-       $aggfield = false,$sumlabel='Sum ',$aggfn ='SUM', $showcount = true)\r
- {\r
-       if ($aggfield) $hidecnt = true;\r
-       else $hidecnt = false;\r
-       \r
-       $iif = strpos($db->databaseType,'access') !== false; \r
-               // note - vfp still doesn' work even with IIF enabled || $db->databaseType == 'vfp';\r
-       \r
-       //$hidecnt = false;\r
-       \r
-       if ($where) $where = "\nWHERE $where";\r
-       if (!is_array($colfield)) $colarr = $db->GetCol("select distinct $colfield from $tables $where order by 1");\r
-       if (!$aggfield) $hidecnt = false;\r
-       \r
-       $sel = "$rowfields, ";\r
-       if (is_array($colfield)) {\r
-               foreach ($colfield as $k => $v) {\r
-                       $k = trim($k);\r
-                       if (!$hidecnt) {\r
-                               $sel .= $iif ? \r
-                                       "\n\t$aggfn(IIF($v,1,0)) AS \"$k\", "\r
-                                       :\r
-                                       "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";\r
-                       }\r
-                       if ($aggfield) {\r
-                               $sel .= $iif ?\r
-                                       "\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", "\r
-                                       :\r
-                                       "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";\r
-                       }\r
-               } \r
-       } else {\r
-               foreach ($colarr as $v) {\r
-                       if (!is_numeric($v)) $vq = $db->qstr($v);\r
-                       else $vq = $v;\r
-                       $v = trim($v);\r
-                       if (strlen($v) == 0     ) $v = 'null';\r
-                       if (!$hidecnt) {\r
-                               $sel .= $iif ?\r
-                                       "\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", "\r
-                                       :\r
-                                       "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";\r
-                       }\r
-                       if ($aggfield) {\r
-                               if ($hidecnt) $label = $v;\r
-                               else $label = "{$v}_$aggfield";\r
-                               $sel .= $iif ?\r
-                                       "\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", "\r
-                                       :\r
-                                       "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";\r
-                       }\r
-               }\r
-       }\r
-       if ($aggfield && $aggfield != '1'){\r
-               $agg = "$aggfn($aggfield)";\r
-               $sel .= "\n\t$agg as \"$sumlabel$aggfield\", ";         \r
-       }\r
-       \r
-       if ($showcount)\r
-               $sel .= "\n\tSUM(1) as Total";\r
-       else\r
-               $sel = substr($sel,0,strlen($sel)-2);\r
-       \r
-       $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields";\r
-       return $sql;\r
- }\r
-\r
-/* EXAMPLES USING MS NORTHWIND DATABASE */\r
-if (0) {\r
-\r
-# example1\r
-#\r
-# Query the main "product" table\r
-# Set the rows to CompanyName and QuantityPerUnit\r
-# and the columns to the Categories\r
-# and define the joins to link to lookup tables \r
-# "categories" and "suppliers"\r
-#\r
-\r
- $sql = PivotTableSQL(\r
-       $gDB,                                                                                   # adodb connection\r
-       'products p ,categories c ,suppliers s',                # tables\r
-       'CompanyName,QuantityPerUnit',                                  # row fields\r
-       'CategoryName',                                                                 # column fields \r
-       'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where\r
-);\r
- print "<pre>$sql";\r
- $rs = $gDB->Execute($sql);\r
- rs2html($rs);\r
\r
-/*\r
-Generated SQL:\r
-\r
-SELECT CompanyName,QuantityPerUnit, \r
-       SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages", \r
-       SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS "Condiments", \r
-       SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS "Confections", \r
-       SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS "Dairy Products", \r
-       SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS "Grains/Cereals", \r
-       SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS "Meat/Poultry", \r
-       SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS "Produce", \r
-       SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS "Seafood", \r
-       SUM(1) as Total \r
-FROM products p ,categories c ,suppliers s  WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID \r
-GROUP BY CompanyName,QuantityPerUnit\r
-*/\r
-//=====================================================================\r
-\r
-# example2\r
-#\r
-# Query the main "product" table\r
-# Set the rows to CompanyName and QuantityPerUnit\r
-# and the columns to the UnitsInStock for diiferent ranges\r
-# and define the joins to link to lookup tables \r
-# "categories" and "suppliers"\r
-#\r
- $sql = PivotTableSQL(\r
-       $gDB,                                                                           # adodb connection\r
-       'products p ,categories c ,suppliers s',        # tables\r
-       'CompanyName,QuantityPerUnit',                          # row fields\r
-                                                                                               # column ranges\r
-array(                                                                         \r
-' 0 ' => 'UnitsInStock <= 0',\r
-"1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5',\r
-"6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10',\r
-"11 to 15"  => '10 < UnitsInStock and UnitsInStock <= 15',\r
-"16+" =>'15 < UnitsInStock'\r
-),\r
-       ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where\r
-       'UnitsInStock',                                                         # sum this field\r
-       'Sum'                                                                           # sum label prefix\r
-);\r
- print "<pre>$sql";\r
- $rs = $gDB->Execute($sql);\r
- rs2html($rs);\r
- /*\r
- Generated SQL:\r
\r
-SELECT CompanyName,QuantityPerUnit, \r
-       SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS "Sum  0 ", \r
-       SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN UnitsInStock ELSE 0 END) AS "Sum 1 to 5", \r
-       SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock ELSE 0 END) AS "Sum 6 to 10", \r
-       SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN UnitsInStock ELSE 0 END) AS "Sum 11 to 15", \r
-       SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS "Sum 16+",\r
-       SUM(UnitsInStock) AS "Sum UnitsInStock", \r
-       SUM(1) as Total \r
-FROM products p ,categories c ,suppliers s  WHERE  p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID \r
-GROUP BY CompanyName,QuantityPerUnit\r
- */\r
-}\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/rsfilter.inc.php b/libraries/adodb/rsfilter.inc.php
deleted file mode 100644 (file)
index 9d20a53..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php\r
-/** \r
- * @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.\r
- * Released under both BSD license and Lesser GPL library license. \r
- * Whenever there is any discrepancy between the two licenses, \r
- * the BSD license will take precedence. \r
- *\r
- * Set tabs to 4 for best viewing.\r
- * \r
- * Latest version is available at http://php.weblogs.com\r
- *\r
- * Requires PHP4.01pl2 or later because it uses include_once\r
-*/\r
-\r
-/*\r
-       Filter all fields and all rows in a recordset and returns the \r
-       processed recordset. We scroll to the beginning of the new recordset\r
-       after processing.\r
-       \r
-       We pass a recordset and function name to RSFilter($rs,'rowfunc');\r
-       and the function will be called multiple times, once\r
-       for each row in the recordset. The function will be passed\r
-       an array containing one row repeatedly.\r
-       \r
-       Example: \r
-       \r
-       // ucwords() every element in the recordset\r
-       function do_ucwords(&$arr,$rs)\r
-       {\r
-               foreach($arr as $k => $v) {\r
-                       $arr[$k] = ucwords($v);\r
-               }\r
-       }\r
-       $rs = RSFilter($rs,'do_ucwords');\r
- */\r
-function &RSFilter($rs,$fn)\r
-{\r
-       if ($rs->databaseType != 'array') {\r
-               if (!$rs->connection) return false;\r
-               \r
-               $rs = &$rs->connection->_rs2rs($rs);\r
-       }\r
-       $rows = $rs->RecordCount();\r
-       for ($i=0; $i < $rows; $i++) {\r
-               if (is_array ($fn)) {\r
-               $obj = $fn[0];\r
-               $method = $fn[1];\r
-               $obj->$method ($rs->_array[$i],$rs);\r
-      } else {\r
-                       $fn($rs->_array[$i],$rs);\r
-      }\r
-         \r
-       }\r
-       if (!$rs->EOF) {\r
-               $rs->_currentRow = 0;\r
-               $rs->fields = $rs->_array[0];\r
-       }\r
-       \r
-       return $rs;\r
-}\r
-?>
\ No newline at end of file
diff --git a/libraries/adodb/xmlschema.dtd b/libraries/adodb/xmlschema.dtd
deleted file mode 100755 (executable)
index 5aa2350..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>\r
-<!DOCTYPE adodb_schema [\r
-<!ELEMENT schema (table*, sql*)>\r
-<!ATTLIST schema version CDATA #REQUIRED>\r
-<!ELEMENT table ((field+|DROP), constraint*, descr?, index*, data*)>\r
-<!ELEMENT field ((NOTNULL|KEY|PRIMARY)?, (AUTO|AUTOINCREMENT)?, (DEFAULT|DEFDATE|DEFTIMESTAMP)?, NOQUOTE, constraint, descr?)>\r
-<!ELEMENT data (row+)>\r
-<!ELEMENT row (f+)>\r
-<!ELEMENT f (#CDATA)>\r
-<!ELEMENT descr (#CDATA)>\r
-<!ELEMENT NOTNULL EMPTY>\r
-<!ELEMENT KEY EMPTY>\r
-<!ELEMENT PRIMARY EMPTY>\r
-<!ELEMENT AUTO EMPTY>\r
-<!ELEMENT AUTOINCREMENT EMPTY>\r
-<!ELEMENT DEFAULT EMPTY>\r
-<!ELEMENT DEFDATE EMPTY>\r
-<!ELEMENT DEFTIMESTAMP EMPTY>\r
-<!ELEMENT NOQUOTE EMPTY>\r
-<!ELEMENT DROP EMPTY>\r
-<!ELEMENT constraint (#CDATA)>\r
-<!ATTLIST table name CDATA #REQUIRED platform CDATA #IMPLIED version CDATA #IMPLIED>\r
-<!ATTLIST field name CDATA #REQUIRED type (C|C2|X|X2|B|D|T|L|I|F|N) #REQUIRED size CDATA #IMPLIED>\r
-<!ATTLIST data platform CDATA #IMPLIED>\r
-<!ATTLIST f name CDATA #IMPLIED>\r
-<!ATTLIST DEFAULT value CDATA #REQUIRED>\r
-<!ELEMENT index ((col+|DROP), CLUSTERED?, BITMAP?, UNIQUE?, FULLTEXT?, HASH?, descr?)>\r
-<!ELEMENT col (#CDATA)>\r
-<!ELEMENT CLUSTERED EMPTY>\r
-<!ELEMENT BITMAP EMPTY>\r
-<!ELEMENT UNIQUE EMPTY>\r
-<!ELEMENT FULLTEXT EMPTY>\r
-<!ELEMENT HASH EMPTY>\r
-<!ATTLIST index name CDATA #REQUIRED platform CDATA #IMPLIED>\r
-<!ELEMENT sql (query+, descr?)>\r
-<!ELEMENT query (#CDATA)>\r
-<!ATTLIST sql name CDATA #IMPLIED platform CDATA #IMPLIED, key CDATA, prefixmethod (AUTO|MANUAL|NONE) >\r
-] >\r