| View previous topic :: View next topic |
| Author |
Message |
willirl
Joined: 26 Mar 2009 Posts: 20
|
Posted: Mon Jul 06, 2009 1:04 pm Post subject: Run configuration / script / arguments not working? (SOLVED) |
|
|
I am trying to pass a command line arg to a script in the IDE. I set up the run config "Run as" to "Script" and the interpreter correctly - This works fine and runs the script.
When I add an "Arguments" as "abc" (without quotes) I don't see the args in the program using the argc and argv functions. Matter of fact the argv array is NULL.
Can someone point me in the right direction here?
Rick
Last edited by willirl on Mon Jul 06, 2009 1:17 pm; edited 1 time in total |
|
| Back to top |
|
 |
willirl
Joined: 26 Mar 2009 Posts: 20
|
Posted: Mon Jul 06, 2009 1:16 pm Post subject: |
|
|
Oops - OK it seems that in my class the $argc/$argv are not available as such however in the "main" they are available. So this won't work:
| Code: |
class test {
function test() {
var_dump($argv);
}
}
test();
|
But this will:
| Code: |
class test{
function test($argv) {
var_dump($argv);
}
}
test($argv);
|
|
|
| Back to top |
|
 |
Tomas Mysik Posted via mailing list.
|
Posted: Tue Jul 07, 2009 10:46 am Post subject: Run configuration / script / arguments not working? |
|
|
Hi,
Dne pondělí 06 července 2009 15:16:44 willirl napsal(a):
| Quote: | Oops - OK it seems that in my class the $argc/$argv are not available as
such however in the "main" they are available. So this won't work:
Code:
class test {
function test() {
var_dump($argv);
}
}
test();
But this will:
Code:
class test{
function test($argv) {
var_dump($argv);
}
}
test($argv);
|
apparently it seems that $argv is just local varible, not global one. But I
don't know much about PHP in command line.
Tomas
--
Tomas Mysik
address-removed |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|