diff --git a/Guardfile b/Guardfile index e773bcb..cee967f 100644 --- a/Guardfile +++ b/Guardfile @@ -2,14 +2,18 @@ # More info at https://github.com/guard/guard#readme group :development do + gem 'guard' gem 'guard-livereload', require: false + gem 'guard-shell' end # Add files and commands to this file, like the example: # watch(%r{file/path}) { `command(s)` } # guard :shell do - watch(%r{htdocs/.+\.(php)}) { 'phpdoc -d ./htdocs/lib -t ./docs/' } + watch(%r{htdocs/.+\.(php)}) do + system 'phpdoc', '-d', './htdocs/lib', '-t', './docs/' + end end # LiveReload diff --git a/README.md b/README.md index d2c96cb..ffde88c 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,64 @@ 包含每位學生的學習資料、場地狀況、學習教材。以及處理學習路徑規劃。 -## 系統需求 +## 使用需求 * PHP5.3 以上,需要有以下Extension: * pdo_mysql * zip * MariaDB 5.5.31 (可用MySQL) +*** + +## 開發需求 +* 支援UTF-8編碼的文字編輯器 +* 開發文件產生器: phpdoc +* 自動化建置工具 + * guard(需有ruby環境) + * guard-shell + * guard-livereload + +## 建置開發環境 +### 安裝php, ruby 環境 +TODO: 代補,需有`gem`, `phar` + +### 安裝Guard + + gem install guard + gem install guard-shell + gem install guard-livereload + +#### 瀏覽器plugin安裝 +[LiveReload - browser extensions](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) + +支援主流瀏覽器: + +* Firefox +* Chrome +* Safari + +### 安裝phpdoc + + pear channel-discover pear.phpdoc.org + pear install phpdoc/phpDocumentor + +## 自動化建置 +很簡單,只要下以下指令即可啟動 + + guard + +啟動後會監視專案內的`.php`檔案,一有任何變動將會 + +* phpdoc: 重新建立開發文件 +* livereload: 呼叫瀏覽器自動重新整理 + +#### 相關參考 +* +* ## 開發文件 已將整份專案使用[PHPDocumentor](http://www.phpdoc.org/)產生出[開發文件網站](docs/index.html) -產生指令: +產生指令(若有使用Guard的話可省略,會自動連同一起產生): phpdoc -d ./htdocs/lib -t ./docs/ diff --git a/htdocs/index.php b/htdocs/index.php new file mode 100644 index 0000000..b39c40d --- /dev/null +++ b/htdocs/index.php @@ -0,0 +1,11 @@ + + + + + Creating... + + +

建置中~

+ + + \ No newline at end of file diff --git a/htdocs/lib/User/Exceptions.php b/htdocs/lib/User/Exceptions.php index e38f461..1b664d0 100644 --- a/htdocs/lib/User/Exceptions.php +++ b/htdocs/lib/User/Exceptions.php @@ -50,7 +50,6 @@ class UserNoFoundException extends UserException { } } - /** * 使用者登入密碼錯誤 * @since 3.0.0 @@ -61,6 +60,16 @@ class UserPasswordErrException extends UserException { } } +/** + * 此帳號未啟用 + * @since 3.0.0 + */ +class UserNoActivatedException extends UserException { + public function __construct($userId) { + parent::__construct($userId, 'User: "'.$this->type.'" is no activated.'); + } +} + // 建立使用者 ====================================================================== /** * 已有重複的使用者名稱 @@ -71,4 +80,3 @@ class UserIdExistException extends UserException { parent::__construct($userId, 'UserId: "'.$this->type.'" is exist.'); } } -