Getting Started
Check the Requirements
In order to run Enbici you need to have a PHP version >= 5.2.14.
Just create a script called phpinfo.php in your server with the following line.
phpinfo();
You can check that your PHP version is >= 5.2.14 with the following command:
$ php -v
Installing Enbici
You can install Enbici in two different ways.
Git
$ git clone -b 0.2 git://github.com/saumotions/Enbici.git
Download the source code
Download version 0.2 and extract it, you can extract the package using the following command.
$ tar xzf saumotions-Enbici-d8b3462.tar.gz
Setting up
After downloading Enbici you will find a folder inside named EnbiciApp, inside of this folder are located all of the files needed in order to create an application. All of the files inside EnbiciApp should be where your server points to since it will start running from the index.php script located inside.
There may be a problem setting up the application in some shared hosting environments, so here is a way to fix it modifying the index.php script to look like this.
define('APPLICATION_PATH', '.'); //'.' instead of realpath(dirname(__FILE__)
require_once(APPLICATION_PATH . '/library/Enbici/Application.php');
$app = EnbiciApplication::getInstance();
$app->run();
If your application runs on a subfolder e.g. example.com/yourapp/ then there may be a problem with the parsing of the URL since it will take your app folder as the controller being requested. Just let the application know the url of your app.
//in config/configuration.json
{
"appurl": "http://enbici.saumotions.com/app"
}
Understanding the Enbici filesystem
The Enbici filesystem is ordered in a way that all of the controllers, models, views, are in separate folders so they are easier to find and modify.
The default controllers provided by Enbici are the IndexController and the ApplicationController
The ApplicationController can manage all of the application actions, as well as provide filters to certain actions in order to require valid user login credentials.
The IndexController provides the first entry point to the application since when a user requests a Website without any parameters it is automatically routed to the IndexController and to the IndexAction inside of it.
The views are separated by Controller and action, if no view is provided for a controller then it will take the index view as the default view for the action. For example lets say a user requests goes to the Product controller and action is add, then the view would be add.tpl inside the Product folder if add.tpl doesn't exist then index.tpl will be the one to service the request.
There are no default models provided, and basically they can be any data structure provided or they can be Doctrine classes which provides the object relational mapping to the database.
blog comments powered by Disqus