Shareed2k / skeleton

Bluz skeleton application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bluz, a lightweight PHP Framework

Easy to setup, easy to use. Example application

Achievements

Build Status Latest Stable Version Total Downloads

Installation

Bluz works with PHP 5.4 or later and MySQL 5.4 or later (please check requirements)

From composer

Download composer.phar, it's easy:

curl -s https://getcomposer.org/installer | php

Run create-project command (replace %path% ;):

php composer.phar create-project bluzphp/skeleton %path% --stability=dev

From repository

Get Bluz skeleton source files from GitHub repository:

git clone git://github.com/bluzphp/skeleton.git %path%

Download composer.phar to the project folder:

cd %path%
curl -s https://getcomposer.org/installer | php

Install composer dependencies with the following command:

php composer.phar install

Last step

Restore database structure from structure.ddl file (use InnoDB as the Default MySQL Storage Engine for avoid "Error Code: 1071"!). Restore default database data from dump.sql

Edit your own configuration file /path/to/application/configs/app.dev.php (configuration for development environment)

Run internal PHP web-server with simple console tool:

/path/to/bin/server.sh -e dev

Or create symlink to Apache document root (required FollowSymlinks option):

ln -s /path/to/public /var/www/htdocs

Usage

Controller:

<?php
return
/**
 * @privilege View-User-Profile
 * @cache 5 minutes
 * @param integer $id
 * @return \closure
 */
function($id) use ($view) {
    /**
     * @var Application $this
     * @var View $view
     */
     $view->user = Users\Table::findRow($id);
};

View:

<h2><?=$user->login?></h2>

Model:

<?php
namespace Application\Users;
class Table extends \Bluz\Db\Table
{
    protected $table = 'users';
    protected $primary = array('id');
}
<?php
namespace Application\Users;
/**
 * @property integer $id
 * @property string $login
 */
class Row extends \Bluz\Db\Row {

}

Documentation

License

Read MIT LICENSE file

Vendors

About

Bluz skeleton application

License:MIT License