Skip to content

Celarius/spin-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Skeleton application example

Spin framework application example.

1.1. Installation

To use the skeleton, simply clone the repository, run a composer update and you are ready to start making your own project.

Cloning the repository (and init a new git repo for it):

> git clone https://github.com/Celarius/spin-skeleton.git
> cd spin-skeleton
> rmdir .git
> git init
> composer update -o --no-dev

1.2. Packages / Components

Uses the following implementations and Factories:

2. Technical details

3. Installation

3.1. Apache VHost config

In order to run the skeleton an Apache VHost needs to be configured:

<VirtualHost *:80>

  ServerName {alias.domain.com}
  ServerAdmin webmaster@{alias.domain.com}

  DocumentRoot "{path_to_web_apps}\spin-skeleton\src\public"

  ErrorLog "logs/spin.skeleton-error.log"
  CustomLog "logs/spin.skeleton-access.log" common

  SetEnv ENVIRONMENT DEV

  <Directory "{path_to_web_apps}\spin-skeleton\src\public">
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    Options -Indexes +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  
    # Load files in this order on "/"
    DirectoryIndex bootstrap.php index.php index.html

    # Disable appending a "/" and 301 redirection when a directory
    # matches the requested URL
    DirectorySlash Off

    # Set Rewrite Engine ON to direct all requests to
    # the `bootstrap.php` file
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ bootstrap.php [QSA,L]
  </Directory>
</VirtualHost>

3.2. Apache .htaccess file

SetEnv ENVIRONMENT DEV

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

DirectoryIndex bootstrap.php index.php index.html

Options -Indexes +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted

DirectorySlash Off

# Rewrite Engine to direct all requests to Spin bootstrap.php file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ bootstrap.php [QSA,L]

4. Folder structure

/<AppName>
  /src
    /app
      /Config
      /Middlewares
      /Controllers
      /Views
        /Templates
        /Errors
        /Pages
      /Models
      globals.php
    /public
    /storage
      /logs
      /cache
    /vendor
      /celarius/spin-framework
    composer.json
  /tests

About

Spin framework skeleton/template application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published