/**
* Creates an instance of this class and prepares it a little
*
- * @return $httpInstance An instance of this class
+ * @return $consoleInstance An instance of this class
*/
public static final function createConsoleRequest () {
// Create an instance
- $httpInstance = new ConsoleRequest();
+ $consoleInstance = new ConsoleRequest();
// Prepare the console request data for usage
- $httpInstance->prepareRequestData();
+ $consoleInstance->prepareRequestData();
// Return the prepared instance
- return $httpInstance;
+ return $consoleInstance;
}
/**
* @return void
*/
public function prepareRequestData () {
+ // 'argv' and 'argc' should be there
+ if ((!isset($_SERVER['argv'])) || (!isset($_SERVER['argc']))) {
+ // Maybe not right PHP mode? (needs CLI?)
+ trigger_error(sprintf('[%s:%d]: argv/argc not set: %s', __METHOD__, __LINE__, print_r($_SERVER, TRUE)), E_USER_ERROR);
+ } // END - if
+
// Get the "request data" from the command-line argument list
$args = $_SERVER['argv'];