caffeina-core/base-application

Caffeina Core - Application Skeleton

Installs: 80

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 1

Open Issues: 0

Language:HTML

Type:application

1.0.6 2016-04-18 15:55 UTC

This package is auto-updated.

Last update: 2024-10-16 21:27:46 UTC


README

Web application vanilla template.

Installation

Deploy

Create a new copy of this project via composer

$ composer create-project caffeina-core/base-application ./my-awesome-new-app
$ cd my-awesome-new-app
$ composer dump-autoload -o

Done.

Docker

A complete PHP+NginX server is ready from

docker pull caffeina/core-app

Front Controller

Like all URL-routed web app, you need to pass every request to the front controller public/index.php.

NginX + PHP-FPM

Change PATH_TO_YOUR_APP_DIR to the absolute path of your project directory.

server {
        listen 80 default_server;

        root PATH_TO_YOUR_APP_DIR/public/;
        index index.php index.html index.htm;

        location / {
             try_files $uri /index.php$is_args$args;
        }

        # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
        location ~ \.php$ {
                try_files $uri /index.php =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

Apache2

Assert that the document root of the virtualhost is pointing to PATH_TO_YOUR_APP_DIR/public/

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>