Skip to content

charleshross/soarin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 

Repository files navigation

Soarin PHP Framework

PHP as fast as possible.

Introduction

This software is a super lightweight RESTful framework for your future PHP code base. Every attempt has been made to make it as fast as possible. For best performance it's recommended that you install the latest PHP with opcache enabled as documented below.

Installation

  1. Server Environment
  1. Databases
  1. Web Software
  1. Web Extras
  1. Soarin Setup

PHP Framework Dependencies

Required:

Optional (gives full features):

NGINXG Server Clause Setup

Use a server clause similar to this one, replace with your server information.

server {

	listen <ip address:port number>;
	server_name <ip:port or domain name>;
	
	root <path to soarin folder>/public;

	rewrite ^([^.]*[^/])$ $1/ permanent;
    
	# remove when in 'production'
	location ~ \.(jpg|jpeg|png|apng|gif|swf|ico|txt|html|htm|js|css|less|eot|svg|ttf|woff)$ {
		root /;
		try_files <path to soarin folder>/php/app/$uri <path to soarin folder>/public/$uri 404.php;
	}
	
	location / {
		index index.php;
			if (!-f $request_filename) {
				rewrite ^(.*)$ /index.php last;
			}
	}

	location ~ \.php$ {

		include /opt/nginx/conf/fastcgi.conf;
		fastcgi_index index.php;
		if (-f $request_filename) {
			fastcgi_pass 127.0.0.1:9000;
		}
	}
	
	location ~ \.flv$ {
		flv;
	}
	
	location ~ \.mp4$ {
		mp4;
	}

}

NGINX Compile Configuration

The NGINX web server used for this project was configured with these options

./configure \
--prefix=/opt/nginx \
--with-pcre \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_realip_module \
--with-http_mp4_module \
--with-mail

Required Debian packages: gcc libpcre3 libpcre3-dev zlib1g zlib1g-dev openssl libssl-dev

PHP Compile Configuration

PHP was compiled for this project using these configuration options

./configure \
--prefix=/opt/php \
--with-mysql=shared,/opt/mysql/server-5.6 \
--with-pgsql=/var/lib/postgresql/9.3/main \
--with-jpeg-dir \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-mysqli \
--with-curl \
--enable-exif \
--with-gd \
--enable-mbstring \
--enable-pdo \
--enable-sockets \
--enable-fpm \
--with-pear \
--with-pspell=/usr \
--enable-opcache

Required Debian packages: libxml2-dev libcurl4-gnutls-dev libpng12-0 libpng12-dev libjpeg62 libjpeg62-dev libpq-dev aspell libaspell15 libaspell-dev libpspell-dev

Note: to enable opcache you must add "zend_extension=opcache.so" to your PHP.INI file

Grunt Setup (needed for full features)

Grunt is included with scripts to auto-compile/minify your project's /php/styles/ files (css/less/javascript/js libraries)

  1. Install node
  2. Install Grunt global npm package by running command npm install -g grunt-cli
  3. Move into framework's Grunt folder <framework path>/php/grunt/
  4. Install the Grunt dependencies, run command npm install
  5. Run Soarin Grunt script by typing grunt

Framework folder structure

Directory structure of Soarin

Path							   Description									  Constant
----							   -----------									  --------
.
├──  php                           parent folder for internal files
│   │   
│   ├──  app                       your application folder                        APP
│   │   │   
│   │   ├──  controllers           Controllers folder                             CONTROLLERS
│   │   │   
│   │   ├──  models                Models folder                                  MODELS
│   │   │   
│   │   ├──  routes                application config folder
│   │   │   │   
│   │   │   ├──  errors.php        Error code handling file
│   │   │   └──  routes.php        Router configuration file
│   │   │   
│   │   ├──  styles                Frontend styles folder                         STYLES
│   │   │   │
│   │   │   ├──  images            static file folder
│   │   │   ├──  js                JS file folder
│   │   │   ├──  less              LESS(CSS) file folder
│   │   │   ├──  libraries         JS Libraries folder
│   │   │   └──  autoload.json     library autoload config file
│   │   │   
│   │   └──  views                 Views folder                                   VIEWS
│   │   
│   ├──  grunt                     grunt script folder (code optimizer)
│   │   
│   ├──  logs                      log files folder
│   │   
│   └──  php-libraries             php libraries folder                           LIBRARIES
│       │  
│       └──  soarin                the soarin framework folder (internals)        SOARIN
│           │  
│           └──  config.php        Soarin config variables file
│   
└──  public                        parent folder for public web files
    │  
    ├──  404.html                  404 file
    └──  index.php                 entry point file

About

Soarin PHP Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published