Skip to content
This repository

fast, lightweight PHP 5.3 MVC framework

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 js
Octocat-spinner-32 lib
Octocat-spinner-32 tests
Octocat-spinner-32 util
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 install
README.md

About

Sonic Framework is a blazing fast PHP 5 MVC framework.

Version

1.1 beta

System Requirements

PHP 5.3+

Recommended Server Requirements

MySQL 5, Memcached

Recommended PHP Extensions

Memcache, APC, PDO

Simple Installation

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

Advanced Installation

  1. Download latest source from: [http://www.sonicframework.com/sonic.tar.gz]
  2. Create a directory somewhere where you want the application to live
  3. 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
    
  4. 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
    
  5. 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();
    
  6. 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.
  7. 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
Something went wrong with that request. Please try again.