First make sure you have Composer! Then install Bone.
composer create-project delboy1978uk/boneframework your/path/here
or if you haven't installed composer globally ...
php composer.phar create-project delboy1978uk/boneframework your/path/here
Bone comes with a docker-compose.yml in the project, so you can instantly get a dev server running if you use Docker (Tested using a default VirtualBox VM). Just add this to your hosts file
Then you can access the site at https://awesome.scot in your browser. Of course if you don't use docker you can add it to your LAMP stack in the usual way.
You can see a config, data, public, and src folder. Leave be vendor folder, that's where composer installs project dependencies.
Make the data folder writable. 777 gives everyone write access, so instead set it to 775 with yer Apache user in the group.
chmod -R 775 data
In your Apache virtual hosts, set the document root as the public folder
You can drop in any number of .php files into the config/ folder. Make sure they return an array with the config . You can override configuration based on environment var APPLICATION_ENV, so for instance if the environment was productionit would load the additional config the production subdirectory.
There are several config files by default:
In your config files, you can add anything you want. It gets stored in the Bone\Mvc\Registry.
Set your default db credentials in the main config/db.php, and any environment specific configs in a subdirectory
Bone supports translation into different locales. Translation files (gettext .po and .mo) should be placed in data/translations, under a subdirectory of the locale, eg data/translations/en_GB/en_GB.po. You can set the default locale and an array of supported locales.
To use the translator, you can simply call:To use the translator, you can simply call:
Bone uses monolog/monolog, and logs can be found in data/logs.Currently we only support writing to files, but you can add as many channels as you like:
To use the logger in a controller:
Bone uses Zend Mail. To configure the mail client, just drop in your config (see zend mail docs)
If you are using the Docker Box provided by bone, you also have the awesome MailHog at your disposal. Browse to awesome.scot:8025 and you'll see a catch all email inbox, so you never need to worry about development emails reaching the real world.
Routes follow a default pattern of /controller/action/param/value/nextparam/nextvalue/etc/etc
You can also override routes by defining them in the config array:
When defining routes, mandatory variables in the uri have a colon like :id
Optional uri vars have [ ] surrounding them like [:id]
Ignore this config. It's old deprecated nonsense.