SlimPower - ONE, (*1)
![Total Downloads][ico-downloads], (*2)
, (*3)
Slimpower Framework - lightweight version, (*4)
Installation
Create folder /var/www/slimpower and download this repository, (*5)
In terminal:, (*6)
mkdir /var/www/slimpower
cd /var/www/slimpower
composer require matiasnamendola/slimpower-one
Or you can add use this as your composer.json:, (*7)
{
"require": {
"slim/slim": "2.*",
"matiasnamendola/slimpower-one": "dev-master"
}
}
.htaccess
Here's an .htaccess sample for simple RESTful API's, (*8)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
or, (*9)
<ifModule mod_headers.c>
Header always set Access-Control-Allow-Headers "Authorization"
</ifModule>
Apache VirtualHost
Create conf file 'slimpower.conf' in folder '/etc/apache2/sites-available'
with this content:, (*10)
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName dev.slimpower.com
DocumentRoot /var/www/slimpower
ErrorLog /var/log/apache2/slimpower-custom-error.log
CustomLog /var/log/apache2/slimpower-custom.log common
#TransferLog /var/log/apache2/slimpower-custom.log
<Directory /var/www/slimpower/>
Options -Indexes
AllowOverride AuthConfig FileInfo
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/gif
</Directory>
<files "*.conf">
order allow,deny
deny from all
</files>
<files "*.ini">
order allow,deny
deny from all
</files>
<files "*.json">
order allow,deny
deny from all
</files>
<DirectoryMatch "^/.*/(\.git|CVS)/">
Order deny,allow
Deny from all
</DirectoryMatch>
</VirtualHost>
Next, copy this in terminal:, (*11)
sudo a2ensite 000-slimpower
sudo /etc/init.d/apache2 restart
or, (*12)
sudo a2ensite 000-slimpower
sudo service apache2 restart
Credits
License
The MIT License (MIT). Please see License File for more information., (*13)