microframe / app
A simplistic micro framework with a little touch of MVC without the necessity of models
Requires
- php: >=7.3
- ext-curl: *
- ext-fileinfo: *
- ext-json: *
- ext-pdo: *
- ext-sqlite3: *
- asyncphp/doorman: 3.1.*
- cebe/markdown: 1.2.*
- hassankhan/config: 2.1.*
- phpfastcache/phpfastcache: 8.0.*
- predis/predis: 1.1.*
- symfony/finder: 5.1.*
- symfony/process: 5.1.*
- symfony/serializer: 3.4.*
- symfony/yaml: 5.1.*
- taq/pdooci: 1.0.*
- zircote/swagger-php: 3.0.*
Requires (Dev)
- filp/whoops: 2.7.*
- friendsofphp/php-cs-fixer: 2.16.*
- opsway/psr12-strict-coding-standard: 0.4.*
- phpunit/phpunit: 7.5.*
- squizlabs/php_codesniffer: 3.5.*
Suggests
- ext-apache: *
- ext-ftp: Required to use the Flysystem FTP driver.
- ext-gd: Required to use for...
- ext-memcached: Required to use the memcache cache driver.
- ext-pcntl: Required to use all features of the queue worker.
- ext-posix: Required to use all features of the queue worker.
- ext-redis: Required to use the Redis cache and queue drivers (^4.0|^5.0).
- mockery/mockery: Required to use mocking (^1.3.1).
This package is auto-updated.
Last update: 2025-03-24 22:28:25 UTC
README
composer create-project microframe/app testApp --no-dev
Simple controller usage
NOTE: For micro service header accept must be set before response can be received.
<?php use MicroFrame\Core\Controller as Core; class TestController extends Core { public function index() { $this->response ->data("Keeping it short...") ->send(); } }
The longer story
<?php use MicroFrame\Core\Controller as Core; class TestController extends Core { public function index() { $this->auto(false); $this->response // Optional set method ->methods(['get', 'post']) // It's optional but why, I don't remember. ->data(['villains' => ['Black Beard', 'Douglass Bullet', 'D Rocks', 'Im Sama']]) // Set optional formats application/json | application/xml no etc for now. ->format("application/xml") // Hmm, yeah optional middleware, nothing magical I guess if they all return true. ->middleware(['default', 'companyA.easyAuth', 'customApp.validation']) // Set session stuffs for only this response ->session("key", "value") // Optional redirection ->redirect("index") // Optional time response refresh in seconds. ->refresh(60, "index") // Optional status stuff ->status(200) // Required. ->send(); } }
Why Bother with MicroFrame
Yeah i know it's not a very creative name and does suck, hmm not a very good joke of how the joke goes since it needs explanation to cut it short simplistic micro plain framework with a little touch of q[M]VC.
I case you feel there's any deficiency, or an enhancement required in the code please message me also teach me anything.
In case you still not getting the q[M]VC it's query and parameters in a fancy file/class, but I bet you'll not hate it too much, and it works, and the other i guess are somewhat normal stuff maybe except the Task, Routing and any other stuff you do notice, hopefully they're working while you use it.
NOTE: I can never dream for now this can replace your laravel, fuelPhp or codeIgniter4 as i love those PHP framework especially codeIgniter4 but MicroFrame exist to for a different purpose.
- First make me less bored
- Secondly I get to write my name on stuff, try it "FEELS GOOD".
- Serious reason -> Do lot stuff super quick, except models [not everyone use models, i know lot of old systems] again with the need reiterate, simple task, simple async, caching, openAPI V3 tags auto rendering, auto code documentation based on tags, custom/external code routing, etc.