コード例 #1
0
ファイル: generateEntireFramework.php プロジェクト: juddy/GIP
$thisDatabase->useDatabase($thisDb);
$dbTables = $thisDatabase->getDbTables();
$arguments = array();
for ($a = 0; $a < count($dbTables); $a++) {
    $arguments['db'] = requestUtils::getRequestObject('db');
    $arguments['table'] = requestUtils::getRequestObject('table');
    echo "<pre>";
    print_r($arguments);
    echo "</pre>";
    echo "<hr>";
    $generatedEnterFormCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_WEB_ENTER_FORM_GENERATOR_NAME, PLUGIN_PHP_GENIE_WEB_ENTER_FORM_GENERATOR_CLASS, $arguments);
    $generatedInsertCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_WEB_INSERT_GENERATOR_NAME, PLUGIN_PHP_GENIE_WEB_INSERT_GENERATOR_CLASS, $arguments);
    $generatedEditFormCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_WEB_EDIT_FORM_GENERATOR_NAME, PLUGIN_PHP_GENIE_WEB_EDIT_FORM_GENERATOR_CLASS, $arguments);
    $generatedUpdateCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_WEB_UPDATE_GENERATOR_NAME, PLUGIN_PHP_GENIE_WEB_UPDATE_GENERATOR_CLASS, $arguments);
    $generatedViewRecordCode = $thisPlugInLoader->loadPlugIn(PLUGIN_PHP_GENIE_WEB_INSERT_GENERATOR_NAME, PLUGIN_PHP_GENIE_WEB_INSERT_GENERATOR_CLASS, $arguments);
    $newWebPath = GENERATED_FILES_FOLDER . FILE_SEPARATOR . strtolower($_SESSION['db']) . FILE_SEPARATOR . "web" . FILE_SEPARATOR . "generatedForms" . FILE_SEPARATOR . strtolower($arguments['table']);
    $newAppPath = GENERATED_FILES_FOLDER . FILE_SEPARATOR . strtolower($_SESSION['db']) . FILE_SEPARATOR . "app" . FILE_SEPARATOR . "classes" . FILE_SEPARATOR . strtolower($arguments['table']);
    $newEnterFileName = $newWebPath . FILE_SEPARATOR . "enterNew" . ucfirst($arguments['table']) . ".php";
    $newInsertFileName = $newWebPath . FILE_SEPARATOR . "insert" . ucfirst($arguments['table']) . ".php";
    $newEditFileName = $newWebPath . FILE_SEPARATOR . "edit" . ucfirst($arguments['table']) . ".php";
    $newUpdateFileName = $newWebPath . FILE_SEPARATOR . "update" . ucfirst($arguments['table']) . ".php";
    $newViewFileName = $newWebPath . FILE_SEPARATOR . "view" . ucfirst($arguments['table']) . ".php";
    $thisFileSystemUtils->makeDirectoryRecursive($newWebPath);
    $thisFileSystemUtils->makeDirectoryRecursive($newAppPath);
    $thisFileSystemUtils->createNewFile($newEnterFileName, $generatedEnterFormCode);
    $thisFileSystemUtils->createNewFile($newInsertFileName, $generatedInsertCode);
    $thisFileSystemUtils->createNewFile($newEditFileName, $generatedEditFormCode);
    $thisFileSystemUtils->createNewFile($newUpdateFileName, $generatedUpdateCode);
    $thisFileSystemUtils->createNewFile($newViewFileName, $generatedViewRecordCode);
    echo "File Created --> " . $newEnterFileName;
}
コード例 #2
0
ファイル: processWhatToGenerate.php プロジェクト: juddy/GIP
$thisGenSearch = requestUtils::getRequestObject('search');
$thisGenView = requestUtils::getRequestObject('viewRecord');
$thisCopyCommon = requestUtils::getRequestObject('copyCommon');
$thisGenIndex = "y";
$thisLanguage = requestUtils::getRequestObject('language');
$thisTables = requestUtils::getRequestObject('tableName');
$headerText = requestUtils::getRequestObject('headerText');
$footerText = requestUtils::getRequestObject('footerText');
$headerText = "include_once(\"../common/dbConnection.php\");\ninclude_once(\"../common/header.php\");";
$footerText = "include_once(\"../common/footer.php\");";
$thisDb = requestUtils::getRequestObject('db');
$thisTable = requestUtils::getRequestObject('table');
$thisFileUtils = new fileSystemUtils();
$arguments['db'] = requestUtils::getRequestObject('db');
echo "Generated Code Root : <b>{$thisGeneratePath} </b> <br><br>";
$thisFileUtils->makeDirectoryRecursive($thisGeneratePath);
if (!$thisFileUtils->doesDirectoryExists($thisGeneratePath)) {
    ?>
The path that you have entered to be the root for your code Generation does not exist on your system. Code Genie cannot proceed. Please make sure that the directory <b><?php 
    echo $thisGeneratePath;
    ?>
</b> exists on the file System. <br><br>
<?php 
    exit;
} else {
    if (count($thisTables) == 0) {
        ?>
You did not select any tables for Auto Code Generation. You need to select at least one table. Please go back and choose again.
<?php 
    } else {
        $projectRoot = $thisGeneratePath . FILE_SEPARATOR . $thisDb;
コード例 #3
0
$thisLanguage = requestUtils::getRequestObject('language');
$thisTables = requestUtils::getRequestObject('tableName');
$thisDb = requestUtils::getRequestObject('db');
$thisTable = requestUtils::getRequestObject('table');
$headerText = requestUtils::getRequestObject('headerText');
$footerText = requestUtils::getRequestObject('footerText');
$tableSideBar = "";
$thisFileUtils = new fileSystemUtils();
$thisCommonFileCopier = new gipCommonFileCopier();
if ($thisConfigFile == ".conf.php") {
    $thisConfigFile = DEFAULT_CONFIGURATION_FILE_NAME . ".conf.php";
}
$arguments['db'] = $thisDb;
$mainIndexes = array();
echo "All Code will be generated in path <font color=red><b>" . $thisGeneratePath . "</b></font><br><br>";
$thisFileUtils->makeDirectoryRecursive($thisGeneratePath);
if (!$thisFileUtils->doesDirectoryExists($thisGeneratePath)) {
    ?>
The path that you have entered to be the root for your code Generation does not exist on your system. Code Genie cannot proceed. Please make sure that the directory <b><?php 
    echo $thisGeneratePath;
    ?>
</b> exists on the file System. <br><br>
<?php 
    exit;
} else {
    if (count($thisTables) == 0) {
        ?>
You did not select any tables for Auto Code Generation. You need to select at least one table. Please go back and choose again.
<?php 
    } else {
        if ($thisDb != "") {