{"id":17736560,"url":"https://github.com/toshimaru/simplerequestdispatcher","last_synced_at":"2025-03-31T19:17:00.917Z","repository":{"id":5273917,"uuid":"6452768","full_name":"toshimaru/SimpleRequestDispatcher","owner":"toshimaru","description":"PHP Simple Request Dispatcher dispatches URL to Controllers. No Models, No Views.","archived":false,"fork":false,"pushed_at":"2014-03-20T05:18:21.000Z","size":320,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T18:22:28.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toshimaru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-30T06:09:07.000Z","updated_at":"2024-04-14T18:22:28.071Z","dependencies_parsed_at":"2022-07-04T17:33:01.257Z","dependency_job_id":null,"html_url":"https://github.com/toshimaru/SimpleRequestDispatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshimaru%2FSimpleRequestDispatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshimaru%2FSimpleRequestDispatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshimaru%2FSimpleRequestDispatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toshimaru%2FSimpleRequestDispatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toshimaru","download_url":"https://codeload.github.com/toshimaru/SimpleRequestDispatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523847,"owners_count":20791444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T00:23:27.315Z","updated_at":"2025-03-31T19:17:00.888Z","avatar_url":"https://github.com/toshimaru.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/toshimaru/SimpleRequestDispatcher.png?branch=master)](https://travis-ci.org/toshimaru/SimpleRequestDispatcher)\n\nSimple Request Dispatcher\n=====\nPHP Simple Request Dispatcher dispatches URL to Controllers. No Models, No Views. Inspired by CakePHP.\n\nRequirements\n-----\n* Web Server - Apache and mod_rewrite\n* PHP 5.3 or greater\n\nFeatures\n-----\n* No models, No views\n* Simple, testable, minimal controller\n* Using composer\n* Using autoload (There are two versions of autoload - with or without composer's autoload)\n\nWhy no models, no views?\n-----\nWhen I joined a project, there were tons of legacy code. The code was seperated with some roles - Model, View, Controller, yeah, it was like MVC. However, the controller wasn't classed and testable(I felt like hell!). I ended up replacing only controllers. This dispatcher is written based on the code I wrote at that time.\n\nQuickstart\n-----\n```bash\n$ git clone git://github.com/toshimaru/SimpleRequestDispatcher.git\n$ cd SimpleRequestDispatcher\n$ composer install\n# require php5.4+ to use command `php -S`\n$ php -S localhost:8000\n```\n\nAccess `localhost:8000` with your browser, you can see '**Your request is successfully dispatched!**'. Enjoy!\n\nDirectory Structure\n-----\n\n| Directory   | Description         |\n| ----------- | ------------------- |\n| Controller/ | Contains controllers.                 |\n| Tests/      | Contains tests. Written with PHPUnit. |\n| Lib/        | Contains core code.                   |\n\nDispatch rule\n-----\n\n| Request     | Controller       | Action        |\n| ----------- | ---------------- | ------------- |\n| /                  | Index.php      | index        |\n| /controller/       | Controller.php | index        |\n| /controller/action | Controller.php | action       |\n| /controller/action/var | Controller.php | action($var)      |\n\nControllers\n-----\n\nDefault controller is `Index.php` and default action is `function index()`.\n\nAll controllers should extend `\\Controller\\Controller` class so that every controller can use common functions which are defined in `Controller.php`.\n\nSee `Sample.php` to see how it works.\n\nUnit Testing\n-----\nBefore running tests, you need to install PHPUnit via Composer:\n\n    composer install --dev\n\nAfter installing PHPUnit, you can test the code:\n\n    vendor/bin/phpunit\n\nLicense\n-----\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshimaru%2Fsimplerequestdispatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoshimaru%2Fsimplerequestdispatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoshimaru%2Fsimplerequestdispatcher/lists"}