hos/hos-framework

Framework for Fast Developpement for PHP

dev-master 2016-10-23 14:02 UTC

This package is not auto-updated.

Last update: 2024-05-11 17:18:00 UTC


README

Backend

Installation

    apt-get install php7.0-curl php.0-pgsql php7.0-gd php7.0-dev postgresql-9.3 php-pear libyaml-dev yui-compressor ruby2.0-dev

    pecl install yaml-beta
    
    gem install compass

    echo "extension=yaml.so;" >> /etc/php/7.0/cli/php.ini
    echo "extension=yaml.so;" >> /etc/php/7.0/apache2/php.ini

    composer create-project daehl/hos-project

Create BDD

Update schema.xml in app/conf with this Documentation

and

    composer build-bdd
    
    vendor/bin/propel model:build --schema-dir 'app/conf/' --output-dir 'src/' --config-dir 'app/tmp/'
    

Twig

To Be compatible with AngularJS use Bracket variable like this:

    angular.module('app', [])
      .config(['$interpolateProvider', function ($interpolateProvider) {
        $interpolateProvider.startSymbol('[[');
        $interpolateProvider.endSymbol(']]');
      }]);
  

Image API

In Twig use filter 'image'

    <!-- To Have an Image width 300px of width -->
    <img src="<% 'image/sample.png' | image({w: 300})/>
    

Or directly with url 'image/logo.png?w=300' to get Image with width of 300px and respect Aspect/Ratio

More

Improve Performance

Set app/tmp & app/log to memory (tmpfs)

    mount -t tmpfs -o size=1024 tmpfs app/log
    mount -t tmpfs -o size=1024 tmpfs app/tmp