PHP Classes

File: setup_test.php

Recommend this page to a friend!
  Classes of Manuel Lemos   Metabase   setup_test.php   Download  
File: setup_test.php
Role: Example script
Content type: text/plain
Description: Test database setup script.
Class: Metabase
PHP Database abstraction layer RDBMS independent
Author: By
Last change: Used a separate file to define configuration values.
Date: 2 years ago
Size: 1,007 bytes
 

Contents

Class file image Download
<?php
/*
 * setup_test.php
 *
 * @(#) $Header: /opt2/ena/metal/metabase/setup_test.php,v 1.8 2021/10/12 11:12:36 mlemos Exp $
 *
 */

   
require("metabase_parser.php");
    require(
"metabase_manager.php");
    require(
"metabase_database.php");
    require(
"metabase_interface.php");
    require(
"xml_parser.php");

Function
Output($message)
{
    echo
$message,"\n";
}

Function
Dump($output)
{
    echo
$output;
}

   
$input_file=($argc<2 ? "test.schema" : $argv[1]);
   
$variables=array(
       
"create"=>"1"
   
);
   
$arguments = require('configuration.php');
   
$manager=new metabase_manager_class;
   
$manager->debug="Output";
   
$success=$manager->UpdateDatabase($input_file,$input_file.".before",$arguments,$variables);
    if(
$success)
    {
        echo
$manager->DumpDatabase(array(
           
"Output"=>"Dump",
           
"EndOfLine"=>"\n"
       
));
    }
    else
        echo
"Error: ".$manager->error."\n";
    if(
count($manager->warnings)>0)
        echo
"WARNING:\n",implode($manager->warnings,"!\n"),"\n";
    if(
$manager->database)
        echo
MetabaseDebugOutput($manager->database);

?>