Welcome Guest, Not a member yet? Register   Sign In
Cli for CodeIgniter 3.0
#1

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
Reply
#2

This is what I am looking for, Excellent tool.
Reply
#3

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

Thank you!
Reply
#4

(This post was last modified: 05-05-2015, 02:14 PM by orionstar.)

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)
Reply
#5

(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-cl...te.php#L53

Your command and seeder path is defined in config/ folder.
command path:
https://github.com/kenjis/codeigniter-cl...on.php#L44
seeder path:
https://github.com/kenjis/codeigniter-cl...on.php#L40
Reply
#6

I changed. "commpand path" is array now:
https://github.com/kenjis/codeigniter-cl...on.php#L49
Reply
#7

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

https://github.com/kenjis/codeigniter-cli
Reply
#8

(This post was last modified: 05-27-2015, 09:43 AM by yousafsyed.)

(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
Reply
#9

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

(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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB