{"id":21691455,"url":"https://github.com/yidemir/mikro","last_synced_at":"2025-04-12T09:44:11.773Z","repository":{"id":57086819,"uuid":"172935968","full_name":"yidemir/mikro","owner":"yidemir","description":"micro approach to traditional","archived":false,"fork":false,"pushed_at":"2022-07-01T13:20:39.000Z","size":365,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"1.x","last_synced_at":"2025-03-26T04:41:31.507Z","etag":null,"topics":["framework","microframework","php","router","simple"],"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/yidemir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-27T15:01:15.000Z","updated_at":"2023-10-26T09:58:32.000Z","dependencies_parsed_at":"2022-08-24T22:50:35.513Z","dependency_job_id":null,"html_url":"https://github.com/yidemir/mikro","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidemir%2Fmikro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidemir%2Fmikro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidemir%2Fmikro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidemir%2Fmikro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yidemir","download_url":"https://codeload.github.com/yidemir/mikro/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550323,"owners_count":21122929,"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","microframework","php","router","simple"],"created_at":"2024-11-25T17:38:45.191Z","updated_at":"2025-04-12T09:44:11.742Z","avatar_url":"https://github.com/yidemir.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Project in development. **Do not use** (yet)\n\n# mikro - micro approach to traditional\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/yidemir/mikro.svg?style=flat-square)](https://packagist.org/packages/yidemir/mikro) [![Total Downloads](https://img.shields.io/packagist/dt/yidemir/mikro.svg?style=flat-square)](https://packagist.org/packages/yidemir/mikro) [![License](https://img.shields.io/packagist/l/yidemir/mikro)](https://packagist.org/packages/yidemir/mikro)\n\nThis project is a tool developed to solve some tasks and requests with simple methods, rather than a framework.\n\nI tried to take this project, which I started as a hobby, one step further. There have been fundamental changes compared to the previous version.\n\nAvailable packages:\n* **Cache** - It is a simple caching structure.\n* **Config**  - It is a simple config structure with setter and getter.\n* **Console** - Executes a callback according to the parameter from the command line.\n* **Container** - A simple service container.\n* **Crypt** - It encrypts and decrypts strings with OpenSSL.\n* **DB** - It simplifies your CRUD operations with a PDO instance.\n* **Event** - A simple event listener and emitter.\n* **Helper** - String and array helpers and more\n* **Jwt** - A simple JSON web token authentication structure.\n* **Locale** - Multi-language/localization structure\n* **Logger** - Basic logging\n* **Request** - An easy way to access PHP global request variables.\n* **Response** - Sends data/response to the client.\n* **Router** - An ultra-simple router with grouping and middleware support.\n* **Validator** - A simple data validation library.\n* **View** - A view renderer with block and template support.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require yidemir/mikro\n```\n\n## Usage\n\n**Routing**\n``` php\nRouter\\get('/', fn() =\u003e Response\\view('home'));\n```\n\n```php\nRouter\\group('/admin', fn() =\u003e [\n    Router\\get('/', 'DashboardController::index'),\n    Router\\resource('/posts', PostController::class),\n    Router\\get('/service/status', fn() =\u003e Response\\json(['status' =\u003e true], 200)\n], ['AdminMiddleware::handle']);\n\nRouter\\files('/', __DIR__ . '/sync-directory');\n```\n\n```php\nRouter\\error(fn() =\u003e Response\\html('Default 404 error', 404));\n```\n\n**Database**\n```php\n$products = DB\\query('select * from products order by id desc')-\u003efetchAll();\n$product = DB\\query('select * from products where id=?', [$id])-\u003efetch();\n\nDB\\insert('products', ['name' =\u003e $name, 'description' =\u003e $description]);\n$id = DB\\last_insert_id();\n\nDB\\update('products', ['name' =\u003e $newName], 'where id=?', [$id]);\nDB\\delete('products', 'where id=?', [$id]);\n```\n\n**View and Templates**\n```html\n@View\\set('title', 'Page title!');\n\n@View\\start('content');\n    \u003cp\u003eSecure print: @=$message; or unsecure print @echo $message;\u003c/p\u003e\n@View\\stop();\n\n@View\\start('scripts');\n    \u003cscript src=\"app.js\"\u003e\u003c/script\u003e\n@View\\push();\n\n@echo View\\render('layout');\n```\n\n```html\n\u003c!-- layout.php --\u003e\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n    \u003ctitle\u003e@View\\get('title', 'Hey!');\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    @View\\get('content');\n\n    @View\\get('scripts');\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nAll methods and constants are documented at the source. The general documentation will be published soon.\n\n### Testing\n\n```bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email demiriy@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Yılmaz Demir](https://github.com/yidemir)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyidemir%2Fmikro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyidemir%2Fmikro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyidemir%2Fmikro/lists"}