blob: 1c718a09da531b49c93ee337115e3049b488fa9d [file] [log] [blame]
gobriendd79db82008-04-26 00:09:51 +00001<?php
2/*******************************************************************************
3 * Copyright (c) 2007 Eclipse Foundation and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Eclipse Foundation
11*******************************************************************************/
12
13include("check-database-schema.class.php");
14include("abstractschemachecker.class.php");
15
16
17global $spent_quries;
18$spent_quries = array();
19
20function mysql_remember_query($sql,$dbh){
21 global $spent_quries;
22 $spent_quries[] = $sql;
23 return mysql_query($sql,$dbh);
24}
25
26function dirs($path){
27 $dirs = array();
28 $list = scandir($path);
29 foreach($list as $dir){
30 if($dir == "." || $dir == "..")
31 continue;
32 if(is_dir($path.$dir)){
33 $dirs[] = $dir;
34 }
35 }
36
37 return $dirs;
38}
39
40class context{
41 function get($get){
42 return $this->$get;
43 }
44 function database($dbname){
45 return $this->dbhs[$dbname];
46 }
47}
48$context = new context();
49$context->components_directory = "tables/";
50$context->dbhs['refactor_test'] = mysql_connect("localhost","root","","refactor_test");
51
52$check = new CheckAndModifyDatabaseSchema();
53$worked = $check->check_and_modify( $context );
54
55print "\n";
56
57print_r($spent_quries);
58
59?>