fix: audit & dry run — hapus semua dependensi CodeIgniter4, perbaiki 17 bug kritis#5
Merged
Merged
Conversation
…17 bug kritis
Bug yang diperbaiki:
- DebugToolbarMiddleware::inject() memanggil render() yang tidak ada → gunakan prepare()
- Config::display() menerima 0 arg tapi dipanggil dengan arg → tambah param opsional
- Config extends BaseCollector menyebabkan static method conflict → hapus extends
- History: constructor tanpa param tapi dipanggil new History($config) → tambah constructor
- History::setFiles() menggunakan WRITEPATH (CI4 constant) → gunakan historyPath dari config
- Database.php: seluruh file masih CI4 (Query, config(), is_cli(), \Config\Database, Time) → tulis ulang menggunakan DatabaseAdapterInterface
- Timers.php: service('timer') CI4 → static start()/stop() agnostik
- Events.php: \CodeIgniter\Events\Events → static trigger() agnostik
- Logs.php: service('logger') CI4 → static addLog() agnostik
- Views.php: service('renderer') CI4 → static logView() agnostik
- Files.php: clean_path() CI4 → normalizePath() + isCoreFile() native PHP
- Routes.php: service('routes/router') + DefinedRouteCollector CI4 → RouterInterface
- BaseCollector::cleanPath() memanggil clean_path() CI4 → str_replace native
- toolbar.tpl.php: use CodeIgniter\..., site_url(), $CI_VERSION, $parser → dihapus/diganti
- Semua .tpl: CI4 parser syntax ({key}, {loop}...{/loop}) → plain PHP foreach/if
- phpunit.dist.xml: bootstrap CI4 system/Test/bootstrap.php → vendor/autoload.php
- AdodbDatabaseAdapter::logQuery() tambah parameter $startTime untuk data timeline
- Database::reset() dibuat static agar dapat dipanggil dari tearDown test
Ditambahkan: 3 test file (42 tests, 2595 assertions — semua lulus)
https://claude.ai/code/session_01QevTXiGqzvPkwfj8YeEmB8
There was a problem hiding this comment.
Phpcs (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
…ate_from_format Menghilangkan warning "Avoid using static access to class \DateTime" dari PHPMD/PHPStan. Hasil DateTime disimpan ke variabel $dt agar tidak memanggil factory method dua kali. https://claude.ai/code/session_01QevTXiGqzvPkwfj8YeEmB8
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ringkasan
Audit menyeluruh terhadap library WizdamDebugToolbar yang ditemukan masih mengandung ~80% dependensi CodeIgniter4 meski diklaim sebagai framework-agnostic. Semua CI4 dependencies dihapus dan 17 bug kritis diperbaiki.
Bug yang Diperbaiki
Collectors
service("timer", true)→ static accumulatorstart()/stop()/getTimers()/reset()\CodeIgniter\Events\Events→ statictrigger(string $event, float $start, float $end)service("logger")->logCache→ staticaddLog(string $level, string $msg)service("renderer")→ staticlogView(string $view, float $start, float $end, array $data)service("routes"),service("router"),DefinedRouteCollector→RouterInterfacevia static registryQueryclass CI4,is_cli(),clean_path(),Time::now(),\Config\Database→DatabaseAdapterInterfacevia static registrystaticextends BaseCollector(konflik static method), tambah parameterarray $config = []WRITEPATHdengan$this->historyPath, fix null-checkDateTimeclean_path()dengannormalizePath()+isCoreFile()cleanPath()CI4 dengan pure PHPMiddleware
render()(tidak ada) denganprepare()Views
_*.tpl: Konversi dari CI4 Parser syntax ke PHP murniBuild
vendor/autoload.phpDry Run (PHPUnit)