vitexsoftware/ease-framework

An PHP Framework for Ease of writing Applications

1.3 2017-08-24 15:39 UTC

README

EasePHP Framework Logo

EasePHP Framework

Object oriented PHP Framework for easy&fast writing small/middle sized apps.

Source Code Latest Version Software License Build Status Total Downloads Docker pulls Downloads Latest stable

SensioLabsInsight

Installation

To get Docker image:

docker pull vitexsoftware/easephpframework

For Debian, Ubuntu & friends please use repo:

wget -O - http://v.s.cz/info@vitexsoftware.cz.gpg.key|sudo apt-key add -
echo deb http://v.s.cz/ stable main > /etc/apt/sources.list.d/ease.list
aptitude update
aptitude install ease-framework

In this case please add this to your app composer.json:

"require": {
    "ease-framework": "*"
},
"repositories": [
    {
        "type": "path",
        "url": "/usr/share/php/Ease",
        "options": {
            "symlink": true
        }
    }
]

Docker:

pull vitexus/ease-framework

Composer:

composer require vitexsoftware/ease-framework

Framework Constants

  • EASE_APPNAME - common name of application. Mainly used in logs.
  • EASE_LOGGER - one of memory,console,file,syslog,mail or combination "console|syslog"
  • EASE_EMAILTO - recipient for Ease/Logger/ToMail
  • EASE_SMTP - Custom SMTP Settings (JSON Encoded)
  • DB_TYPE - pgsql|mysql|sqlite|...
  • DB_HOST - localhost is default
  • DB_PORT - database port
  • DB_DATABASE - database schema name
  • DB_USERNAME - database user login name
  • DB_PASSWORD - database user password
  • DB_SETUP - database setup command (executed directly after connect)

Example

Twitter Bootstrap page with simple Form

$oPage = new \Ease\TWB\WebPage('Page title');
$form = $oPage->addItem( new \Ease\TWB\Form('ExampleForm') );
$form->addItem(new \Ease\Html\InputTextTag('Name'));
$form->addItem(new \Ease\TWB\SubmitButton('OK', 'success') );
$oPage->draw();

Testing

At first you need initialise create sql user & database with login and password from testing/phinx.yml and initialise testing database by phinx migrate command:

composer update
cd tests
mysqladmin -u root -p create easetest
mysql -u root -p -e "GRANT ALL PRIVILEGES ON easetest.* TO easetest@localhost IDENTIFIED BY 'easetest'"
sudo -u postgres bash -c "psql -c \"CREATE USER easetest WITH PASSWORD 'easetest';\""
sudo -u postgres bash -c "psql -c \"create database easetest with owner easetest encoding='utf8' template template0;\""
../vendor/bin/phinx migrate -e development 
../vendor/bin/phinx migrate -e testing  

Building

Simply run debian/deb-package.sh

For Docker:

docker build -t vitexus/ease-framework .
docker push vitexus/ease-framework

Links

Homepage: https://www.vitexsoftware.cz/ease.php

GitHub: https://github.com/VitexSoftware/EaseFramework

Apigen Docs: https://www.vitexsoftware.cz/ease-framework/