diff --git a/composer.json b/composer.json index 9acec00..0f1effe 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "extra": { "think": { "services": [ - "DtApp\\ThinkLibrary" + "DtApp\\ThinkLibrary\\Library" ], "config": { "dtapp": "src/config.php" diff --git a/git.sh b/git.sh new file mode 100644 index 0000000..ff2d5a8 --- /dev/null +++ b/git.sh @@ -0,0 +1,2 @@ +git push gitee +git push github diff --git a/src/Library.php b/src/Library.php new file mode 100644 index 0000000..afd5230 --- /dev/null +++ b/src/Library.php @@ -0,0 +1,43 @@ +app->lang->load(__DIR__ . '/lang/zh-cn.php', 'zh-cn'); + $this->app->lang->load(__DIR__ . '/lang/en-us.php', 'en-us'); + } + + /** + * 启动服务 + */ + public function boot() + { + + } +} diff --git a/src/Service.php b/src/Service.php index 7a9f562..6e7ab04 100644 --- a/src/Service.php +++ b/src/Service.php @@ -1,18 +1,5 @@ 'Sorry, no permission to access the operation.', + 'think_library_not_login' => 'Sorry, requiring login to obtain view permission.', + 'think_library_delete_success' => 'Data deletion completed.', + 'think_library_delete_error' => 'Sorry, data deletion failed, please try again later.', + 'think_library_form_success' => 'Data saving completed.', + 'think_library_form_error' => 'Sorry, data saving failed, please try again later.', + 'think_library_save_success' => 'Data update completed.', + 'think_library_save_error' => 'Sorry, data update failed, please try again later.', + 'think_library_sort_success' => 'Modification of list sort completed.', + 'think_library_sort_error' => 'Sorry, modification of list sort failed, please try again later.', + 'think_library_page_html' => 'Total %s records, display %s per page, total %s page current display %s page.', + 'think_library_csrf_error' => 'Form token validation failed, please refresh and try again later.', + 'think_library_queue_exist' => 'Task has been created, please wait for processing to complete.', +]; \ No newline at end of file diff --git a/src/lang/zh-cn.php b/src/lang/zh-cn.php new file mode 100644 index 0000000..39fce0f --- /dev/null +++ b/src/lang/zh-cn.php @@ -0,0 +1,30 @@ + '抱歉,没有访问该操作的权限!', + 'think_library_not_login' => '抱歉,需要登录获取访问权限!', + 'think_library_delete_success' => '恭喜, 数据删除成功!', + 'think_library_delete_error' => '抱歉,数据删除失败, 请稍候再试!', + 'think_library_form_success' => '恭喜, 数据保存成功!', + 'think_library_form_error' => '抱歉,数据保存失败, 请稍候再试!', + 'think_library_save_success' => '恭喜,数据更新成功!', + 'think_library_save_error' => '抱歉,数据更新失败, 请稍候再试!', + 'think_library_sort_success' => '恭喜,列表排序成功!', + 'think_library_sort_error' => '抱歉,列表排序失败,请稍候再试!', + 'think_library_page_html' => '共 %s 条记录,每页显示 %s 条,共 %s 页当前显示第 %s 页。', + 'think_library_csrf_error' => '表单令牌验证失败,请刷新页面再试!', + 'think_library_queue_exist' => '任务已创建,请等待处理完成!', +]; \ No newline at end of file diff --git a/tests/test.php b/tests/test.php index b6bb97a..c335e2b 100644 --- a/tests/test.php +++ b/tests/test.php @@ -14,8 +14,8 @@ // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library // +---------------------------------------------------------------------- -use DtApp\ThinkLibrary\facade\Preg; -use DtApp\ThinkLibrary\facade\Time; +use DtApp\ThinkLibrary\facade\Pregs; +use DtApp\ThinkLibrary\facade\Times; use DtApp\ThinkLibrary\service\TestService; require '../vendor/autoload.php'; @@ -23,4 +23,4 @@ require '../vendor/autoload.php'; //var_dump(TestService::instance()->index()); -var_dump(Time::getTime()); +var_dump(Times::getTime());