{"id":22799185,"url":"https://github.com/dhammon/mvc-framework","last_synced_at":"2025-03-30T19:15:11.116Z","repository":{"id":159043427,"uuid":"548621050","full_name":"dhammon/mvc-framework","owner":"dhammon","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-16T20:14:10.000Z","size":949,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T21:43:18.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhammon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-09T23:29:30.000Z","updated_at":"2022-10-09T23:31:03.000Z","dependencies_parsed_at":"2023-05-01T22:00:48.830Z","dependency_job_id":null,"html_url":"https://github.com/dhammon/mvc-framework","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/dhammon%2Fmvc-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhammon%2Fmvc-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhammon%2Fmvc-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhammon%2Fmvc-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhammon","download_url":"https://codeload.github.com/dhammon/mvc-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365650,"owners_count":20765549,"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-12-12T07:08:14.690Z","updated_at":"2025-03-30T19:15:11.105Z","avatar_url":"https://github.com/dhammon.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (*another*) PHP MVC Framework\nIncludes autoloader and routing.\n\n## Server Setup\nTested on PHP7 and Apache2\n1. `sudo a2enmod rewrite`\n2. Configure `apache2.conf`\nNeeds AllowOverrride All for htaccess rewrite\n```conf\n\u003cDirectory /path/to/webroot/\u003e\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n        Allow from localhost\n\u003c/Directory\u003e\n```\n\n## Use\n1. Request URIs follow this pattern `/controller/method/param1/paramN`\n   1. Configuration  \n      1. Add new routes in `/config/Routes.php `\n      2. Add new namespaces in `/config/Namespaces.php`\n2. Interfaces\n   1. List of Intefaces in Core (src/)\n      1. Controller - instantiates Service and View\n      2. Service - instantiates mappers, business logic classes, and entities (returns)\n      3. Mapper - uses DBHelper for repository queries\n      4. Entity - Getters/Setters store for View\n      5. View - uses entities and renders views/templates\n3. Exceptions\n   1. Update /public/index.php with new exception classes to catch them\n   2. Uncaught excpetions go to Exception|Error handled and logged with error code\n4. Tests\n   1. Only test classes under app directory\n   2. Unit - where no other resource (class, filesystem, database, etc) is needed for the method being tested\n   3. Integration - where other resources are included in the test\n   4. Functional - client tests (eg rendered page, api response, etc)\n\n\n## Data Flow\n\n```bash\n#           ##\n#         ##  ##\n#       ##      ##\n#     ##  Client  ## \u003c-------------------------------------------+\n#       ##      ##                                               |\n#         ##  ##                                                 |\n#           ##                                                   |\n#            |                                                   |\n#            v                                                   |\n#   ##################         ##################         ################\n#   #                #         #                #         #              #\n#   #   index.php    # ------\u003e #   controller   #-------\u003e #     View     #\n#   #                #         #                #         #              #\n#   ##################         ##################         ################\n#                                 |         ^                    ^\n#                                 |         |                    |\n#                                 v         |                    v\n#                              ##################         +--------------+\n#                              #                #         |              |\n#                              #   Service      #         |   Templates  |\n#                              #                #         |              |\n#                              ##################         +--------------+\n#                                      ^\n#                 +--------------------+--------------------+\n#                 v                    v                    v\n#   ##################         ##################         ################\n#   #                #         #                #         #              #\n#   #   Mapper       #         #   BL Classes   #         #     Entity   #\n#   #                #         #                #         #              #\n#   ##################         ##################         ################\n#          ^\n#          |\n#          v\n#      ##########\n#      #        #\n#      #        #\n#      #   DB   #\n#      #        #\n#      #        #\n#      ##########\n#\n```\n\n## References\n1. Inspirations from: https://github.com/andrejrs/php-mvc-example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhammon%2Fmvc-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhammon%2Fmvc-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhammon%2Fmvc-framework/lists"}