2 /* This includes library file is used by the codegen.cli and codegen.phpexe scripts
3 * to simply fire up and run the QCodeGen object, itself.
6 // Call the CLI prepend.inc.php
7 require('cli_prepend.inc.php');
9 // Include the QCodeGen class library
10 require(__QCODO__
. '/codegen/QCodeGen.class.php');
12 function PrintInstructions() {
13 global $strCommandName;
14 print('Qcodo Code Generator (Command Line Interface) - ' . QCODO_VERSION
. '
15 Copyright (c) 2001 - 2007, QuasIdea Development, LLC
16 This program is free software with ABSOLUTELY NO WARRANTY; you may
17 redistribute it under the terms of The MIT License.
19 Usage: ' . $strCommandName . ' CODEGEN_SETTINGS
21 Where CODEGEN_SETTINGS is the absolute filepath of the codegen_settings.xml
22 file, containing the code generator settings.
24 For more information, please go to www.qcodo.com
29 if ($_SERVER['argc'] != 2)
34 QCodeGen
::Run($_SERVER['argv'][1]);
38 if ($strErrors = QCodeGen
::$RootErrors) {
39 printf("The following ROOT ERRORS were reported:\r\n%s\r\n\r\n", $strErrors);
41 printf("CodeGen settings (as evaluted from %s):\r\n%s\r\n\r\n", $_SERVER['argv'][1], QCodeGen
::GetSettingsXml());
44 foreach (QCodeGen
::$CodeGenArray as $objCodeGen) {
45 printf("%s\r\n---------------------------------------------------------------------\r\n", $objCodeGen->GetTitle());
46 printf("%s\r\n", $objCodeGen->GetReportLabel());
47 printf("%s\r\n", $objCodeGen->GenerateAll());
48 if ($strErrors = $objCodeGen->Errors
)
49 printf("The following errors were reported:\r\n%s\r\n", $strErrors);
53 foreach (QCodeGen
::GenerateAggregate() as $strMessage) {
54 printf("%s\r\n\r\n", $strMessage);