$mainIndex = ""; if ($thisCopyCommon == "y") { $commonDirectory = $projectRoot . FILE_SEPARATOR . "common"; $thisFileUtils->makeDirectoryRecursive($commonDirectory); $htmlDirectory = $projectRoot . FILE_SEPARATOR . "html"; $thisFileUtils->makeDirectoryRecursive($htmlDirectory); $arguments = ""; $arguments['db'] = requestUtils::getRequestObject('db'); $arguments['headerText'] = $headerText; $arguments['footerText'] = $footerText; $thisFileUtils->copyAllFilesFromPathToPath(FILES_TO_COPY_PHP_TEMPLATE_SIMPLE . FILE_SEPARATOR . "common", $commonDirectory); $thisFileUtils->copyAllFilesFromPathToPath(FILES_TO_COPY_PHP_TEMPLATE_SIMPLE . FILE_SEPARATOR . "html", $htmlDirectory); $thisCommobObjectCopier = new commonObjectCopier(); $connectionCode = $thisCommobObjectCopier->getReplacedConnectionFileForSimpleApp($arguments); $connectionFileName = "dbConnection.php"; $thisFileUtils->writeContentsToFile($commonDirectory, $connectionFileName, $connectionCode); echo "Copying common files to common Location...<br><br>"; } for ($a = 0; $a < count($thisTables); $a++) { $currentTable = $thisTables[$a]; $arguments = ""; $arguments['table'] = $thisTables[$a]; $arguments['db'] = requestUtils::getRequestObject('db'); $arguments['headerText'] = $headerText; $arguments['footerText'] = $footerText; $thisTable = new table($currentTable, $thisDb); $allFields = $thisTable->getFieldNameArray(); echo "Generating Code for table <font color=red><b>" . strtoupper($currentTable) . "</b></font>... <br><br>"; echo "<ul>"; // Setting Generated Table Code Root Directory $currentDirectory = $projectRoot . FILE_SEPARATOR . $currentTable;
$thisCommonFileCopier->copyWebFiles($thisConfigFile, $webDirectory, $thisConfigFile); $thisCommonFileCopier->copyConfigFiles($thisConfigFile, $configDirectory, $thisConfigFile); $appDaoDirectory = $appDirectory . FILE_SEPARATOR . DEFAULT_DIRECTORY_NAME_FOR_CRUD_CLASSES; $webFormDirectory = $webDirectory . FILE_SEPARATOR . DEFAULT_DIRECTORY_NAME_FOR_CRUD_FRONT_END; $thisFileUtils->makeDirectoryRecursive($appDaoDirectory); $thisFileUtils->makeDirectoryRecursive($webFormDirectory); if ($thisConstants == "y") { // Initializing Arguments $arguments = array(); $arguments['table'] = $thisTables[0]; $arguments['db'] = $thisDb; $arguments['siteRootPath'] = $projectRoot; $arguments['urlAddress'] = URL_ADDRESS . "/generatedCode/framework/" . $thisDb; $dbConstantsCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_COMMONDB_GENERATOR_NAME, PLUGIN_PHP_GENIE_COMMONDB_GENERATOR_CLASS, $arguments); $dbConstantsFileName = "databaseConfiguration.inc.php"; $thisFileUtils->writeContentsToFile($configDirectory, $dbConstantsFileName, $dbConstantsCode); $configurationFileCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_CONFIGURATION_FILE_GENERATOR_NAME, PLUGIN_PHP_GENIE_CONFIGURATION_FILE_GENERATOR_CLASS, $arguments); $configurationFileName = $thisDb . ".conf.php"; $thisFileUtils->writeContentsToFile($includeDirectory, $configurationFileName, $configurationFileCode); $pageConstantsCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_COMMONPAGES_GENERATOR_NAME, PLUGIN_PHP_GENIE_COMMONPAGES_GENERATOR_CLASS, $arguments); $pageConstantsFileName = "pageConstants.inc.php"; $thisFileUtils->writeContentsToFile($configDirectory, $pageConstantsFileName, $pageConstantsCode); $classConstantsCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_COMMON_CLASSES_GENERATOR_NAME, PLUGIN_PHP_GENIE_COMMON_CLASSES_GENERATOR_CLASS, $arguments); $classConstantsFileName = "classConstants.inc.php"; $thisFileUtils->writeContentsToFile($configDirectory, $classConstantsFileName, $classConstantsCode); } for ($a = 0; $a < count($thisTables); $a++) { $currentTable = $thisTables[$a]; $arguments['table'] = $thisTables[$a]; $arguments['db'] = $thisDb; $thisTable = new table($currentTable, $thisDb);