{"id":22663125,"url":"https://github.com/osmphp/core","last_synced_at":"2025-04-12T07:22:09.741Z","repository":{"id":47356402,"uuid":"293831233","full_name":"osmphp/core","owner":"osmphp","description":"Provides base classes for building modular PHP applications, and the compiler that bundles modules together. This library is the foundation for Osm Framework.","archived":false,"fork":false,"pushed_at":"2022-03-07T17:54:02.000Z","size":278,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"v0.10","last_synced_at":"2025-03-26T02:34:53.417Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osmphp.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":"2020-09-08T14:15:09.000Z","updated_at":"2022-01-05T09:14:26.000Z","dependencies_parsed_at":"2022-09-04T19:30:59.599Z","dependency_job_id":null,"html_url":"https://github.com/osmphp/core","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmphp%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmphp%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmphp%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmphp%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osmphp","download_url":"https://codeload.github.com/osmphp/core/tar.gz/refs/heads/v0.10","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248531003,"owners_count":21119677,"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-09T12:17:19.444Z","updated_at":"2025-04-12T07:22:09.717Z","avatar_url":"https://github.com/osmphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/osmphp/core/actions\"\u003e\u003cimg src=\"https://github.com/osmphp/core/workflows/tests/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/osmphp/core\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/osmphp/core\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/osmphp/core\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/osmphp/core\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/osmphp/core\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/osmphp/core\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n* [About osmphp/core](#about-osmphpcore) \n* [Prerequisites](#prerequisites) \n* [Installation](#installation) \n* [Getting Started](#getting-started)\n* [Using The Library](#using-the-library)\n* [Contributing](#contributing)\n* [License](#license)\n* [Commercial License \u0026 Support](#commercial-license--support)\n\n## About `osmphp/core`\n\n`osmphp/core` enables modular software development in any PHP project - dividing\nthe application code into modules - reusable, extensible and pluggable parts.\n\nA module is a directory responsible for a single feature or concept of your\napplication. For example one module may handle products in e-commerce\napplication, another - authorize users into the application's restricted area,\nyet another one - enable the application to be used in the command line, and so\non.\n\n`osmphp/core` is different from other frameworks in several ways:\n\n* **Unprecedented extensibility**. From your module, add new and modify\n  existing (even protected) methods of any other module class.\n* **Smaller footprint, faster execution**. Class property values are computed\n  only when (and if) they are accessed, unless you explicitly assign them.\n* **Simple object instantiation**. Classes know and use their default\n  dependencies, you don't have to pass them when creating an object. Unless you\n  want to, for example, when mocking a dependency in a unit test. It also\n  completely removes the hassle of configuring a dependency injection container.\n* **Auto-wiring**. Plug-in your class into the application just by extending a\n  certain class, or by adding an attribute. The application intimately knows the\n  class definitions of all the modules, and wires them together without\n  additional configuration files.\n\n## Prerequisites\n\nThis library requires:\n\n* PHP 8\n    * `mbstring` extension\n* Composer\n\nInstall them if necessary.\n\n## Installation\n\nInstall the `osmphp/core` Composer package:\n\n        composer require osmphp/core\n\n## Getting Started \n\nPrepare the project for using the library as described below. In the future, this package will come preinstalled with a project template, and you will not have to write this boilerplate code.\n\n1. Create an application class in the `src/App.php` file (assuming that your project is configured to autoload the `App\\` namespace from the `src/` directory; if it's not the case, adjust the code snippets accordingly):\n\n        \u003c?php\n        declare(strict_types=1);\n        namespace App;\n        use Osm\\Core\\App as BaseApp;\n        \n        class App extends BaseApp {\n        }\n\n2. Create a module group class and in the `src/ModuleGroup.php`:\n\n        \u003c?php\n        \n        declare(strict_types=1);\n        namespace App;\n        use Osm\\Core\\ModuleGroup as BaseModuleGroup;\n        \n        class ModuleGroup extends BaseModuleGroup {\n        }\n\n3. Compile the application (in Windows, use `\\` instead of `/`):\n\n        php vendor/osmphp/core/bin/compile.php App\\App\n\n4. In your entry point file `public/index.php` (there may be more than one entry point file, add the following to every one of them), make sure that the code is executed in context of the application object:\n\n        \u003c?php\n        \n        declare(strict_types=1);\n        \n        use Osm\\Runtime\\Apps;\n        use App\\App;\n        \n        ...\n             \n        Apps::$project_path = dirname(__DIR__);\n        Apps::run(Apps::create(App::class), function() {\n            ...\n        });\n\n## Using The Library\n\nDocumentation is a work in progress. This section will be updated once it is ready.\n\n## Contributing\n\nYour help is really welcome, be it a reported bug, an occasional pull request, or the full fledged participation. To get started, open an issue and tell us that you want to be a part of it, and we'll get in touch.   \n\n## License\n\nThe `osmphp/core` package is open-sourced software licensed under the [GPL v3](LICENSE) license.\n\n## Commercial License \u0026 Support\n\nIn case the open source license if not a good fit for you, or if you need support, [let me know](https://github.com/osmianski). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmphp%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosmphp%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmphp%2Fcore/lists"}