$intStartTime = microtime(); $intStartTime = explode(' ', $intStartTime); $intStartTime = $intStartTime[1] + $intStartTime[0]; // Setup the Parameters for codegen $objParameters = new QCliParameterProcessor('codegen', 'Qcodo Code Generator v' . QCODO_VERSION); // Optional Parameters for Path to Codegen Settings $strDefaultPath = __DEVTOOLS_CLI__ . '/settings/codegen.xml'; // Small cleanup on the text $strDefaultPath = str_replace('/html/../', '/', $strDefaultPath); $strDefaultPath = str_replace('/docroot/../', '/', $strDefaultPath); $strDefaultPath = str_replace('/wwwroot/../', '/', $strDefaultPath); $strDefaultPath = str_replace('/www/../', '/', $strDefaultPath); $objParameters->AddNamedParameter('s', 'settings-path', QCliParameterType::Path, $strDefaultPath, 'path to the Codegen Settings XML file; defaults to ' . $strDefaultPath); $objParameters->Run(); // Pull the Parameter Values $strSettingsXmlPath = $objParameters->GetValue('s'); try { ///////////////////// // Run Code Gen QCodeGen::Run($strSettingsXmlPath); ///////////////////// if ($strErrors = QCodeGen::$RootErrors) { printf("The following ROOT ERRORS were reported:\r\n%s\r\n\r\n", $strErrors); } else { printf("CodeGen settings (as evaluted from %s):\r\n%s\r\n\r\n", $_SERVER['argv'][1], QCodeGen::GetSettingsXml()); } foreach (QCodeGen::$CodeGenArray as $objCodeGen) { printf("%s\r\n---------------------------------------------------------------------\r\n", $objCodeGen->GetTitle()); printf("%s\r\n", $objCodeGen->GetReportLabel()); printf("%s\r\n", $objCodeGen->GenerateAll()); if ($strErrors = $objCodeGen->Errors) {
<?php /** * Codegen Qcodo CLI file * Part of the Qcodo Development Framework * Copyright (c) 2005-2011, Quasidea Development, LLC */ // Setup the Parameters for qpm-download $objParameters = new QCliParameterProcessor('qpm-download', 'Qcodo Package Manager (QPM) Download and Install Tool v' . QCODO_VERSION); // Package Name is always required $objParameters->AddDefaultParameter('username/package_name', QCliParameterType::String, 'the username/package name pair of the QPM package you are wanting to download and install'); // Optional Parameters include Username, Password, "Live" mode, and "Force" upload $objParameters->AddFlagParameter('l', 'live', 'actually perform the live download and install; by default, calling qpm-download will only *report* to you files that will be downloaded and installed; specify the "live" flag to actually perform the download and install'); $objParameters->AddFlagParameter('f', 'force', 'force the download, even if the version of Qcodo used by the QPM author is different than what is currently installed here'); $objParameters->Run(); // Pull the Parameter Values $strPackageName = $objParameters->GetDefaultValue('username/package_name'); $strUsername = null; if (($intPosition = strpos($strPackageName, '/')) !== false) { $strUsername = substr($strPackageName, 0, $intPosition); $strPackageName = substr($strPackageName, $intPosition + 1); } $blnLive = $objParameters->GetValue('l'); $blnForce = $objParameters->GetValue('f'); try { $objQpm = new QPackageManagerDownload($strPackageName, $strUsername, $blnLive, $blnForce); $objQpm->PerformDownload(); } catch (Exception $objExc) { print 'error: ' . trim($objExc->getMessage()) . "\r\n"; exit(1); }
$objParameters = new QCliParameterProcessor('qpm-upload', 'Qcodo Package Manager (QPM) Uploader Tool v' . QCODO_VERSION); // Package Name is always required $objParameters->AddDefaultParameter('username/package_name', QCliParameterType::String, 'your username and the name of the QPM package you are wanting to upload'); // Optional Parameters include Username, Password, "Live" mode, and "Force" upload $objParameters->AddNamedParameter('p', 'password', QCliParameterType::String, null, 'the qcodo.com password to use, or if not specified, it will use the information stored in the QPM Settings file'); $objParameters->AddFlagParameter('l', 'live', 'actually perform the live upload; by default, calling qpm-upload will only *report* to you files that will be uploaded; specify the "live" flag to actually perform the upload'); $objParameters->AddFlagParameter('f', 'force', 'force the upload, even if the most recent Qcodo version is more recent than what is currently installed here'); $objParameters->AddNamedParameter('s', 'settings-path', QCliParameterType::Path, null, 'path to the QPM Settings XML file; defaults to ' . __DEVTOOLS_CLI__ . '/settings_qpm.xml'); $objParameters->AddNamedParameter('n', 'notes', QCliParameterType::String, null, 'text of any notes to include with this QPM package'); $objParameters->AddNamedParameter('N', 'notes-path', QCliParameterType::Path, null, 'path to textfile containing any notes to include with this QPM package; if both notes and notes-path are set, only the contents from notes-path will be included in the QPM package'); $objParameters->Run(); // Pull the Parameter Values $strPackageName = $objParameters->GetDefaultValue('username/package_name'); $strUsername = null; if (($intPosition = strpos($strPackageName, '/')) !== false) { $strUsername = substr($strPackageName, 0, $intPosition); $strPackageName = substr($strPackageName, $intPosition + 1); } $blnLive = $objParameters->GetValue('l'); $blnForce = $objParameters->GetValue('f'); $strPassword = $objParameters->GetValue('p'); $strSettingsFilePath = $objParameters->GetValue('s'); $strNotes = $objParameters->GetValue('n'); $strNotesPath = $objParameters->GetValue('N'); try { $objQpm = new QPackageManagerUpload($strPackageName, $strUsername, $strPassword, $blnLive, $blnForce, $strSettingsFilePath, $strNotes, $strNotesPath); $objQpm->PerformUpload(); } catch (Exception $objExc) { print 'error: ' . trim($objExc->getMessage()) . "\r\n"; exit(1); }