Sonic Framework is a blazing fast PHP 5 MVC framework.
1.1 beta
PHP 5.3+
MySQL 5, Memcached
Memcache, APC, PDO
wget http://sonicframework.com/sonic.tar.gz
mkdir sonic && tar xzvf sonic.tar.gz -C sonic && cd sonic
./install /path/to/install/to AppName
Follow instructions in /path/to/install/to/SETUP
file
Download latest source from: [http://www.sonicframework.com/sonic.tar.gz]
Create a directory somewhere where you want the application to live
Within that directory add the sonic library from step 1 and some other directories and files that the app will need.
You want your application structure to look like this:
[] = directory
• = file
[] application_name
[] configs
• app.ini
• routes.php
[] controllers
• main.php
[] libs
[] Sonic (downloaded in step 1)
[] MyApp
[] public_html
• .htaccess
[] assets
[] css
[] img
[] js
• index.php
[] views
[] main
• index.phtml
• error.phtml
In /public_html/.htaccess
add the following:
SetEnv ENVIRONMENT development
RewriteEngine On
RewriteRule ^.htaccess$ - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule \.*$ /index.php
In /public_html/index.php
add the following:
<?php
// make sure to set the timezone if it is not already set in your php.ini
// date_default_timezone_set('UTC');
$base_path = str_replace(DIRECTORY_SEPARATOR . 'public_html', '', __DIR__);
require $base_path . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR . 'Sonic' . DIRECTORY_SEPARATOR . 'Core.php';
$app = Sonic\App::getInstance();
$app->setBasePath($base_path);
// if you would like to use an app delegate uncomment this line
// $app->setDelegate('{MyApp}\App\Delegate');
$app->start();
Setup an apache vhost to point to your /public_html directory with DirectoryIndex set to index.php and add the server name to your /etc/hosts.
That's all there is to it, but your app won't work until you add some controllers and views. For more tutorials visit: http://www.sonicframework.com/tutorials