Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
fast, lightweight PHP 5.3 MVC framework
branch: master

This branch is 11 commits behind ccampbell:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
js
lib/Sonic
tests
util
LICENSE
README
install

README

Copyright 2011 Craig Campbell

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

All of these are highly recommended.  Without them you will not be able to use
Sonic to its full potential.

SIMPLE INSTALLATION
1.  wget http://sonicframework.com/sonic.tar.gz
2.  mkdir sonic && tar xzvf sonic.tar.gz -C sonic && cd sonic
3.  ./install /path/to/install/to AppName
4.  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

    [] totally_awesome_application
           [] 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 your /public_html/.htaccess file 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 your /public_html/index.php file add the following:

    <?php
    set_include_path(str_replace('/public_html', '/libs', $_SERVER['DOCUMENT_ROOT']));
    include 'Sonic/Core.php';
    use \Sonic\App;
    $app = App::getInstance();

    // 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.