{"id":16347781,"url":"https://github.com/oscarotero/fol","last_synced_at":"2025-04-12T09:33:02.686Z","repository":{"id":57033317,"uuid":"78274383","full_name":"oscarotero/fol","owner":"oscarotero","description":"Base app to build websites","archived":false,"fork":false,"pushed_at":"2021-12-16T17:52:00.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-28T06:08:47.934Z","etag":null,"topics":["app","container-interop","psr-7","service-provider"],"latest_commit_sha":null,"homepage":null,"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/oscarotero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-01-07T11:10:57.000Z","updated_at":"2021-12-16T17:50:48.000Z","dependencies_parsed_at":"2022-08-23T20:50:21.063Z","dependency_job_id":null,"html_url":"https://github.com/oscarotero/fol","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Ffol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Ffol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Ffol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Ffol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarotero","download_url":"https://codeload.github.com/oscarotero/fol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223510342,"owners_count":17157306,"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":["app","container-interop","psr-7","service-provider"],"created_at":"2024-10-11T00:45:56.965Z","updated_at":"2024-11-07T12:06:16.027Z","avatar_url":"https://github.com/oscarotero.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fol\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE)\n[![Build Status][ico-travis]][link-travis]\n[![Quality Score][ico-scrutinizer]][link-scrutinizer]\n\nThis is a simple class with some utils to build websites with the following features:\n\n## Paths and URI\n\nManage the path of the app and the public uri using the `UriInterface` from [PSR-7](http://www.php-fig.org/psr/psr-7/):\n\n```php\nuse Fol\\App;\nuse Zend\\Diactoros\\Uri;\n\n$path = '/var/www/my-website';\n$uri = new Uri('http://localhost/my-website');\n\n$app = new App($path, $uri);\n\n//Get the path\n$app-\u003egetPath(); // /var/www/my-website\n$app-\u003egetPath('dir/subdir', '../other'); // /var/www/my-website/dir/other\n\n//Get the uri\n(string) $app-\u003egetUri(); // http://localhost/my-website\n(string) $app-\u003egetUri('post/1', 'details'); // http://localhost/my-website/post/1/details\n```\n\n## PSR-11\n\nIt's compatible with [PSR-11](https://github.com/php-fig/container) and [container-interop/service-provider](https://github.com/container-interop/service-provider), and allows to nest other containers:\n\n```php\nuse Fol\\App;\nuse Zend\\Diactoros\\Uri;\n\n$app = new App(__DIR__, new Uri('http://localhost/my-website'));\n\n//Set a value\n$app-\u003eset('database.config', [\n    'user' =\u003e 'foo',\n    'pass' =\u003e 'bar'\n]);\n\n//Get the value\n$config = $app-\u003eget('database.config');\n\n//Set a service\n$app-\u003eaddService('database', function ($app) {\n    return new DatabaseClass($app-\u003eget('database.config'));\n});\n\n//Get the service value\n$database = $app-\u003eget('database');\n\n//And add ServiceProviderInterface instances to register several dependencies\n$app-\u003eaddServiceProvider(new MyServiceProvider());\n```\n\n---\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information about recent changes.\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/oscarotero/fol.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/oscarotero/fol/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/g/oscarotero/fol.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/oscarotero/fol\n[link-travis]: https://travis-ci.org/oscarotero/fol\n[link-scrutinizer]: https://scrutinizer-ci.com/g/oscarotero/fol\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Ffol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarotero%2Ffol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Ffol/lists"}