A Sample Tutorial Package

A sample application (still a WIP) to show a real world demo for the aura framework with Propel2.

Things can be done in an improved/advanced way and if you find something wrong create an issue or consider giving a Pull Request.

The application is a blog tutorial. Hope this will help you to start with aura. Feel free to use your own orm or Aura.Sql and build your own models.

Installation

via zip

Download the zip, unzip Hari.Sample and place it in the package folder.

via git

Move to package folder and clone the repo

1
git clone https://github.com/harikt/Hari.Sample.git

via composer

If you have not yet played with aura framework. Download the composer.phar file. I assume the composer.phar is globally available in the name composer. Else use the path to the composer.phar according to yours.

1
composer create-project --stability=dev aura/system sampleproject

This will create a folder named sampleproject cloning the https://github.com/auraphp/system repo and downloading the rest of the packages.

Move to the folder by

1
cd sampleproject

Now let us install the hari/sample via composer.

1
"hari/sample": "dev-master"

So your composer.json will look like

1
2
3
4
5
6
7
8
9
{
    "minimum-stability": "dev",
    "require": {
        "aura/installer-system" : "1.0.0",
        "aura/framework"        : "dev-develop",
        "aura/demo"             : "dev-develop",
        "hari/sample"           : "dev-master"
    }
}

Let us run composer update and install the hari/sample package and its dependencies.

1
composer update

This will install hari/sample and also the dependency propelorm version 2.

Building configuration

Edit the runtime-conf.xml file located at config folder. Change the database, username and password according to yours.

1
vendor/bin/propel config:convert-xml --output-dir=package/Hari.Sample/config --input-dir=package/Hari.Sample/config

Building sql

Edit the runtime-conf.xml file located at config folder. Change the database, username and password according to yours.

1
vendor/bin/propel sql:build --input-dir=package/Hari.Sample --output-dir=package/Hari.Sample/data

Propel model generation

The model is generated by propel from the schema located at package/Hari.Sample/schema.xml. The package already have the generated classes. If you want to re-generate the model classes after modifying the schema run the command.

1
vendor/bin/propel model:build --input-dir=package/Hari.Sample --output-dir=package/Hari.Sample/src

Enabling the Package

If you have installed hari/sample via composer then you can skip this step. Else you need to edit the config/_packages and add Hari.Sample to the end of file.

Any troubles create an issue or ask in auraphp at googlegroups.com

What is in it?

Blog tutorial.

Register a user

Register a user

Login to add posts

Login as the user

Add post

List all Posts

List all posts

Post has threaded comments.

Threaded comments

Known problems

The edit post doesn’t work.

Comments Thread, probably not the right way to do with Propel? Question here

and much more.

Credits and Thanks

Beau Simensen Paul M Jones

Aura Packages Composer Propel Symfony

to all the people who motivated me to bring this sample application.

auraphp, propel

Comments