{"id":13669586,"url":"https://github.com/hfcorriez/pagon","last_synced_at":"2025-04-27T04:33:50.080Z","repository":{"id":2188942,"uuid":"3136779","full_name":"hfcorriez/pagon","owner":"hfcorriez","description":"Modern PHP Framework","archived":false,"fork":false,"pushed_at":"2014-12-24T11:25:54.000Z","size":2189,"stargazers_count":199,"open_issues_count":2,"forks_count":26,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-08-02T08:08:30.616Z","etag":null,"topics":["framework","pagon","php"],"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/hfcorriez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-09T13:44:37.000Z","updated_at":"2024-02-07T18:17:12.000Z","dependencies_parsed_at":"2022-08-19T01:31:03.977Z","dependency_job_id":null,"html_url":"https://github.com/hfcorriez/pagon","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfcorriez%2Fpagon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfcorriez%2Fpagon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfcorriez%2Fpagon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfcorriez%2Fpagon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hfcorriez","download_url":"https://codeload.github.com/hfcorriez/pagon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224060375,"owners_count":17249013,"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":["framework","pagon","php"],"created_at":"2024-08-02T08:01:18.158Z","updated_at":"2024-11-11T06:30:34.479Z","avatar_url":"https://github.com/hfcorriez.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"Pagon\n=====\n\nPagon is Modern PHP framework with elegant syntax. It also allow you to build RESTful web applications quickly and easily.\n\nOther languages: [中文文档]\n\n## Quick Started\n\n### Installation\n\nPagon use [Composer] to manage its dependencies. First you need to have `Composer` installed globally.\n\nYou can also download a copy of the `composer.phar` in your repository's root, run a command such as the following:\n\n``` bash\ncurl -s https://getcomposer.org/installer | php\n```\n\n#### via Download/Git\n\n[Download] source files from Github or clone from Github\n\n``` bash\n$ git clone git@github.com:hfcorriez/pagon.git myapp\n$ composer install # php composer.phar install\n```\n\n#### Via Composer Create-Project\n\n``` bash\n$ composer create-project pagon/pagon myapp # php composer.phar ...\n```\n\n### Debugger server\n\nYou can use Pagon built-in debugger server for rapid development under development environment. please use a ` Nginx` or `Apache` server for production environment.\n\n``` bash\n$ ./bin/pagon serve [-p|--port \u003cPORT\u003e]\nPagon serve at http://127.0.0.1:5000\n```\n\n## Configuration\n\nAll of the configuration files for the Pagon are stored in the `app/config` directory.\n\nOptional attributes\n\n```\nmode        # Runing mode\ndebug       # Debug mode\nviews       # Template directory\nbuffer      # Open a buffer or not\ntimezone    # timezone (default: UTC)\ncharset     # charset (default: UTF-8)\nautoload    # Auto load directory\nerror       # Handle error or not\nroutes      # Routes\nnames       # Router name, auto created\nalias       # Class aliases, for short class name\nnamespaces  # Namespaces\nengines     # Template engines\nerrors      # Default errors\nstacks      # stacks\nmounts      # mounts\nbundles     # bundles\nlocals      # locals\nurl_rewrite # Url rewrite or not\n```\n\n## Routing\n\nTo get started, let's create our first route. In Pagon, the simplest route is a route to a Closure.\n\n```php\n// Init app\n$app = Pagon::create();\n\n// Routing with a callback function\n$app-\u003eget('/', function($req, $res) {\n  $res-\u003erender('index.php');\n});\n\n// Routing with a class method\n$app-\u003eget('/users/:id', 'Web\\\\User');\n\n// Specify named parameters in your routes\n$app-\u003epost('/users/:id(/:op)', 'Web\\\\UserOperator');\n\n// Run app\n$app-\u003erun();\n\n```\n\n## Database\n\nPagon ships with a superb ORM: Paris. More detailed documentation and examples, please check out [Paris Doc].\n\nSimple Example\n\n```php\n$users = \\Model\\User::dispense()-\u003ewhere('status', 1)-\u003efind_many();\n```\n\n## Migration\n\nInit Database schema\n\n```bash\n./bin/cli db:init\n```\n\n\u003e Will execute file `app/migrations/schema.sql` \n\nMigrate, Status\n\n```bash\n$ ./bin/cli db:generate AddUserLoginTime\n+f ./migrations/20141208030747_AddUserLoginTime.php\n\n$ ./bin/cli db:status\n\n Status   Migration ID    Migration Name\n-----------------------------------------\n   down  20141208030747  AddUserLoginTime\n\n$ ./bin/cli db:migrate\n == 20141208030747 AddUserLoginTime migrating\n == 20141208030747 AddUserLoginTime migrated 0.0084s\n```\n\n\u003e Except `init` command, all the other commands map to [phpmig](https://github.com/davedevelopment/phpmig) to execute。\n\n## Cli\n\n\u003e Manage PHP shell for *unix console\n\n`./bin/cli`\n\n```php\n$app-\u003ecommand('db\\:init', '\\Command\\DB\\Init');\n$app-\u003ecommand('queue\\:start', '\\Command\\Queue\\Start');\n```\n\nExecution\n\n```bash\n$ ./bin/cli db:init\n$ ./bin/cli queue:start\n```\n\n## Showcase\n\niNews: [https://github.com/Trimidea/inews]\n\n## License\n\nCopyright (c) 2014-2015 hfcorriez. MIT Licensed, see [LICENSE] for details.\n\n[中文文档]: https://github.com/hfcorriez/pagon/blob/master/README_CN.md\n[Composer]: https://getcomposer.org/\n[Download]: https://github.com/hfcorriez/pagon/releases/latest\n[Paris Doc]: http://paris.readthedocs.org/en/latest/philosophy.html\n[https://github.com/Trimidea/inews]: https://github.com/Trimidea/inews\n[LICENSE]:https://github.com/hfcorriez/pagon/blob/master/LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfcorriez%2Fpagon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhfcorriez%2Fpagon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfcorriez%2Fpagon/lists"}