ksujeet / easy
Easy — a lightweight PHP framework (routing, DI, HTTP, middleware, templating, security).
Requires
- php: ^8.1
- doctrine/dbal: ^3.6
- doctrine/orm: ^3.2
- dompdf/dompdf: ^2.0
- nikic/fast-route: ^1.3
- php-di/php-di: ^7.0
- psr/cache: ^3.0
- psr/container: ^2.0
- psr/log: ^3.0
- psr/simple-cache: ^3.0
- symfony/cache: ^6.4
- symfony/console: ^6.4
- symfony/form: ^6.4
- symfony/http-foundation: ^6.4
- symfony/security-csrf: ^6.4
- symfony/validator: ^6.4
- tracy/tracy: ^2.10
Requires (Dev)
- phpunit/phpunit: ^11.5
README
A lightweight PHP framework: DI-based routing (nikic/fast-route + php-di), an
HTTP layer (Request/Response/RedirectResponse), middleware pipeline, session
management, a template compiler/renderer with caching, a security layer
(guards, auth strategies, CSRF, password hashing), and a base controller
your application controllers extend.
This package intentionally contains no application/business code — no entities, no domain services. It's the reusable core that an application repo installs as a dependency.
Install
composer require ksujeet/easy
Wiring it into your app
Easy\Http\Controllers\BaseController depends on two small contracts
instead of any concrete class from your app, so your app supplies the
implementations:
use Easy\Contracts\Authenticatable; use Easy\Contracts\AppContextInterface; class User extends YourOrmEntity implements Authenticatable {} class AppContext implements AppContextInterface { public function user(): ?Authenticatable { /* ... */ } }
Then your app's own base controller just extends the framework one:
namespace App\Controllers; use Easy\Http\Controllers\BaseController as FrameworkBaseController; abstract class BaseController extends FrameworkBaseController { }
Every existing SomeController extends BaseController in your app keeps
working unchanged.
What changed from the original in-app version
- Removed two dead imports (
App\Services\Supports\CompanyContext,App\Services\UserAccessService) that referenced classes which no longer exist in the codebase — these were causing a class-not-found risk on autoload. BaseControllernow depends onEasy\Contracts\AppContextInterface/Authenticatableinstead of concreteApp\Services\Core\AppContext/App\Entities\Support\User, so the framework has zero dependency on application code.- Added
dompdf/dompdf,symfony/form,symfony/validator,symfony/security-csrf, andsymfony/http-foundationtorequire— these were used by framework code (Easy\Utilities\Utility,Easy\Factory\FormFactory) but were missing fromcomposer.json. - Removed
symfony/var-exporterandsymfony/uid— unused anywhere incore/orlibrary/.
License
MIT — see LICENSE.