PST (Propel ORM - Slim Framework - Twig Template Engine) Stack in PHP is the most sophisticated stack to quickly build any kind of PHP application. This open source technology stack will let you create your application within a maximum of 120 seconds (2 minutes) without any hassle.
This stack was first created to quickly build any prototype or any quick but powerful web application within hours or a day and after that I made it open source to make your work more easy.
It includes user authentication/registration and some useful middleware (authenticated-/guest-only routes, CSRF, validation, saving old form input across requests).
If you haven't installed Composer yet, do that now.
Under *nix I prefer to install Composer globally in /usr/local/bin
, but you may also install Composer locally in your current working directory.
Under Windows I prefer the Installer for global installation.
After you have installed Composer, run these commands from the directory in which you want to install your new Propel-Slim-Twig Application stack.
-
Clone this repository (replace
[your-app-name]
with the desired directory name for your new application):$ git clone https://github.com/koelle25/pst-stack [your-app-name] $ cd [your-app-name] $ composer install
-
Point your virtual host document root to your new application's
public/
directory -
Create a database, e.g. by using phpMyAdmin or on the command line. When using mysql you can do (replace
[your-database-name]
with the desired database name for your new application):$ mysql -u root -p create [your-database-name]
-
Configure Propel and generate it's ORM classes:
- Copy/paste
config/settings.sample
=>config/settings.php
- Copy/paste
propel/propel.sample
=>propel/propel.xml
- Replace
DatabaseUsername
,DatabasePassword
,DatabaseName
inpropel/propel.xml
- Edit
config/settings.php
according to your needs - Edit
propel/schema.xml
according to your needs
- Copy/paste
-
Now generate Propel ORM classed by issuing the following commands:
- Go into the propel directory in your project root (e.g. /var/www/[your-app-name]):
$ cd /var/www/[your-app-name]/propel
- Build sql, model and config and insert the schema into your database:
$ ../vendor/propel/propel/bin/propel sql:build $ ../vendor/propel/propel/bin/propel model:build $ ../vendor/propel/propel/bin/propel config:convert $ ../vendor/propel/propel/bin/propel sql:insert
- Go into the propel directory in your project root (e.g. /var/www/[your-app-name]):
-
*nix only: Make
tmp
writable:$ cd /var/www/[your-app-name] $ chmod -R 777 tmp/
That's it! Now go build something cool. Go to your browser and type your application host (according to your virtual host). You can signup and login into the application by yourself.
This stack is built upon following resources: