paooolino / machine
This package is abandoned and no longer maintained.
The author suggests using the paooolino/webengine package instead.
dev-master
2020-10-21 07:40 UTC
Requires
- cocur/slugify: ^2.5
- gabordemooij/redbean: ^4.3
- intervention/image: ^2.4
- nikic/fast-route: ^1.2
- ramsey/uuid: ^3.6
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2020-10-21 07:40:51 UTC
README
# Installing composer require paooolino/webengine:dev-master # Usage ## index.php require("vendor/autoload.php"); $engine = new \WebEngine\WebEngine(); $engine->addPage("/", function() { return [ "template" => "page.php", "data" => [ "content" => "Hello, world!" ] ]; }); $engine->run(); ## templates/default/page.php <h1>{{content}}</h1> # Serving php -S locahost:8000 # For developers **composer start** starts the php built-in server for localhost:8000 pointing to the example/ directory **composer phpunit** launch tests for the main WebEngine class and generate code coverage in coverage/engine **composer phpunit_plugins** launch tests for plugins and generate code coverage in coverage/plugins **composer generatedoc** generate docs in the doc/ directory **composer phpcbf** auto-correct source code to match pear standards **compose phpcs** check for errors in code standars