ea-Geieradmin
[ class tree: ea-Geier ] [ index: ea-Geier ] [ all elements ]

Source for file sqldemo.php

Documentation is available at sqldemo.php

  1. <?php 
  2. /**
  3.  * admin functions for sql database demo entries
  4.  *
  5.  * LICENSE:
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the
  13.  * GNU General Public License for more details.
  14.  * You should have received a copy of the GNU General Public License along
  15.  * with this program; if not, write to the Free Software Foundation, Inc.,
  16.  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17.  *
  18.  * @package       ea-Geier
  19.  * @subpackage admin
  20.  * @author       m2mtech <tech@m2m.at>
  21.  * @copyright  2007 m2m server software gmbh
  22.  * @license       http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
  23.  * @version       $Id: sqldemo.php 142 2007-09-02 06:53:02Z m2mtech $
  24.  * @link       http://www.ea-geier.at/
  25.  */
  26.  
  27. chdir('../')// set root directory
  28.  
  29. /**
  30.  * environment configuration
  31.  */
  32. include_once('code/config.php');
  33.  
  34. /**
  35.  * load adobdb libraries
  36.  */
  37. require_once(eaADODB_DIR 'adodb.inc.php');
  38. require_once(eaADODB_DIR 'session/adodb-session2.php');
  39. require_once(eaADODB_DIR 'adodb-xmlschema03.inc.php');
  40.  
  41. /**
  42.  * connect to database
  43.  */
  44. $db ADONewConnection($conf['dsn']);
  45. $db->debug true;
  46. $GLOBALS['ADODB_SESS_CONN'=$db;
  47.  
  48. /**
  49.  * create session table
  50.  */
  51. adodb_session_create_table()
  52.  
  53. /**
  54.  * create tables
  55.  */
  56. $vars array('demo_assets''demo_cashbook''demo_purchasebook''demo_travels''demo_balance');
  57. foreach ($vars as $var{
  58.     $schema new adoSchema($db);
  59.     $schema->ParseSchemaString($schema->ConvertSchemaFile('admin/sql/' $var '.sql'))
  60.     $schema->ContinueOnError(true);
  61.     $schema->ExecuteSchema();
  62. }
  63.  
  64.  
  65. /**
  66.  * output function forwarding to error_log
  67.  *
  68.  * @ignore
  69.  * @param    string    $msg        error message
  70.  * @param    boolean $newline    send new line command
  71.  */
  72. function eaADODBerrorLog($msg$newline true{
  73.     error_log(strip_tags($msg));
  74.     return true;
  75. }
  76.         
  77. ?>

Documentation generated on Sun, 09 Sep 2007 17:09:35 +0200 by phpDocumentor 1.3.1