0 && $_SESSION['diagnosticsSuccessful']==false) { ?>
POG setup diagnostics

Setup performs unit tests on all your objects in the object directory and makes sure they're OK.
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.

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.
 
$ignoreObject){ $ignoreObjects[$key] = trim($ignoreObject); } $dir = opendir('../objects/'); $objects = array(); while(($file = readdir($dir)) !== false) { if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php") { $objects[] = $file; include_once("../objects/{$file}"); } } closedir($dir); if (sizeof($objects) == 0) { $errors++; AddError("[objects] folder does not contain any POG object."); } if ($errors == 0) { $dir = opendir($GLOBALS['configuration']['plugins_path']); $plugins = array(); while(($file = readdir($dir)) !== false) { if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php")) { include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php"); } if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin') { include_once($GLOBALS['configuration']['plugins_path']."/{$file}"); $pluginName = GetPluginName($file); if ($pluginName != '') { $plugins[] = $file; } } } closedir($dir); } /** * verify configuration info */ if ($errors == 0) { AddTrace('File Structure....OK!'); if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) { $errors++; AddError('Cannot connect to the specified database server. Edit configuration.php'); } if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled()) { $errors++; 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'); } if ($errors == 0) { if (!@mysql_select_db ($GLOBALS['configuration']['db'])) { $errors++; AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php'); } } } /** * verify storage status */ if ($errors == 0) { AddTrace("Configuration Info....OK!\n"); AddTrace("Storage Status"); foreach($objects as $object) { $objectName = GetObjectName("../objects/".$object); eval ('$instance = new '.$objectName.'();'); if (TestStorageExists($objectName, "mysql")) { if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import")) { if (!TestDeleteStorage($instance)) { $errors++; AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually."); } else { if (!TestCreateStorage("../objects/".$object)) { $errors++; AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); } else { AddTrace("\tDropping & Recreating table [".strtolower($objectName)."]....OK!"); } } } else { if (!TestAlterStorage($instance)) { $errors++; AddError("Aligning [$objectName] with table '".strtolower($objectName)."' failed. Alter the table manually so that object attributes and table columns match."); } else { AddTrace("\tAligning [$objectName] with table '".strtolower($objectName)."'....OK!"); } } } else { if (!TestCreateStorage("../objects/".$object)) { $errors++; AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); } else { AddTrace("\tCreating table [".strtolower($objectName)."]....OK!"); } } } } $objectNameList = array(); /** * Initialize test data? */ if (isset($_POST['pog_table']) && $_POST['pog_table'] == 'recreate_import') { $initialData = file_get_contents('data_initialization/data_initialization.sql'); PMA_splitSqlFile($statements, $initialData, 4); if (sizeof($statements) > 0) { foreach ($statements as $statement) { if (!TestExecuteQuery($statement['query'])) { $errors++; AddError('Statement "'.$statement['query'].'" failed'); } } } $structure_changes = file_get_contents('data_initialization/additional_table_structures.sql'); unset($statements); PMA_splitSqlFile($statements, $structure_changes, 4); if (sizeof($statements) > 0) { foreach ($statements as $statement) { if (!TestExecuteQuery($statement['query'])) { $errors++; AddError('Statement "'.$statement['query'].'" failed'); } } } } /** * verify object status */ $objectNameList = array(); foreach($objects as $object) { $objectName = GetObjectName("../objects/".$object); if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) { $objectNameList[] = $objectName; } } if ($errors == 0) { $pluginNameList = array(); foreach($plugins as $plugin) { $pluginName = GetPluginName($plugin); if ($pluginName != '') { $pluginNameList[] = $pluginName; } } } if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') { AddTrace("\nPOG Essentials"); $_SESSION['links'] = array(); $objectCount = 1; foreach($objects as $object) { $objectName = GetObjectName("../objects/".$object); if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) { eval('$instance = new '.$objectName.'();'); AddTrace("\t[".$objectName."]"); $link = GetAtLink("../objects/".$object); $_SESSION['links'][$objectName] = $link; if (!TestEssentials($instance)) { $errors++; AddError("Object $objectName failed essential tests"); } if ($objectCount != sizeof($objects)) { AddTrace("\t***"); } } $objectCount++; } } if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') { AddTrace("\nPOG Relations PreRequisites"); $objectCount = 1; foreach ($objects as $object) { $objectName = GetObjectName("../objects/".$object); if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) { eval('$instance = new '.$objectName.'();'); AddTrace("\t[".$objectName."]"); if (!TestRelationsPreRequisites($instance, $objectNameList, $objectName, $ignoreObjects)) { $errors++; } if ($objectCount != sizeof($objects)) { AddTrace("\t***"); } } $objectCount++; } } if ($errors == 0 && isset($_POST['pog_test']) && $_POST['pog_test'] == 'yes') { AddTrace("\nPOG Relations"); $objectCount = 1; foreach ($objects as $object) { $objectName = GetObjectName("../objects/".$object); if (isset($objectName) && array_search($objectName, $ignoreObjects) ===false) { eval('$instance = new '.$objectName.'();'); AddTrace("\t[".$objectName."]"); if (!TestRelations($instance, $objectNameList, $ignoreObjects)) { $errors++; AddError("Object $objectName failed relations tests"); } if ($objectCount != sizeof($objects)) { AddTrace("\t***"); } } $objectCount++; } } if ($errors == 0) { $_SESSION['diagnosticsSuccessful'] = true; } if(isset($_POST['pog_test']) && $_POST['pog_test'] == 'no') { AddTrace("\nUNIT TESTS NOT PERFORMED. FOUND $errors ERROR(S)"); } else { AddTrace("\nCHECKED ".count($objectNameList)." OBJECT(S). FOUND $errors ERROR(S)".($errors == 0 ? ". HURRAY!" : ":")); } AddTrace("---------------------------------------------------"); if (isset($_SESSION['errorMessages'])) { $errorMessages = unserialize($_SESSION['errorMessages']); } $traceMessages = unserialize($_SESSION['traceMessages']); $diagnostics = ''; foreach ($traceMessages as $traceMessage) { $diagnostics .= "\n$traceMessage"; } if (isset($errorMessages)) { foreach ($errorMessages as $errorMessage) { $diagnostics .= "\n$errorMessage\n"; } } $_SESSION['fileNames'] = serialize($objects); $_SESSION['objectNameList'] = serialize($objectNameList); if (isset($pluginNameList)) { $_SESSION['pluginNameList'] = serialize($pluginNameList); } } echo "


"; if ($_SESSION['diagnosticsSuccessful']) { echo ''; } unset($_POST, $instanceId, $_SESSION['traceMessages'], $_SESSION['errorMessages']); ?>
POG documentation summary


The following 3 documents summarize what POG is all about:

1. POG Essentials

2. POG Object Relations

3. POG SOAP API
0) { ?>
delete allexpand allcollapse allupdate all objects
GetList(array(array($instanceId, ">", "0"))); foreach ($instanceList as $instance) { $instance->Delete(); } unset($_GET); } echo '
'; $_SESSION['fileNames'] = serialize($fileNames); $_SESSION['objectNameList'] = serialize($objectNameList); ?>
sndReq('GetList', '', '$objectName', '', '', '', '$objectName');"; } else if ($_SESSION['diagnosticsSuccessful'] && $_GET['plugins']) { ?>
POG documentation summary


The following 3 documents summarize what POG is all about:

1. POG Essentials

2. POG Object Relations

3. POG SOAP API
AuthorPage() != null) { ?>
'; $pluginInstance->SetupRender(); echo '
'; $_SESSION['pluginNameList'] = serialize($pluginNameList); ?>
What is POG Setup?
POG Setup is an extension of the online Php Object Generator. It is meant to help the veteran POG user and the novice alike.

POG Setup is a 3 step process which:

1. Creates tables for your generated objects.

2. Performs diagnostics tests on all objects within your 'objects' directory.

3. Provides a light interface to your object tables.
What is POG?
POG generates PHP objects with integrated CRUD methods to dramatically accelerate web application development in PHP.

POG allows developers to easily map object attributes onto columns of a database table without having to write SQL queries.
What is POG Setup?
You've generated one or more objects using Php Object Generator ... Now what?

POG SETUP is an answer to this question and takes the POG experience one step further. The Setup process automates table creation, unit testing and provides a light scaffolding environment.
If you are ready to get POG'd up, click on thebutton below to proceed. Doing this will:

TABLES:
TESTS: