CodeIgniter Forums

Full Version: [CI4] CLI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Good Day!! Is it included in CodeIgniter 4 feature's the CLI like artisan in laravel? it's pretty cool.

I love CodeIgniter conventions and documentations and the way it is built but a CLI like artisan in laravel will make it better. A framework trying hard to adopt CodeIgniter way (FuelPHP) have it, they call it oil. Fuel is good but they have a very bad documentation. Hopefully this features will be available soon to CodeIgniter.
I'm exploring the possibility now, since it would clean up some of the migration CLI commands, the development server and possibly a couple of other items down the road. Don't expect much, if any, code generation from it, though, as that's not in the works. If this makes it into final release, it will be simple to specify provide your own CLI commands to do code generation if you desire.
It would be really nice to remove the need for a migration controller and be able to run the migrations from CLI. Is there any update on this and if it has made it into 4.x?
Yes, the controller is gone and there's a CLI command for it now. Just run the following to see what's available:

Code:
php ci.php
Wouldn't it be nice if we remove that .php from the name of ci.php ? (as simple as possible)

We have already the env php at the start so in most cases it will work and without calling the php command before the file.. 
Code:
#!/usr/bin/env php

"ci" shouldn't be used, so either "CI" or "[c|C]ode[i|I]gniter" or even "ignite/r" ..
This way people will only have to write CI <command> (or max php CI <command>).
(07-16-2017, 11:30 PM)sv3tli0 Wrote: [ -> ]Wouldn't it be nice if we remove that .php from the name of ci.php ? (as simple as possible)

We have already the env php at the start so in most cases it will work and without calling the php command before the file.. 
Code:
#!/usr/bin/env php

"ci" shouldn't be used, so either "CI" or "[c|C]ode[i|I]gniter" or even "ignite/r" ..
This way people will only have to write CI <command> (or max php CI <command>).

I had planned on removing the extension at some point, but hadn't yet looked into the implications on Windows machines, and any other possible conflicts. It's been a decade since I've worked on Windows enough to remember how that would affect things.

What you don't mention is why ci shouldn't be used. Ignite comes across as either cheesy or cocky depending on my mood that day (and yes, it's one that I considered), but the only contradiction I could see with ci was continuous integration, which wouldn't matter whether it was lower or uppercase. And I don't recall ever seeing any CLI function that was named in uppercase, so I think that idea's out.
(07-17-2017, 07:27 AM)kilishan Wrote: [ -> ]I had planned on removing the extension at some point, but hadn't yet looked into the implications on Windows machines, and any other possible conflicts. It's been a decade since I've worked on Windows enough to remember how that would affect things.

What you don't mention is why ci shouldn't be used. Ignite comes across as either cheesy or cocky depending on my mood that day (and yes, it's one that I considered), but the only contradiction I could see with ci was continuous integration, which wouldn't matter whether it was lower or uppercase. And I don't recall ever seeing any CLI function that was named in uppercase, so I think that idea's out.

"ci" exists as command at linux distributions (related to RCS).
I think that such file name must be short and unique so that there are no conflicts with any standard commands in Linux/Windows/MacOS