The best way to start a project is to base it on a already available project distribution. There are distributions for general web projects or for projects that require an micro-framework style approach. Distributions come with a predefined app file structure, some boilerplate code and the bundled core library.
We'll base our new project off the officially supported standard distribution.
For the start we'll use composer to create our project in
the current directory as
composer create-project --prefer-dist unionofrad/framework project
For the purposes of this guide, we'll be using PHP's builtin development webserver. This is good for development but should of course not be used in production. Instructions on how to use other webservers in production can be found on the Web-Servers page.
The framework will need write access to the
app/resources/tmp as it used to store cached versions of
already compiled templates or logs. The webserver user must be able to write to this directory.
Make sure you are in the root of the project. Now start PHP's builtin webserver using the following command. Your project is then being served at 127.0.0.1 on port 8080.
php -S 127.0.0.1:8080 -t app/webroot index.php
Finally, pull up the project in your browser and visit
At this point, you should be presented with the default home page. You're up and running!
The methods described in the previous sections will download the most recent tagged version of the framework and core library. In some cases, it may be desirable to update both to the very latest available revision, which may not have been tagged yet.
composer create-project -s dev unionofrad/framework project cd project git checkout 1.0 cd libraries/lithium git checkout 1.0