CodeIgniter Forums
Cli for CodeIgniter 3.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Cli for CodeIgniter 3.0 (/showthread.php?tid=61639)



Cli for CodeIgniter 3.0 - kenjis - 05-03-2015

I'm developing "Cli for CodeIgniter" which is a Cli tool for CodeIgniter 3.0.

https://github.com/kenjis/codeigniter-cli

You can create your own commands.
And it has commands to manipulate database migrations via command line.

For example:
Code:
bash-3.2$ ./cli help migrate
SUMMARY
    migrate -- Runs the migrations.
USAGE
    migrate             Migrate up to the current version.
    migrate <version>   Migrate up to the version.
    migrate status      List all migration files and versions.
    migrate version     Show migration versions.
DESCRIPTION
    migrate command runs the migrations and shows its status.

bash-3.2$ ./cli migrate status
application/database/migrations/
 20150503043122_Create_bbs.php (current/database)
 20150503060215_Create_captcha.php
 20150503060219_Create_category.php
 20150503060223_Create_product.php

Check it, if you like command line:
https://github.com/kenjis/codeigniter-cli


RE: Cli for CodeIgniter 3.0 - ipun.amin - 05-03-2015

This is what I am looking for, Excellent tool.


RE: Cli for CodeIgniter 3.0 - kenjis - 05-04-2015

(05-03-2015, 09:28 PM)ipun.amin Wrote: This is what I am looking for, Excellent tool.

Thank you!


RE: Cli for CodeIgniter 3.0 - orionstar - 05-05-2015

Is it works with wiredezign's HMVC addon? Is there a way to create commands/seeders anywhere I want? (for example.: application/modules/users/commands/AddUserCommand)


RE: Cli for CodeIgniter 3.0 - kenjis - 05-06-2015

(05-05-2015, 02:13 PM)orionstar Wrote: Is it works with wiredezign's HMVC addon? Is there a way to create commands/seeders anywhere I want? (for example.: application/modules/users/commands/AddUserCommand)

I'm not sure. It does not support HMVC. Maybe needs some customization.

In migration, it uses CI's Migration class:
https://github.com/kenjis/codeigniter-cli/blob/66b0cba949bd5c5cb497b8694013ae14c3510439/src/Command/Migrate.php#L53

Your command and seeder path is defined in config/ folder.
command path:
https://github.com/kenjis/codeigniter-cli/blob/66b0cba949bd5c5cb497b8694013ae14c3510439/config/Common.php#L44
seeder path:
https://github.com/kenjis/codeigniter-cli/blob/66b0cba949bd5c5cb497b8694013ae14c3510439/config/Common.php#L40


RE: Cli for CodeIgniter 3.0 - kenjis - 05-07-2015

I changed. "commpand path" is array now:
https://github.com/kenjis/codeigniter-cli/blob/66633db3c32bc0c637ffc39d121a5e53ae9db1c7/config/Common.php#L49


RE: Cli for CodeIgniter 3.0 - kenjis - 05-21-2015

Thanks to a contributor, ftwbzhao, now Cli for CodeIgniter supports generation of Sequential migration file.

https://github.com/kenjis/codeigniter-cli


RE: Cli for CodeIgniter 3.0 - yousafsyed - 05-25-2015

(05-21-2015, 02:52 AM)kenjis Wrote: Thanks to a contributor, ftwbzhao, now Cli for CodeIgniter supports generation of Sequential migration file.

https://github.com/kenjis/codeigniter-cli

Hi I am also porting CLI from Laravel 5. I am half the way done I am not sure how we can combine our work ? Here are examples of my CLI

[code]# Generate blank Migration
php codeigniter make:migration create_user_table
# Generate migration to create Table
php codeigniter make:migration create_user_table --table=user
# Generate migration to Update table
php codeigniter make:migration add_new_user --create=user
# Run current migration
php codeigniter migrate
# Rollback current migration
php codeigniter migrate:rollback
# Rollback all migrations
php codeigniter migrate:reset


RE: Cli for CodeIgniter 3.0 - kenjis - 07-05-2015

I've just released v0.1.0.
https://github.com/kenjis/codeigniter-cli/releases


RE: Cli for CodeIgniter 3.0 - kenjis - 07-05-2015

(05-25-2015, 05:14 PM)yousafsyed Wrote: Hi I am also porting CLI from Laravel 5. I am half the way done I am not sure how we can combine our work ? Here are examples of my CLI


Code:
# Generate blank Migration
php codeigniter make:migration create_user_table
# Generate migration to create Table
php codeigniter make:migration create_user_table --table=user
# Generate migration to Update table
php codeigniter make:migration add_new_user --create=user
# Run current migration
php codeigniter migrate
# Rollback current migration
php codeigniter migrate:rollback
# Rollback all migrations
php codeigniter migrate:reset

I didn't port from Laravel. I saw some other implementations for codeigniter.

I don't create generator for real code like creating or modifying database table and/or MVC.
If you release your code, I could reuse some of them.