NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging CLI script with arguments


Joined: 03 Mar 2004
Posts: 40
Reply with quote
I'm sure this is documented somewhere...

If you wish to launch and debug a PHP CLI script from within PhpEd with command line arguments (assuming that you've setup the project as a CLI), you can't add the arguments using the 'Run:Parameters' menu. But you can add them to the script's launch command in the Launch Box. Simply edit the launch properties for the script and add the space-delimited arguments to the GET parameter the same way you would specify them as arguments to the script on the command line. These will be correctly parsed into the argv[] array.
View user's profileFind all posts by jonphippsSend private message
Passing in CLI long options from quick launch


Joined: 18 Oct 2006
Posts: 75
Reply with quote
In the quck box launch entry, for the GET params enter your long arg format options
eg.
--database=MY_DB --assetpath=/tmp/my-assets --client=acme-widgets --bucket=acme-widgets-imgix --resizeservice=acme-widgets.imgix.net


$longopts = array(
'database:',
'assetpath:',
'clientid:',
'bucket:',
'resizeservice:',
'pathindb'
);

$options = getopt(null, $longopts);

$ options will be an enumerated array with the option names as the keys.
View user's profileFind all posts by nickweaversSend private messageVisit poster's websiteYahoo Messenger
Debugging CLI script with arguments
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic