Signed-off-by: Roland Häder <roland@mxchange.org>
/**
* Creates an instance of this class and prepares it a little
*
/**
* 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
*/
public static final function createConsoleRequest () {
// Create an instance
- $httpInstance = new ConsoleRequest();
+ $consoleInstance = new ConsoleRequest();
// Prepare the console request data for usage
// Prepare the console request data for usage
- $httpInstance->prepareRequestData();
+ $consoleInstance->prepareRequestData();
// Return the prepared instance
// Return the prepared instance
+ return $consoleInstance;
* @return void
*/
public function prepareRequestData () {
* @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'];
// Get the "request data" from the command-line argument list
$args = $_SERVER['argv'];