2017 © Pedro Peláez
 

library emerald-beans

image

app2641/emerald-beans

  • Saturday, January 10, 2015
  • by app2641
  • Repository
  • 2 Watchers
  • 0 Stars
  • 4,056 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

EmeraldBeans

EmeraldBeans は俺々コマンド管理クラスだ。, (*1)

定数とディレクトリの準備

動作には LIB と APP 定数の指定が必要。 LIB はディレクトリパス、 APP はアプリケーション名を指定する。, (*2)

<?php
define('LIB', '/Users/hoge/Desktop/Test/library');
define('APP', 'App');

LIB ディレクトリの中には APP アプリケーション名の空ディレクトリを作る。, (*3)

$ mkdir /Users/hoge/Desktop/Test/library/App

起動スクリプトを作る

EmeraldBeans のコマンドを呼ぶスクリプトを作る。, (*4)

$ touch ./run
$ chmod +x ./run
$ vi ./run
<?php
use Emerald\CLI;

CLI::getInstance()->execute($argv);

起動スクリプトを動かす

引数なしで起動すると動かせるコマンドのリストが表示される。, (*5)

$ ./run

-- EmeraldBeans CommandsList --
  Generate:                      引数に指定した名前で新しいコマンドを生成します

引数にコマンドを指定すればコマンドクラスが動く。, (*6)

$ ./run Generate Foo
  success:  Foo command is created!

LIB/APP/Commands ディレクトリにコマンドクラスが生成されている。
生成したクラスに任意の処理を記述できる。, (*7)

$ ls library/App/commands/
Foo.php

$ vi library/App/commands/Foo.php

The Versions

10/01 2015

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.4

 

21/05 2014

0.1

0.1.0.0

  Sources   Download

The Requires

  • php >=5.4