summaryrefslogtreecommitdiff
path: root/backend
authorAdam Cozzette <acozzette@cs.hmc.edu>2012-02-05 21:51:07 (UTC)
committer Adam Cozzette <acozzette@cs.hmc.edu>2012-02-05 21:51:07 (UTC)
commitaa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c (patch) (unidiff)
treefd7b52d56d818dcca5605766e728ac004847aede /backend
parentb312e037ebba7c94abea9661bcf62c52b7d73fbf (diff)
downloadclipperz-aa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c.zip
clipperz-aa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c.tar.gz
clipperz-aa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c.tar.bz2
Removing the @ sign in @mysql_connect so that if the MySQL module is not
installed, the Apache log will have an informative error message.
Diffstat (limited to 'backend') (more/less context) (ignore whitespace changes)
-rw-r--r--backend/php/src/setup/index.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/php/src/setup/index.php b/backend/php/src/setup/index.php
index 4087961..93dea6f 100644
--- a/backend/php/src/setup/index.php
+++ b/backend/php/src/setup/index.php
@@ -1,717 +1,717 @@
1<?php 1<?php
2/** 2/**
3* @author Joel Wan & Mark Slemko. Designs by Jonathan Easton 3* @author Joel Wan & Mark Slemko. Designs by Jonathan Easton
4* @link http://www.phpobjectgenerator.com 4* @link http://www.phpobjectgenerator.com
5* @copyright Offered under the BSD license 5* @copyright Offered under the BSD license
6* 6*
7* This setup file does the following: 7* This setup file does the following:
8* 1. Checks if configuration file is present 8* 1. Checks if configuration file is present
9* 2. Checks if the data in the configuration file is correct 9* 2. Checks if the data in the configuration file is correct
10* 3. Checks if the database and table exist 10* 3. Checks if the database and table exist
11* 4. Create table if not present 11* 4. Create table if not present
12* 5. Tests 5 CRUD functions and determine if everything is OK for all objects within the current directory 12* 5. Tests 5 CRUD functions and determine if everything is OK for all objects within the current directory
13* 6. When all tests pass, provides an interface to the database and a way to manage objects. 13* 6. When all tests pass, provides an interface to the database and a way to manage objects.
14*/ 14*/
15if (!isset($_SESSION)) 15if (!isset($_SESSION))
16{ 16{
17 session_start(); 17 session_start();
18} 18}
19if(file_exists("../configuration.php")) 19if(file_exists("../configuration.php"))
20{ 20{
21 include_once("../configuration.php"); 21 include_once("../configuration.php");
22} 22}
23include_once("setup_library/authentication.php"); 23include_once("setup_library/authentication.php");
24include_once("setup_library/setup_misc.php"); 24include_once("setup_library/setup_misc.php");
25include_once("data_initialization/read_dump_lib.php"); 25include_once("data_initialization/read_dump_lib.php");
26if(!isset($_SESSION['diagnosticsSuccessful']) || (isset($_GET['step']) && $_GET['step']=="diagnostics")) 26if(!isset($_SESSION['diagnosticsSuccessful']) || (isset($_GET['step']) && $_GET['step']=="diagnostics"))
27{ 27{
28 $_SESSION['diagnosticsSuccessful'] = false; 28 $_SESSION['diagnosticsSuccessful'] = false;
29} 29}
30?> 30?>
31<?php include "setup_library/inc.header.php";?> 31<?php include "setup_library/inc.header.php";?>
32<?php 32<?php
33ini_set("max_execution_time", 0); 33ini_set("max_execution_time", 0);
34if(count($_POST) > 0 && $_SESSION['diagnosticsSuccessful']==false) 34if(count($_POST) > 0 && $_SESSION['diagnosticsSuccessful']==false)
35{ 35{
36?> 36?>
37<form action="./index.php" method="POST"> 37<form action="./index.php" method="POST">
38<div class="container"> 38<div class="container">
39<div class="left"> 39<div class="left">
40 <div class="logo2"></div> 40 <div class="logo2"></div>
41 <div class="text"><div class="gold">POG setup diagnostics</div> 41 <div class="text"><div class="gold">POG setup diagnostics</div>
42 <br/>Setup performs unit tests on all your objects in the object directory and makes sure they're OK. <br/>This makes sure that your objects can talk to your database correctly. This can also be useful if you modify / customize the objects manually and want to make sure they still work once you're done. 42 <br/>Setup performs unit tests on all your objects in the object directory and makes sure they're OK. <br/>This makes sure that your objects can talk to your database correctly. This can also be useful if you modify / customize the objects manually and want to make sure they still work once you're done.
43 <br/><br/>The diagnostics screen on the right shows the results of those tests. If all tests pass successfully, you can be assured that all objects are working correctly. 43 <br/><br/>The diagnostics screen on the right shows the results of those tests. If all tests pass successfully, you can be assured that all objects are working correctly.
44 </div> 44 </div>
45</div> 45</div>
46<div class="middle"> 46<div class="middle">
47 <div id="tabs"> 47 <div id="tabs">
48 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a> 48 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a>
49 <img src="./setup_images/tab_separator.gif"/> 49 <img src="./setup_images/tab_separator.gif"/>
50 <img src="./setup_images/tab_diagnosticresults_on.gif"/> 50 <img src="./setup_images/tab_diagnosticresults_on.gif"/>
51 <img src="./setup_images/tab_separator.gif"/> 51 <img src="./setup_images/tab_separator.gif"/>
52 <img src="./setup_images/tab_manageobjects.gif"/> 52 <img src="./setup_images/tab_manageobjects.gif"/>
53 <img src="./setup_images/tab_separator.gif"/> 53 <img src="./setup_images/tab_separator.gif"/>
54 <img src="./setup_images/tab_manageplugins_off.gif"/> 54 <img src="./setup_images/tab_manageplugins_off.gif"/>
55 55
56 </div><div class="subtabs">&nbsp;</div><a href="./index.php?step=diagnostics"><img src="./setup_images/setup_recheck.jpg" border="0"/></a><div class="middle2"> 56 </div><div class="subtabs">&nbsp;</div><a href="./index.php?step=diagnostics"><img src="./setup_images/setup_recheck.jpg" border="0"/></a><div class="middle2">
57<?php 57<?php
58 $errors = 0; 58 $errors = 0;
59 AddTrace('Initializing POG Setup....OK!'); 59 AddTrace('Initializing POG Setup....OK!');
60 if (isset($GLOBALS['configuration']['pdoDriver'])) 60 if (isset($GLOBALS['configuration']['pdoDriver']))
61 { 61 {
62 $errors++; 62 $errors++;
63 AddError('POG setup for PHP4/5 objects cannot be run with a PDO configuration file. Regenerate configuration.php'); 63 AddError('POG setup for PHP4/5 objects cannot be run with a PDO configuration file. Regenerate configuration.php');
64 } 64 }
65 else 65 else
66 { 66 {
67 /** 67 /**
68 * verify file structure status 68 * verify file structure status
69 */ 69 */
70 if(!file_exists("../objects/class.database.php")) 70 if(!file_exists("../objects/class.database.php"))
71 { 71 {
72 $errors++; 72 $errors++;
73 AddError('Database wrapper (class.database.php) is missing.'); 73 AddError('Database wrapper (class.database.php) is missing.');
74 } 74 }
75 else 75 else
76 { 76 {
77 include "../objects/class.database.php"; 77 include "../objects/class.database.php";
78 } 78 }
79 if(!file_exists("../objects/class.pog_base.php")) 79 if(!file_exists("../objects/class.pog_base.php"))
80 { 80 {
81 $errors++; 81 $errors++;
82 AddError('POG Base class (class.pog_base.php) is missing.'); 82 AddError('POG Base class (class.pog_base.php) is missing.');
83 } 83 }
84 else 84 else
85 { 85 {
86 include "../objects/class.pog_base.php"; 86 include "../objects/class.pog_base.php";
87 } 87 }
88 if (!file_exists("../configuration.php")) 88 if (!file_exists("../configuration.php"))
89 { 89 {
90 $errors++; 90 $errors++;
91 AddError('Configuration file (configuration.php) is missing'); 91 AddError('Configuration file (configuration.php) is missing');
92 } 92 }
93 if ($GLOBALS['configuration']['plugins_path'] == '') 93 if ($GLOBALS['configuration']['plugins_path'] == '')
94 { 94 {
95 $errors++; 95 $errors++;
96 AddError('Path to plugin folder has not been specified in configuration.php'); 96 AddError('Path to plugin folder has not been specified in configuration.php');
97 } 97 }
98 else 98 else
99 { 99 {
100 if (!file_exists($GLOBALS['configuration']['plugins_path']."/plugin.base64.php")) 100 if (!file_exists($GLOBALS['configuration']['plugins_path']."/plugin.base64.php"))
101 { 101 {
102 $errors++; 102 $errors++;
103 AddError('Base64 plugin file (plugins/plugin.base64.php) is missing'); 103 AddError('Base64 plugin file (plugins/plugin.base64.php) is missing');
104 } 104 }
105 else 105 else
106 { 106 {
107 include_once($GLOBALS['configuration']['plugins_path']."/plugin.base64.php"); 107 include_once($GLOBALS['configuration']['plugins_path']."/plugin.base64.php");
108 } 108 }
109 } 109 }
110 110
111 111
112 112
113 //load object names to be ignored 113 //load object names to be ignored
114 $ignoreObjects = file("../objects/ignore_objects.txt"); 114 $ignoreObjects = file("../objects/ignore_objects.txt");
115 foreach ($ignoreObjects as $key=>$ignoreObject){ 115 foreach ($ignoreObjects as $key=>$ignoreObject){
116 $ignoreObjects[$key] = trim($ignoreObject); 116 $ignoreObjects[$key] = trim($ignoreObject);
117 } 117 }
118 118
119 $dir = opendir('../objects/'); 119 $dir = opendir('../objects/');
120 $objects = array(); 120 $objects = array();
121 while(($file = readdir($dir)) !== false) 121 while(($file = readdir($dir)) !== false)
122 { 122 {
123 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php") 123 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php")
124 { 124 {
125 $objects[] = $file; 125 $objects[] = $file;
126 include_once("../objects/{$file}"); 126 include_once("../objects/{$file}");
127 } 127 }
128 } 128 }
129 closedir($dir); 129 closedir($dir);
130 if (sizeof($objects) == 0) 130 if (sizeof($objects) == 0)
131 { 131 {
132 $errors++; 132 $errors++;
133 AddError("[objects] folder does not contain any POG object."); 133 AddError("[objects] folder does not contain any POG object.");
134 } 134 }
135 135
136 if ($errors == 0) 136 if ($errors == 0)
137 { 137 {
138 $dir = opendir($GLOBALS['configuration']['plugins_path']); 138 $dir = opendir($GLOBALS['configuration']['plugins_path']);
139 $plugins = array(); 139 $plugins = array();
140 140
141 while(($file = readdir($dir)) !== false) 141 while(($file = readdir($dir)) !== false)
142 { 142 {
143 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php")) 143 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php"))
144 { 144 {
145 include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php"); 145 include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php");
146 } 146 }
147 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin') 147 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin')
148 { 148 {
149 include_once($GLOBALS['configuration']['plugins_path']."/{$file}"); 149 include_once($GLOBALS['configuration']['plugins_path']."/{$file}");
150 $pluginName = GetPluginName($file); 150 $pluginName = GetPluginName($file);
151 if ($pluginName != '') 151 if ($pluginName != '')
152 { 152 {
153 $plugins[] = $file; 153 $plugins[] = $file;
154 } 154 }
155 155
156 } 156 }
157 } 157 }
158 closedir($dir); 158 closedir($dir);
159 } 159 }
160 160
161 /** 161 /**
162 * verify configuration info 162 * verify configuration info
163 */ 163 */
164 if ($errors == 0) 164 if ($errors == 0)
165 { 165 {
166 AddTrace('File Structure....OK!'); 166 AddTrace('File Structure....OK!');
167 if (!@mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) 167 if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass']))
168 { 168 {
169 $errors++; 169 $errors++;
170 AddError('Cannot connect to the specified database server. Edit configuration.php'); 170 AddError('Cannot connect to the specified database server. Edit configuration.php');
171 } 171 }
172 if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled()) 172 if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled())
173 { 173 {
174 $errors++; 174 $errors++;
175 AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1'); 175 AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1');
176 } 176 }
177 if ($errors == 0) 177 if ($errors == 0)
178 { 178 {
179 if (!@mysql_select_db ($GLOBALS['configuration']['db'])) 179 if (!@mysql_select_db ($GLOBALS['configuration']['db']))
180 { 180 {
181 $errors++; 181 $errors++;
182 AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php'); 182 AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php');
183 } 183 }
184 } 184 }
185 } 185 }
186 186
187 /** 187 /**
188 * verify storage status 188 * verify storage status
189 */ 189 */
190 190
191 if ($errors == 0) 191 if ($errors == 0)
192 { 192 {
193 AddTrace("Configuration Info....OK!\n"); 193 AddTrace("Configuration Info....OK!\n");
194 AddTrace("Storage Status"); 194 AddTrace("Storage Status");
195 foreach($objects as $object) 195 foreach($objects as $object)
196 { 196 {
197 $objectName = GetObjectName("../objects/".$object); 197 $objectName = GetObjectName("../objects/".$object);
198 eval ('$instance = new '.$objectName.'();'); 198 eval ('$instance = new '.$objectName.'();');
199 if (TestStorageExists($objectName, "mysql")) 199 if (TestStorageExists($objectName, "mysql"))
200 { 200 {
201 if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import")) 201 if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import"))
202 { 202 {
203 if (!TestDeleteStorage($instance)) 203 if (!TestDeleteStorage($instance))
204 { 204 {
205 $errors++; 205 $errors++;
206 AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually."); 206 AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually.");
207 } 207 }
208 else 208 else
209 { 209 {
210 if (!TestCreateStorage("../objects/".$object)) 210 if (!TestCreateStorage("../objects/".$object))
211 { 211 {
212 $errors++; 212 $errors++;
213 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); 213 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header.");
214 } 214 }
215 else 215 else
216 { 216 {
217 AddTrace("\tDropping & Recreating table [".strtolower($objectName)."]....OK!"); 217 AddTrace("\tDropping & Recreating table [".strtolower($objectName)."]....OK!");
218 } 218 }
219 } 219 }
220 } 220 }
221 else 221 else
222 { 222 {
223 if (!TestAlterStorage($instance)) 223 if (!TestAlterStorage($instance))
224 { 224 {
225 $errors++; 225 $errors++;
226 AddError("Aligning [$objectName] with table '".strtolower($objectName)."' failed. Alter the table manually so that object attributes and table columns match."); 226 AddError("Aligning [$objectName] with table '".strtolower($objectName)."' failed. Alter the table manually so that object attributes and table columns match.");
227 } 227 }
228 else 228 else
229 { 229 {
230 AddTrace("\tAligning [$objectName] with table '".strtolower($objectName)."'....OK!"); 230 AddTrace("\tAligning [$objectName] with table '".strtolower($objectName)."'....OK!");
231 } 231 }
232 } 232 }
233 } 233 }
234 else 234 else
235 { 235 {
236 if (!TestCreateStorage("../objects/".$object)) 236 if (!TestCreateStorage("../objects/".$object))
237 { 237 {
238 $errors++; 238 $errors++;
239 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); 239 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header.");
240 } 240 }
241 else 241 else
242 { 242 {
243 AddTrace("\tCreating table [".strtolower($objectName)."]....OK!"); 243 AddTrace("\tCreating table [".strtolower($objectName)."]....OK!");
244 } 244 }
245 } 245 }
246 } 246 }
247 } 247 }
248 248
249 $objectNameList = array(); 249 $objectNameList = array();
250 250
251 /** 251 /**
252 * Initialize test data? 252 * Initialize test data?
253 */ 253 */
254 if (isset($_POST['pog_table']) && $_POST['pog_table'] == 'recreate_import') 254 if (isset($_POST['pog_table']) && $_POST['pog_table'] == 'recreate_import')
255 { 255 {
256 $initialData = file_get_contents('data_initialization/data_initialization.sql'); 256 $initialData = file_get_contents('data_initialization/data_initialization.sql');
257 PMA_splitSqlFile($statements, $initialData, 4); 257 PMA_splitSqlFile($statements, $initialData, 4);
258 if (sizeof($statements) > 0) 258 if (sizeof($statements) > 0)
259 { 259 {
260 foreach ($statements as $statement) 260 foreach ($statements as $statement)
261 { 261 {
262 if (!TestExecuteQuery($statement['query'])) 262 if (!TestExecuteQuery($statement['query']))
263 263
264 { 264 {
265 $errors++; 265 $errors++;
266 AddError('Statement "'.$statement['query'].'" failed'); 266 AddError('Statement "'.$statement['query'].'" failed');
267 } 267 }
268 } 268 }
269 } 269 }
270 $structure_changes = file_get_contents('data_initialization/additional_table_structures.sql'); 270 $structure_changes = file_get_contents('data_initialization/additional_table_structures.sql');
271 unset($statements); 271 unset($statements);
272 PMA_splitSqlFile($statements, $structure_changes, 4); 272 PMA_splitSqlFile($statements, $structure_changes, 4);
273 if (sizeof($statements) > 0) 273 if (sizeof($statements) > 0)
274 { 274 {
275 foreach ($statements as $statement) 275 foreach ($statements as $statement)
276 { 276 {
277 if (!TestExecuteQuery($statement['query'])) 277 if (!TestExecuteQuery($statement['query']))
278 278
279 { 279 {
280 $errors++; 280 $errors++;
281 AddError('Statement "'.$statement['query'].'" failed'); 281 AddError('Statement "'.$statement['query'].'" failed');
282 } 282 }
283 } 283 }
284 } 284 }
285 } 285 }
286 286
287 287
288 /** 288 /**
289 * verify object status 289 * verify object status
290 */ 290 */
291 $objectNameList = array(); 291 $objectNameList = array();
292 foreach($objects as $object) 292 foreach($objects as $object)
293 { 293 {
294 $objectName = GetObjectName("../objects/".$object); 294 $objectName = GetObjectName("../objects/".$object);
295 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) 295 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false)
296 { 296 {
297 $objectNameList[] = $objectName; 297 $objectNameList[] = $objectName;
298 } 298 }
299 } 299 }
300 300
301 if ($errors == 0) 301 if ($errors == 0)
302 { 302 {
303 $pluginNameList = array(); 303 $pluginNameList = array();
304 foreach($plugins as $plugin) 304 foreach($plugins as $plugin)
305 { 305 {
306 $pluginName = GetPluginName($plugin); 306 $pluginName = GetPluginName($plugin);
307 if ($pluginName != '') 307 if ($pluginName != '')
308 { 308 {
309 $pluginNameList[] = $pluginName; 309 $pluginNameList[] = $pluginName;
310 } 310 }
311 } 311 }
312 } 312 }
313 313
314 314
315 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') 315 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes')
316 { 316 {
317 AddTrace("\nPOG Essentials"); 317 AddTrace("\nPOG Essentials");
318 318
319 $_SESSION['links'] = array(); 319 $_SESSION['links'] = array();
320 320
321 $objectCount = 1; 321 $objectCount = 1;
322 foreach($objects as $object) 322 foreach($objects as $object)
323 { 323 {
324 $objectName = GetObjectName("../objects/".$object); 324 $objectName = GetObjectName("../objects/".$object);
325 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) 325 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false)
326 { 326 {
327 eval('$instance = new '.$objectName.'();'); 327 eval('$instance = new '.$objectName.'();');
328 AddTrace("\t[".$objectName."]"); 328 AddTrace("\t[".$objectName."]");
329 329
330 $link = GetAtLink("../objects/".$object); 330 $link = GetAtLink("../objects/".$object);
331 $_SESSION['links'][$objectName] = $link; 331 $_SESSION['links'][$objectName] = $link;
332 332
333 if (!TestEssentials($instance)) 333 if (!TestEssentials($instance))
334 { 334 {
335 $errors++; 335 $errors++;
336 AddError("Object $objectName failed essential tests"); 336 AddError("Object $objectName failed essential tests");
337 } 337 }
338 if ($objectCount != sizeof($objects)) 338 if ($objectCount != sizeof($objects))
339 { 339 {
340 AddTrace("\t***"); 340 AddTrace("\t***");
341 } 341 }
342 } 342 }
343 $objectCount++; 343 $objectCount++;
344 } 344 }
345 } 345 }
346 346
347 347
348 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') 348 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes')
349 { 349 {
350 AddTrace("\nPOG Relations PreRequisites"); 350 AddTrace("\nPOG Relations PreRequisites");
351 $objectCount = 1; 351 $objectCount = 1;
352 foreach ($objects as $object) 352 foreach ($objects as $object)
353 { 353 {
354 $objectName = GetObjectName("../objects/".$object); 354 $objectName = GetObjectName("../objects/".$object);
355 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) 355 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false)
356 { 356 {
357 eval('$instance = new '.$objectName.'();'); 357 eval('$instance = new '.$objectName.'();');
358 AddTrace("\t[".$objectName."]"); 358 AddTrace("\t[".$objectName."]");
359 if (!TestRelationsPreRequisites($instance, $objectNameList, $objectName, $ignoreObjects)) 359 if (!TestRelationsPreRequisites($instance, $objectNameList, $objectName, $ignoreObjects))
360 { 360 {
361 $errors++; 361 $errors++;
362 } 362 }
363 if ($objectCount != sizeof($objects)) 363 if ($objectCount != sizeof($objects))
364 { 364 {
365 AddTrace("\t***"); 365 AddTrace("\t***");
366 } 366 }
367 } 367 }
368 $objectCount++; 368 $objectCount++;
369 } 369 }
370 } 370 }
371 371
372 372
373 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') 373 if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes')
374 { 374 {
375 AddTrace("\nPOG Relations"); 375 AddTrace("\nPOG Relations");
376 $objectCount = 1; 376 $objectCount = 1;
377 foreach ($objects as $object) 377 foreach ($objects as $object)
378 { 378 {
379 $objectName = GetObjectName("../objects/".$object); 379 $objectName = GetObjectName("../objects/".$object);
380 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) 380 if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false)
381 { 381 {
382 eval('$instance = new '.$objectName.'();'); 382 eval('$instance = new '.$objectName.'();');
383 AddTrace("\t[".$objectName."]"); 383 AddTrace("\t[".$objectName."]");
384 if (!TestRelations($instance, $objectNameList, $ignoreObjects)) 384 if (!TestRelations($instance, $objectNameList, $ignoreObjects))
385 { 385 {
386 $errors++; 386 $errors++;
387 AddError("Object $objectName failed relations tests"); 387 AddError("Object $objectName failed relations tests");
388 } 388 }
389 if ($objectCount != sizeof($objects)) 389 if ($objectCount != sizeof($objects))
390 { 390 {
391 AddTrace("\t***"); 391 AddTrace("\t***");
392 } 392 }
393 } 393 }
394 $objectCount++; 394 $objectCount++;
395 } 395 }
396 } 396 }
397 if ($errors == 0) 397 if ($errors == 0)
398 { 398 {
399 $_SESSION['diagnosticsSuccessful'] = true; 399 $_SESSION['diagnosticsSuccessful'] = true;
400 } 400 }
401 if(isset($_POST['pog_test']) && $_POST['pog_test'] == 'no') 401 if(isset($_POST['pog_test']) && $_POST['pog_test'] == 'no')
402 { 402 {
403 AddTrace("\nUNIT TESTS NOT PERFORMED. FOUND $errors ERROR(S)"); 403 AddTrace("\nUNIT TESTS NOT PERFORMED. FOUND $errors ERROR(S)");
404 } 404 }
405 else 405 else
406 { 406 {
407 AddTrace("\nCHECKED ".count($objectNameList)." OBJECT(S). FOUND $errors ERROR(S)".($errors == 0 ? ". HURRAY!" : ":")); 407 AddTrace("\nCHECKED ".count($objectNameList)." OBJECT(S). FOUND $errors ERROR(S)".($errors == 0 ? ". HURRAY!" : ":"));
408 } 408 }
409 AddTrace("---------------------------------------------------"); 409 AddTrace("---------------------------------------------------");
410 if (isset($_SESSION['errorMessages'])) 410 if (isset($_SESSION['errorMessages']))
411 { 411 {
412 $errorMessages = unserialize($_SESSION['errorMessages']); 412 $errorMessages = unserialize($_SESSION['errorMessages']);
413 } 413 }
414 $traceMessages = unserialize($_SESSION['traceMessages']); 414 $traceMessages = unserialize($_SESSION['traceMessages']);
415 $diagnostics = ''; 415 $diagnostics = '';
416 foreach ($traceMessages as $traceMessage) 416 foreach ($traceMessages as $traceMessage)
417 { 417 {
418 $diagnostics .= "\n$traceMessage"; 418 $diagnostics .= "\n$traceMessage";
419 } 419 }
420 if (isset($errorMessages)) 420 if (isset($errorMessages))
421 { 421 {
422 foreach ($errorMessages as $errorMessage) 422 foreach ($errorMessages as $errorMessage)
423 { 423 {
424 $diagnostics .= "\n$errorMessage\n"; 424 $diagnostics .= "\n$errorMessage\n";
425 } 425 }
426 } 426 }
427 $_SESSION['fileNames'] = serialize($objects); 427 $_SESSION['fileNames'] = serialize($objects);
428 $_SESSION['objectNameList'] = serialize($objectNameList); 428 $_SESSION['objectNameList'] = serialize($objectNameList);
429 if (isset($pluginNameList)) 429 if (isset($pluginNameList))
430 { 430 {
431 $_SESSION['pluginNameList'] = serialize($pluginNameList); 431 $_SESSION['pluginNameList'] = serialize($pluginNameList);
432 } 432 }
433 } 433 }
434 echo "<textarea>".$diagnostics."</textarea><br/><br/><br/></div>"; 434 echo "<textarea>".$diagnostics."</textarea><br/><br/><br/></div>";
435 if ($_SESSION['diagnosticsSuccessful']) 435 if ($_SESSION['diagnosticsSuccessful'])
436 { 436 {
437 echo '<input type="image" src="./setup_images/setup_proceed.gif" name="submit"/>'; 437 echo '<input type="image" src="./setup_images/setup_proceed.gif" name="submit"/>';
438 } 438 }
439 unset($_POST, $instanceId, $_SESSION['traceMessages'], $_SESSION['errorMessages']); 439 unset($_POST, $instanceId, $_SESSION['traceMessages'], $_SESSION['errorMessages']);
440?> 440?>
441</div></div> 441</div></div>
442</form> 442</form>
443<?php 443<?php
444} 444}
445else if($_SESSION['diagnosticsSuccessful'] == true && (!isset($_GET['plugins']) || $_GET['plugins'] != true) ) 445else if($_SESSION['diagnosticsSuccessful'] == true && (!isset($_GET['plugins']) || $_GET['plugins'] != true) )
446{ 446{
447 $pluginNameList = unserialize($_SESSION['pluginNameList']); 447 $pluginNameList = unserialize($_SESSION['pluginNameList']);
448?> 448?>
449<form action="./index.php" method="POST"> 449<form action="./index.php" method="POST">
450<div class="container"> 450<div class="container">
451 <div class="left"> 451 <div class="left">
452 <div class="logo3"></div> 452 <div class="logo3"></div>
453 <div class="text"><div class="gold">POG documentation summary</div> 453 <div class="text"><div class="gold">POG documentation summary</div>
454 <br/><br/>The following 3 documents summarize what POG is all about:<br/><br/> 454 <br/><br/>The following 3 documents summarize what POG is all about:<br/><br/>
455 1. <a href="http://www.phpobjectgenerator.com/plog/file_download/15">POG Essentials</a><br/><br/> 455 1. <a href="http://www.phpobjectgenerator.com/plog/file_download/15">POG Essentials</a><br/><br/>
456 2. <a href="http://www.phpobjectgenerator.com/plog/file_download/21">POG Object Relations</a><br/><br/> 456 2. <a href="http://www.phpobjectgenerator.com/plog/file_download/21">POG Object Relations</a><br/><br/>
457 3. <a href="http://www.phpobjectgenerator.com/plog/file_download/18">POG SOAP API</a> 457 3. <a href="http://www.phpobjectgenerator.com/plog/file_download/18">POG SOAP API</a>
458 </div><!--text--> 458 </div><!--text-->
459 </div><!--left--> 459 </div><!--left-->
460<div class="middle33"> 460<div class="middle33">
461 <div id="tabs3"> 461 <div id="tabs3">
462 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a> 462 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a>
463 <img src="./setup_images/tab_separator.gif"/> 463 <img src="./setup_images/tab_separator.gif"/>
464 <img src="./setup_images/tab_diagnosticresults.gif"/> 464 <img src="./setup_images/tab_diagnosticresults.gif"/>
465 <img src="./setup_images/tab_separator.gif"/> 465 <img src="./setup_images/tab_separator.gif"/>
466 <a href="./index.php"><img src="./setup_images/tab_manageobjects_on.gif"/></a> 466 <a href="./index.php"><img src="./setup_images/tab_manageobjects_on.gif"/></a>
467 <img src="./setup_images/tab_separator.gif"/> 467 <img src="./setup_images/tab_separator.gif"/>
468<?php 468<?php
469 if (sizeof($pluginNameList) > 0) 469 if (sizeof($pluginNameList) > 0)
470 { 470 {
471?> 471?>
472 <a href="./index.php?plugins=true"><img src="./setup_images/tab_manageplugins_off.gif" border="0"/></a> 472 <a href="./index.php?plugins=true"><img src="./setup_images/tab_manageplugins_off.gif" border="0"/></a>
473<?php 473<?php
474 } 474 }
475?> 475?>
476 </div><!--tabs3--><div class="subtabs"> 476 </div><!--tabs3--><div class="subtabs">
477<?php 477<?php
478 //provide interface to the database 478 //provide interface to the database
479 include "./setup_library/xPandMenu.php"; 479 include "./setup_library/xPandMenu.php";
480 $root = new XMenu(); 480 $root = new XMenu();
481 if(file_exists("configuration.php")) 481 if(file_exists("configuration.php"))
482 { 482 {
483 include "../configuration.php"; 483 include "../configuration.php";
484 } 484 }
485 if(file_exists("../objects/class.database.php")) 485 if(file_exists("../objects/class.database.php"))
486 { 486 {
487 include "../objects/class.database.php"; 487 include "../objects/class.database.php";
488 } 488 }
489 489
490 $fileNames = unserialize($_SESSION['fileNames']); 490 $fileNames = unserialize($_SESSION['fileNames']);
491 foreach($fileNames as $filename) 491 foreach($fileNames as $filename)
492 { 492 {
493 include_once("../objects/{$filename}"); 493 include_once("../objects/{$filename}");
494 } 494 }
495 $objectNameList = unserialize($_SESSION['objectNameList']); 495 $objectNameList = unserialize($_SESSION['objectNameList']);
496 if (isset($_GET['objectName'])) 496 if (isset($_GET['objectName']))
497 { 497 {
498 $_SESSION['objectName'] = $_GET['objectName']; 498 $_SESSION['objectName'] = $_GET['objectName'];
499 } 499 }
500 $objectName = (isset($_SESSION['objectName'])?$_SESSION['objectName']:$objectNameList[0]); 500 $objectName = (isset($_SESSION['objectName'])?$_SESSION['objectName']:$objectNameList[0]);
501 501
502 ?> 502 ?>
503 <div id="header"> 503 <div id="header">
504 <ul> 504 <ul>
505 <li id='inactive'>My Objects:</li> 505 <li id='inactive'>My Objects:</li>
506 <?php 506 <?php
507 if (!isset($_SESSION['objectName'])) 507 if (!isset($_SESSION['objectName']))
508 { 508 {
509 $_SESSION['objectName'] = $objectNameList[0]; 509 $_SESSION['objectName'] = $objectNameList[0];
510 } 510 }
511 for($i=0; $i<count($objectNameList); $i++) 511 for($i=0; $i<count($objectNameList); $i++)
512 { 512 {
513 $name = $objectNameList[$i]; 513 $name = $objectNameList[$i];
514 eval('$instance = new '.$name.'();'); 514 eval('$instance = new '.$name.'();');
515 if (!TestIsMapping($instance)) 515 if (!TestIsMapping($instance))
516 { 516 {
517 echo "<li ".($_SESSION['objectName']==$objectNameList[$i]?"id='current'":'')."><a href='./index.php?objectName=".$objectNameList[$i]."'>".$objectNameList[$i]."</a></li>"; 517 echo "<li ".($_SESSION['objectName']==$objectNameList[$i]?"id='current'":'')."><a href='./index.php?objectName=".$objectNameList[$i]."'>".$objectNameList[$i]."</a></li>";
518 //echo "<a href='./index.php?objectName=".$objectNameList[$i]."'".(isset($_SESSION['objectName']) && $_SESSION['objectName']==$objectNameList[$i]?"class='activetab'":(!isset($_SESSION['objectName'])&&$i==0?"class='activetab'":"inactivetab")).">".$objectNameList[$i]."</a> "; 518 //echo "<a href='./index.php?objectName=".$objectNameList[$i]."'".(isset($_SESSION['objectName']) && $_SESSION['objectName']==$objectNameList[$i]?"class='activetab'":(!isset($_SESSION['objectName'])&&$i==0?"class='activetab'":"inactivetab")).">".$objectNameList[$i]."</a> ";
519 } 519 }
520 } 520 }
521 ?> 521 ?>
522 </ul> 522 </ul>
523 </div><!--header--> 523 </div><!--header-->
524 </div><!--subtabs--> 524 </div><!--subtabs-->
525 <div class="toolbar"><a href="<?php echo $_SESSION['links'][$_SESSION['objectName']]?>" target="_blank" title="modify and regenerate object"><img src="./setup_images/setup_regenerate.jpg" border="0"/></a><a href="#" title="Delete all objects" onclick="if (confirm('Are you sure you want to delete all objects in this table? TPress OK to Delete.')){window.location='./?thrashall=true';}else{alert('Phew, nothing was deleted ;)');}"><img src='./setup_images/setup_deleteall.jpg' alt='delete all' border="0"/></a><a href="#" onclick="javascript:expandAll();return false;" title="expand all nodes"><img src='./setup_images/setup_expandall.jpg' alt='expand all' border="0"/></a><a href="#" onclick="javascript:collapseAll();return false;" title="collapse all nodes"><img src='./setup_images/setup_collapseall.jpg' alt='collapse all' border="0"/></a><a href="#" title="update all objects to newest POG version" onclick="if (confirm('Setup will now attempt to upgrade your objects by contacting the POG SOAP server. Would you like to continue?')){window.location='./setup_library/upgrade.php';}else{alert('Upgrade aborted');}"><img src='./setup_images/setup_updateall.jpg' alt='update all objects' border='0'/></a></div><div class="middle3"> 525 <div class="toolbar"><a href="<?php echo $_SESSION['links'][$_SESSION['objectName']]?>" target="_blank" title="modify and regenerate object"><img src="./setup_images/setup_regenerate.jpg" border="0"/></a><a href="#" title="Delete all objects" onclick="if (confirm('Are you sure you want to delete all objects in this table? TPress OK to Delete.')){window.location='./?thrashall=true';}else{alert('Phew, nothing was deleted ;)');}"><img src='./setup_images/setup_deleteall.jpg' alt='delete all' border="0"/></a><a href="#" onclick="javascript:expandAll();return false;" title="expand all nodes"><img src='./setup_images/setup_expandall.jpg' alt='expand all' border="0"/></a><a href="#" onclick="javascript:collapseAll();return false;" title="collapse all nodes"><img src='./setup_images/setup_collapseall.jpg' alt='collapse all' border="0"/></a><a href="#" title="update all objects to newest POG version" onclick="if (confirm('Setup will now attempt to upgrade your objects by contacting the POG SOAP server. Would you like to continue?')){window.location='./setup_library/upgrade.php';}else{alert('Upgrade aborted');}"><img src='./setup_images/setup_updateall.jpg' alt='update all objects' border='0'/></a></div><div class="middle3">
526 <?php 526 <?php
527 //is there an action to perform? 527 //is there an action to perform?
528 if (isset($_GET['thrashall'])) 528 if (isset($_GET['thrashall']))
529 { 529 {
530 eval('$instance = new '.$objectName.'();'); 530 eval('$instance = new '.$objectName.'();');
531 $instanceId = strtolower(get_class($instance))."Id"; 531 $instanceId = strtolower(get_class($instance))."Id";
532 $instanceList = $instance->GetList(array(array($instanceId, ">", "0"))); 532 $instanceList = $instance->GetList(array(array($instanceId, ">", "0")));
533 foreach ($instanceList as $instance) 533 foreach ($instanceList as $instance)
534 { 534 {
535 $instance->Delete(); 535 $instance->Delete();
536 } 536 }
537 unset($_GET); 537 unset($_GET);
538 } 538 }
539 echo '<div id="container"></div>'; 539 echo '<div id="container"></div>';
540 $_SESSION['fileNames'] = serialize($fileNames); 540 $_SESSION['fileNames'] = serialize($fileNames);
541 $_SESSION['objectNameList'] = serialize($objectNameList); 541 $_SESSION['objectNameList'] = serialize($objectNameList);
542?> 542?>
543<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b> 543<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
544</div><!--middle3--> 544</div><!--middle3-->
545</div><!--middle33--> 545</div><!--middle33-->
546</div><!--container--> 546</div><!--container-->
547</form> 547</form>
548<?php 548<?php
549echo "<script>sndReq('GetList', '', '$objectName', '', '', '', '$objectName');</script>"; 549echo "<script>sndReq('GetList', '', '$objectName', '', '', '', '$objectName');</script>";
550} 550}
551else if ($_SESSION['diagnosticsSuccessful'] && $_GET['plugins']) 551else if ($_SESSION['diagnosticsSuccessful'] && $_GET['plugins'])
552{ 552{
553?> 553?>
554<form action="./index.php?plugins=true" method="POST"> 554<form action="./index.php?plugins=true" method="POST">
555 <div class="container"> 555 <div class="container">
556 <div class="left"> 556 <div class="left">
557 <div class="logo3"></div> 557 <div class="logo3"></div>
558 <div class="text"><div class="gold">POG documentation summary</div> 558 <div class="text"><div class="gold">POG documentation summary</div>
559 <br/><br/>The following 3 documents summarize what POG is all about:<br/><br/> 559 <br/><br/>The following 3 documents summarize what POG is all about:<br/><br/>
560 1. <a href="http://www.phpobjectgenerator.com/plog/file_download/15">POG Essentials</a><br/><br/> 560 1. <a href="http://www.phpobjectgenerator.com/plog/file_download/15">POG Essentials</a><br/><br/>
561 2. <a href="http://www.phpobjectgenerator.com/plog/file_download/21" target="_blank">POG Object Relations</a><br/><br/> 561 2. <a href="http://www.phpobjectgenerator.com/plog/file_download/21" target="_blank">POG Object Relations</a><br/><br/>
562 3. <a href="http://www.phpobjectgenerator.com/plog/file_download/18">POG SOAP API</a> 562 3. <a href="http://www.phpobjectgenerator.com/plog/file_download/18">POG SOAP API</a>
563 </div><!--text--> 563 </div><!--text-->
564 </div><!--left--> 564 </div><!--left-->
565<div class="middle33"> 565<div class="middle33">
566 <div id="tabs3"> 566 <div id="tabs3">
567 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a> 567 <a href="./index.php?step=diagnostics"><img src="./setup_images/tab_setup.gif"/></a>
568 <img src="./setup_images/tab_separator.gif"/> 568 <img src="./setup_images/tab_separator.gif"/>
569 <img src="./setup_images/tab_diagnosticresults.gif"/> 569 <img src="./setup_images/tab_diagnosticresults.gif"/>
570 <img src="./setup_images/tab_separator.gif"/> 570 <img src="./setup_images/tab_separator.gif"/>
571 <a href="./index.php"><img src="./setup_images/tab_manageobjects.gif"/></a> 571 <a href="./index.php"><img src="./setup_images/tab_manageobjects.gif"/></a>
572 <img src="./setup_images/tab_separator.gif"/> 572 <img src="./setup_images/tab_separator.gif"/>
573 <img src="./setup_images/tab_manageplugins_on.gif"/> 573 <img src="./setup_images/tab_manageplugins_on.gif"/>
574 </div><!--tabs3--><div class="subtabs"> 574 </div><!--tabs3--><div class="subtabs">
575<?php 575<?php
576 //provide interface to the database 576 //provide interface to the database
577 include "./setup_library/xPandMenu.php"; 577 include "./setup_library/xPandMenu.php";
578 $root = new XMenu(); 578 $root = new XMenu();
579 if(file_exists("configuration.php")) 579 if(file_exists("configuration.php"))
580 { 580 {
581 include "../configuration.php"; 581 include "../configuration.php";
582 } 582 }
583 if(file_exists("../objects/class.database.php")) 583 if(file_exists("../objects/class.database.php"))
584 { 584 {
585 include "../objects/class.database.php"; 585 include "../objects/class.database.php";
586 } 586 }
587 include_once('../objects/class.pog_base.php'); 587 include_once('../objects/class.pog_base.php');
588 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php")) 588 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php"))
589 { 589 {
590 include_once($GLOBALS['configuration']['plugins_path'].'/IPlugin.php'); 590 include_once($GLOBALS['configuration']['plugins_path'].'/IPlugin.php');
591 } 591 }
592 $pluginNameList = unserialize($_SESSION['pluginNameList']); 592 $pluginNameList = unserialize($_SESSION['pluginNameList']);
593 foreach($pluginNameList as $pluginName) 593 foreach($pluginNameList as $pluginName)
594 { 594 {
595 include_once($GLOBALS['configuration']['plugins_path']."/plugin.".$pluginName.".php"); 595 include_once($GLOBALS['configuration']['plugins_path']."/plugin.".$pluginName.".php");
596 } 596 }
597 597
598 ?> 598 ?>
599 <div id="header"> 599 <div id="header">
600 <ul> 600 <ul>
601 <li id='inactive'>My Plugins:</li> 601 <li id='inactive'>My Plugins:</li>
602 <?php 602 <?php
603 if (isset($_GET['pluginName'])) 603 if (isset($_GET['pluginName']))
604 { 604 {
605 $_SESSION['pluginName'] = $_GET['pluginName']; 605 $_SESSION['pluginName'] = $_GET['pluginName'];
606 } 606 }
607 $pluginName = (isset($_SESSION['pluginName'])?$_SESSION['pluginName']:$pluginNameList[0]); 607 $pluginName = (isset($_SESSION['pluginName'])?$_SESSION['pluginName']:$pluginNameList[0]);
608 $_SESSION['pluginName'] = $pluginName; 608 $_SESSION['pluginName'] = $pluginName;
609 for($i=0; $i<count($pluginNameList); $i++) 609 for($i=0; $i<count($pluginNameList); $i++)
610 { 610 {
611 $name = $pluginNameList[$i]; 611 $name = $pluginNameList[$i];
612 echo "<li ".($_SESSION['pluginName']==$pluginNameList[$i]?"id='current'":'')."><a href='./index.php?plugins=true&pluginName=".$pluginNameList[$i]."'>".$pluginNameList[$i]."</a></li>"; 612 echo "<li ".($_SESSION['pluginName']==$pluginNameList[$i]?"id='current'":'')."><a href='./index.php?plugins=true&pluginName=".$pluginNameList[$i]."'>".$pluginNameList[$i]."</a></li>";
613 } 613 }
614 $pluginInstance = new $_SESSION['pluginName']('', ''); 614 $pluginInstance = new $_SESSION['pluginName']('', '');
615 ?> 615 ?>
616 </ul> 616 </ul>
617 </div><!--header--> 617 </div><!--header-->
618 </div><!--subtabs--> 618 </div><!--subtabs-->
619 <div class="toolbar"><img src="setup_images/button_toolbar_left.gif"/> 619 <div class="toolbar"><img src="setup_images/button_toolbar_left.gif"/>
620 <a href='http://plugins.phpobjectgenerator.com/?id=<?=get_class($pluginInstance)?>' target="_blank"><img src="setup_images/button_toolbar_homepage.gif" border='0'/></a> 620 <a href='http://plugins.phpobjectgenerator.com/?id=<?=get_class($pluginInstance)?>' target="_blank"><img src="setup_images/button_toolbar_homepage.gif" border='0'/></a>
621 <img src="setup_images/toolbar_separator.gif"/> 621 <img src="setup_images/toolbar_separator.gif"/>
622 <?php 622 <?php
623 if ($pluginInstance->AuthorPage() != null) 623 if ($pluginInstance->AuthorPage() != null)
624 { 624 {
625 ?> 625 ?>
626 <a href='<?php echo $pluginInstance->AuthorPage();?>' target="_blank"><img src="setup_images/button_toolbar_author.gif" border='0'/></a> 626 <a href='<?php echo $pluginInstance->AuthorPage();?>' target="_blank"><img src="setup_images/button_toolbar_author.gif" border='0'/></a>
627 <img src="setup_images/toolbar_separator.gif"/> 627 <img src="setup_images/toolbar_separator.gif"/>
628 <?php 628 <?php
629 } 629 }
630 ?> 630 ?>
631 <a href='http://plugins.phpobjectgenerator.com/?id=<?=get_class($pluginInstance)?>&help' target="_blank"><img src="setup_images/button_toolbar_help.gif" border='0'/></a> 631 <a href='http://plugins.phpobjectgenerator.com/?id=<?=get_class($pluginInstance)?>&help' target="_blank"><img src="setup_images/button_toolbar_help.gif" border='0'/></a>
632 </div><div class="middle3"> 632 </div><div class="middle3">
633 <?php 633 <?php
634 echo '<div id="container"><div style="padding:30px;">'; 634 echo '<div id="container"><div style="padding:30px;">';
635 $pluginInstance->SetupRender(); 635 $pluginInstance->SetupRender();
636 echo '</div></div>'; 636 echo '</div></div>';
637 $_SESSION['pluginNameList'] = serialize($pluginNameList); 637 $_SESSION['pluginNameList'] = serialize($pluginNameList);
638?> 638?>
639<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b> 639<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
640</div><!--middle3--> 640</div><!--middle3-->
641</div><!--middle33--> 641</div><!--middle33-->
642</div><!--container--> 642</div><!--container-->
643</form> 643</form>
644<?php 644<?php
645} 645}
646else 646else
647{ 647{
648 unset($_SESSION['objectNameList'], $_SESSION['fileNames'], $_SESSION['links'], $_SESSION['pluginNameList']); 648 unset($_SESSION['objectNameList'], $_SESSION['fileNames'], $_SESSION['links'], $_SESSION['pluginNameList']);
649 //welcome screen 649 //welcome screen
650?> 650?>
651<form action="./index.php" method="POST"> 651<form action="./index.php" method="POST">
652<div class="container"> 652<div class="container">
653 <div class="left"> 653 <div class="left">
654 <div class="logo"></div> 654 <div class="logo"></div>
655 <div class="text"><div class="gold">What is POG Setup?</div>POG Setup is an extension of the online Php Object Generator. It is meant to help the veteran POG user and the novice alike. 655 <div class="text"><div class="gold">What is POG Setup?</div>POG Setup is an extension of the online Php Object Generator. It is meant to help the veteran POG user and the novice alike.
656 <br/><br/>POG Setup is a 3 step process which:<br/><br/> 656 <br/><br/>POG Setup is a 3 step process which:<br/><br/>
657 1. Creates tables for your generated objects.<br/><br/> 657 1. Creates tables for your generated objects.<br/><br/>
658 2. Performs diagnostics tests on all objects within your 'objects' directory.<br/><br/> 658 2. Performs diagnostics tests on all objects within your 'objects' directory.<br/><br/>
659 3. Provides a light interface to your object tables.</div> 659 3. Provides a light interface to your object tables.</div>
660 </div> 660 </div>
661 <div class="middle"> 661 <div class="middle">
662 <div id="tabs"> 662 <div id="tabs">
663 <img src="./setup_images/tab_setup_on.gif"/> 663 <img src="./setup_images/tab_setup_on.gif"/>
664 <img src="./setup_images/tab_separator.gif" height="20px" width="17px"/> 664 <img src="./setup_images/tab_separator.gif" height="20px" width="17px"/>
665 <img src="./setup_images/tab_diagnosticresults.gif" height="20px" width="137px"/> 665 <img src="./setup_images/tab_diagnosticresults.gif" height="20px" width="137px"/>
666 <img src="./setup_images/tab_separator.gif" height="20px" width="17px"/> 666 <img src="./setup_images/tab_separator.gif" height="20px" width="17px"/>
667 <img src="./setup_images/tab_manageobjects.gif" height="20px" width="129px"/> 667 <img src="./setup_images/tab_manageobjects.gif" height="20px" width="129px"/>
668 <img src="./setup_images/tab_separator.gif"/> 668 <img src="./setup_images/tab_separator.gif"/>
669 <img src="./setup_images/tab_manageplugins_off.gif"/> 669 <img src="./setup_images/tab_manageplugins_off.gif"/>
670 </div> 670 </div>
671 <div id="nifty"> 671 <div id="nifty">
672 <div style="height:500px"> 672 <div style="height:500px">
673 <img src="./setup_images/setup_welcome.jpg" height="47px" width="617px"/> 673 <img src="./setup_images/setup_welcome.jpg" height="47px" width="617px"/>
674 <div class="col1"><img src="./setup_images/pog_setup_closed.jpg"/><div class="gold">What is POG?</div>POG generates PHP objects with integrated CRUD methods to dramatically accelerate web application development in PHP. <br/> 674 <div class="col1"><img src="./setup_images/pog_setup_closed.jpg"/><div class="gold">What is POG?</div>POG generates PHP objects with integrated CRUD methods to dramatically accelerate web application development in PHP. <br/>
675 <br/>POG allows developers to easily map object attributes onto columns of a database table without having to write SQL queries.</div> 675 <br/>POG allows developers to easily map object attributes onto columns of a database table without having to write SQL queries.</div>
676 <div class="col2"><img src="./setup_images/pog_setup_open.jpg"/><div class="gold">What is POG Setup?</div>You've generated one or more objects using Php Object Generator ... Now what?<br/> 676 <div class="col2"><img src="./setup_images/pog_setup_open.jpg"/><div class="gold">What is POG Setup?</div>You've generated one or more objects using Php Object Generator ... Now what?<br/>
677 <br/>POG SETUP is an answer to this question and takes the POG experience one step further. The Setup process automates <b>table creation</b>, <b>unit testing</b> and provides a light <b>scaffolding</b> environment.</div> 677 <br/>POG SETUP is an answer to this question and takes the POG experience one step further. The Setup process automates <b>table creation</b>, <b>unit testing</b> and provides a light <b>scaffolding</b> environment.</div>
678 <div class="col3"> 678 <div class="col3">
679 <div class="gold">If you are ready to get POG'd up, click on thebutton below to proceed. Doing this will:</div><br/> 679 <div class="gold">If you are ready to get POG'd up, click on thebutton below to proceed. Doing this will:</div><br/>
680 <table> 680 <table>
681 <tr> 681 <tr>
682 <td>TABLES:</td> 682 <td>TABLES:</td>
683 <td> 683 <td>
684 <select class="ss" name="pog_table"> 684 <select class="ss" name="pog_table">
685 <option value="align">Align tables with objects (default)</option> 685 <option value="align">Align tables with objects (default)</option>
686 <option value="recreate">Recreate tables</option> 686 <option value="recreate">Recreate tables</option>
687 <option value="recreate_import">Recreate tables and initialize data</option> 687 <option value="recreate_import">Recreate tables and initialize data</option>
688 </select> 688 </select>
689 </td> 689 </td>
690 </tr> 690 </tr>
691 <tr> 691 <tr>
692 <td>TESTS:</td> 692 <td>TESTS:</td>
693 <td> 693 <td>
694 <select class="ss" name="pog_test"> 694 <select class="ss" name="pog_test">
695 <option value="yes">Perform unit tests (default)</option> 695 <option value="yes">Perform unit tests (default)</option>
696 <option value="no">Bypass unit tests</option> 696 <option value="no">Bypass unit tests</option>
697 </select> 697 </select>
698 </td> 698 </td>
699 </tr> 699 </tr>
700 </table><br/> 700 </table><br/>
701 <br/><input type="image" onclick="PleaseWait('');" src="./setup_images/setup_pogmeup.gif" name="submit"/> 701 <br/><input type="image" onclick="PleaseWait('');" src="./setup_images/setup_pogmeup.gif" name="submit"/>
702 <div align="center" id="pleasewait" style="display:none;"><img src="./setup_images/loading.gif"/></div> 702 <div align="center" id="pleasewait" style="display:none;"><img src="./setup_images/loading.gif"/></div>
703 </div> 703 </div>
704 </div> 704 </div>
705 <b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b> 705 <b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
706 </div> 706 </div>
707 </div> 707 </div>
708</div> 708</div>
709</form> 709</form>
710<?php 710<?php
711} 711}
712?> 712?>
713<div class="footer"> 713<div class="footer">
714<?php include "setup_library/inc.footer.php";?> 714<?php include "setup_library/inc.footer.php";?>
715</div> 715</div>
716</body> 716</body>
717</html> 717</html>