Nginx local config for laravel

Config Nginx for server Ubuntu 14 + Nginx + PHP5-fpm:

server {
 listen 80;

 root /var/www/laravel.local/public;
 index index.php;

 server_name laravel.local;

 location / {
 try_files $uri $uri/ /index.php;
 }
 
 location ~ \.php$ {
 fastcgi_pass 127.0.0.1:9000;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 }

 error_log /var/log/nginx/laravel.local.error.log;
 access_log /var/log/nginx/laravel.local.access.log;
}

Pattern Registry PHP

Simple Registry class

class Registry
{
    private static $params;

    public static function setParams()
    {
        $params = [];

        if (isset($_COOKIE)) {
            foreach ($_COOKIE as $key => $value) {
                $params[$key] = $value;
            }
        }

        if (isset($_GET)) {
            $get = self::escapeParams($_GET);

            foreach ($get as $key => $value) {
                $params[$key] = $value;
            }
        }

        if (isset($_POST)) {
            $get = self::escapeParams($_POST);

            foreach ($get as $key => $value) {
                $params[$key] = $value;
            }
        }

        if (isset($_FILES)) {
            $get = self::escapeParams($_FILES);

            foreach ($get as $key => $value) {
                $params[$key] = $value;
            }
        }

        if (isset($_SERVER['HTTP_REFERER'])) {
            $params['HTTP_REFERER'] = $_SERVER['HTTP_REFERER'];
        }

        self::$params = $params;
    }

    public static function setParam($key, $value)
    {
        self::$params[$key] = $value;
    }

    public static function getParam($key, $value)
    {
        if (isset(self::$params[$key])) {
            return self::$params[$key];
        }

        return $value;
    }

    public static function escapeParams($get)
    {
        foreach ($get as $key => $value) {

            if (is_array($value)) {
                $get[$key] = self::escapeParams($value);
            } else {
                $get[$key] = mysql_escape_string($value);
            }
        }

        return $get;
    }

    public static function htmlSpecialCharsParams($get)
    {
        if (!isset($get) || !is_array($get)) return [];

        foreach ($get as $key => $value) {
            if (is_array($value)) {
                $get[$key] = self::htmlSpecialCharsParams($value);
            } else {
                $get[$key] = htmlspecialchars($value);
            }
        }

        return $get;
    }
}