CLI - CodeIgniter on the Command Line |
[eluser]Phil Sturgeon[/eluser]
Well the CLI setting for $config['uri_protocol'] uses the CLI parameters as a sort of URI. Example: Code: php ./index controller method param1 param2 If you were to run that in your favourite shell it would be go to the same controller/method as going to http://example.com/index.php/controller/...am1/param2. Make sense?
[eluser]hsl[/eluser]
I found a little bug,.. or it's in my app, just can't find it. I'm going to use CLI to do some stuff with cron :-) not really clean, but good for now. the only controller that works is the default [home] controller, i've made another controller and it doesn't work so: php index.php home test <--- works and: php index.php news test<--- doesn't work
[eluser]Phil Sturgeon[/eluser]
Sounds like your router is not recognising the request. Have you followed these instructions to get CLI working on the command line? http://codeigniter.com/wiki/CI_on_the_command_line/
[eluser]hsl[/eluser]
Yes, the strange thing is that it works on through the web, but not through the cli, but normally I should get the contents of a 404 through the CLI, but the request stays empty.
[eluser]Unknown[/eluser]
Just trying to get this working using fastcgi, no luck so far. Does anyone know if it should even work using fastcgi?
[eluser]lawrencesilva[/eluser]
Hi there Phil, everybody!, I have been looking for a way for me to run my CI controllers/methods under command line and I plan to run it via cron, my problem is I'm currently using Matchbox which turns CI regular uri: controller/method/parameter1/parameter2 to module/controller/method/parameter1/parameter2 and I cant seem to run the controller's method by: #php index.php module contoller method is there something that i missed doing? All your help is greatly appreciated! ![]() Thanks in advance.
[eluser]lawrencesilva[/eluser]
good news i just fixed it! ![]()
[eluser]Unknown[/eluser]
Hello guys I know that is a pretty old topic, but it is very interesting. Just in case anyone is still wondering why someone will use CI on the CLI, well, hmmmm, let me tell you a very good way of using it in my case. I operate a VoIP (Voice over IP) business and we happen to build our own custom applications for Asterisk PBX and FreeSwitch. On asterisk, it is done through the use of AGI Scripts. AGI scripts are standalone script that can be written in virtually any scripting language that you can install in your linux box. We have chosen PHP because several tools that we are using are based on PHP as well. And for that specific purpose, CodeIgniter with CLI support will be great because so far, there are several home brewed development API that are not really up to the standards that most rapid development frameworks offer. For some example of what can be achived by AGI scripts in Astrisk, we have: - IVR menus or IVR based applications - Billing systems - Call routing systems - etc. Do a search on http://voipinfo.org for more information. Keep it up Phil Sturgeon and do not let anyone discourage you. Cheers Asiby
[eluser]Phil Sturgeon[/eluser]
Thanks Asiby, this is exactly the sort of use-case I had in mind. Nobody discourages me, I just call them names. ;-)
[eluser]Unknown[/eluser]
I just stumbled across this, and if anyone's still listening would love some opinion. Basically I need to do thousands of cURL POST requests as quickly as possible, so i'm thinking instead of doing them all with curl_multi_init at once, i can break up my requests and run multiple command line instances on my CI script - effectively giving PHP some hacked-together multi-threading. Any thoughts? I figure just changing the routing feature will let me do what with ease. |
Welcome Guest, Not a member yet? Register Sign In |