com php-src: argv example in phpdbginit: .phpdbginit
| From: | Bob Weinand | Date: | Fri, 22 Nov 2013 20:11:06 +0000 |
| Subject: | com php-src: argv example in phpdbginit: .phpdbginit | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74708@lists.php.net to get a copy of this message | ||
Commit: 6bf06ac0ba943952daddb2daeb934bdf60002fa2
Author: krakjoe <joe.watkins@live.co.uk> Fri, 22 Nov 2013 20:11:06 +0000
Parents: 88a95efdfab841f06ddc1582db9736e3299acf75
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6bf06ac0ba943952daddb2daeb934bdf60002fa2
Log:
argv example in phpdbginit
Changed paths:
M .phpdbginit
Diff:
diff --git a/.phpdbginit b/.phpdbginit
index 9e02c6d..6e059d7 100644
--- a/.phpdbginit
+++ b/.phpdbginit
@@ -43,11 +43,42 @@ if (function_exists('readline_completion_function')) {
);
});
}
+
+/*
+ Setting argv made trivial ....
+
+ argv 1 2 3 4
+ ^ set argv for next execution
+
+ argv
+ ^ unset argv for next execution
+
+*/
+function argv()
+{
+ $argv = func_get_args();
+
+ if (!$argv) {
+ $_SERVER['argv'] = array();
+ $_SERVER['argc'] = 0;
+ return;
+ }
+
+ $_SERVER['argv'] = array_merge
+ (
+ array("phpdbg"),
+ $argv
+ );
+ $_SERVER['argc'] = count($_SERVER['argv']);
+
+ return $_SERVER['argv'];
+}
:>
##########################################################
# Now carry on initializing phpdbg ...
##########################################################
# R my_debugging_function
+# R argv
##########################################################
# PHP has many functions that might be useful