blob: 14b66c0081a353cba09cf70378d8a0f91effcda8 [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
kitlo1d027092018-04-19 17:44:07 -040020function remember_query($dbh, $sql){
gobriendd79db82008-04-26 00:09:51 +000021 global $spent_quries;
22 $spent_quries[] = $sql;
kitlo2c8d8a92018-04-19 13:25:09 -040023 return mysqli_query($dbh, $sql);
gobriendd79db82008-04-26 00:09:51 +000024}
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/";
kitlo2c8d8a92018-04-19 13:25:09 -040050$context->dbhs['refactor_test'] = mysqli_connect("localhost","root","","refactor_test");
gobriendd79db82008-04-26 00:09:51 +000051
52$check = new CheckAndModifyDatabaseSchema();
53$worked = $check->check_and_modify( $context );
54
55print "\n";
56
57print_r($spent_quries);
58
59?>