From 39625f2342223bf4354e62a43cf9731d8c4eae7f Mon Sep 17 00:00:00 2001 From: totoprayogo1916 <2387514+totoprayogo1916@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:55:40 +0700 Subject: [PATCH 1/7] install ... --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 4c8813d0a..f7751c06a 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "require": { "php": ">=7.4", "codeigniter/framework": "^3", + "luthier/luthier": "^1.0", "vlucas/phpdotenv": "^5.5" }, "require-dev": { From fdfeeb003f40dfbb05f14911bfd06f41233bf777 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 <2387514+totoprayogo1916@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:49:41 +0700 Subject: [PATCH 2/7] setup --- donjo-app/config/hooks.php | 2 ++ donjo-app/config/routes.php | 2 ++ donjo-app/controllers/LuthierController.php | 21 +++++++++++++++++++++ donjo-app/routes/api.php | 7 +++++++ donjo-app/routes/cli.php | 14 ++++++++++++++ donjo-app/routes/web.php | 3 +++ 6 files changed, 49 insertions(+) create mode 100644 donjo-app/controllers/LuthierController.php create mode 100644 donjo-app/routes/api.php create mode 100644 donjo-app/routes/cli.php create mode 100644 donjo-app/routes/web.php diff --git a/donjo-app/config/hooks.php b/donjo-app/config/hooks.php index 2e290b6bf..8aca92fff 100644 --- a/donjo-app/config/hooks.php +++ b/donjo-app/config/hooks.php @@ -20,3 +20,5 @@ 'filepath' => 'hooks', 'params' => [], ]; + +$hook = Luthier\Hook::getHooks(); diff --git a/donjo-app/config/routes.php b/donjo-app/config/routes.php index 9eb5025fe..7397143b5 100644 --- a/donjo-app/config/routes.php +++ b/donjo-app/config/routes.php @@ -53,3 +53,5 @@ $route['default_controller'] = 'main'; $route['404_override'] = ''; $route['translate_uri_dashes'] = false; + +$route = Luthier\Route::getRoutes(); diff --git a/donjo-app/controllers/LuthierController.php b/donjo-app/controllers/LuthierController.php new file mode 100644 index 000000000..781b54ef5 --- /dev/null +++ b/donjo-app/controllers/LuthierController.php @@ -0,0 +1,21 @@ + Date: Sun, 3 Dec 2023 20:18:22 +0700 Subject: [PATCH 3/7] csfix --- donjo-app/controllers/LuthierController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/donjo-app/controllers/LuthierController.php b/donjo-app/controllers/LuthierController.php index 781b54ef5..0aa575d81 100644 --- a/donjo-app/controllers/LuthierController.php +++ b/donjo-app/controllers/LuthierController.php @@ -7,8 +7,7 @@ * pointed in all our routes, this allows to create dynamic routes without hacking/extending * the CI_Router class. */ - -defined('BASEPATH') OR exit('No direct script access allowed'); +defined('BASEPATH') || exit('No direct script access allowed'); class LuthierController extends CI_Controller { From f7a230e2f5109ce3b6cea2c807b39f60e4e185b4 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 <2387514+totoprayogo1916@users.noreply.github.com> Date: Sun, 3 Dec 2023 20:20:23 +0700 Subject: [PATCH 4/7] tambahkan fungsi identik dengan CI4 --- donjo-app/helpers/donjolib_helper.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/donjo-app/helpers/donjolib_helper.php b/donjo-app/helpers/donjolib_helper.php index 6bce9e683..8f16ed9b7 100644 --- a/donjo-app/helpers/donjolib_helper.php +++ b/donjo-app/helpers/donjolib_helper.php @@ -1,5 +1,19 @@ load->view() @@ -8,7 +22,7 @@ function view(string $view, array $data = [], bool $return = false) { $CI = &get_instance(); - $CI->load->view($view, $data, $return); + return $CI->load->view($view, $data, $return); } } From e39dfe428ddf873cd3920e35ec9e65096c50e4c8 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 <2387514+totoprayogo1916@users.noreply.github.com> Date: Sun, 3 Dec 2023 20:39:04 +0700 Subject: [PATCH 5/7] perbaikan fungsi --- donjo-app/helpers/donjolib_helper.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/donjo-app/helpers/donjolib_helper.php b/donjo-app/helpers/donjolib_helper.php index 8f16ed9b7..e368f74d5 100644 --- a/donjo-app/helpers/donjolib_helper.php +++ b/donjo-app/helpers/donjolib_helper.php @@ -8,9 +8,16 @@ function url_to(string $route_name, ...$args): string } if (! function_exists('route_to')) { - function route_to(string $route_name, ...$args): string + function route_to(string $route_name, ...$args) { - return uri_string(route($route_name, $args)); + $route = route($route_name, $args); + $urlParts = parse_url($route); + + if ($urlParts !== false && isset($urlParts['path'])) { + return trim($urlParts['path'], '/'); + } + + return $route; } } From 00c05b1dbe91cc29b2f00fa6574a441a22f4116a Mon Sep 17 00:00:00 2001 From: totoprayogo1916 <2387514+totoprayogo1916@users.noreply.github.com> Date: Sun, 3 Dec 2023 20:54:51 +0700 Subject: [PATCH 6/7] install --- donjo-app/Views/install/index.php | 2 +- donjo-app/controllers/Main.php | 16 ++++++++-------- donjo-app/helpers/donjolib_helper.php | 2 +- donjo-app/routes/cli.php | 1 - donjo-app/routes/web.php | 7 ++++++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/donjo-app/Views/install/index.php b/donjo-app/Views/install/index.php index 928683653..9dc5f4a09 100644 --- a/donjo-app/Views/install/index.php +++ b/donjo-app/Views/install/index.php @@ -51,7 +51,7 @@