Structure of Chamilo 1.10: a new awakening

Post on 11-Nov-2014

923 views 3 download

Tags:

description

Presentation made by Julio Montoya, Lead developer of Chamilo LMS in the Chamilo Users Day Madrid 2013.

Transcript of Structure of Chamilo 1.10: a new awakening

LMS 1.10

Julio Montoya

@jmontoyaChamilo LMS Lead developer

Under the hood

LMS

github

● https://github.com/chamilo/chamilo-lms

Problems

● No common PHP standards between libraries.● mysql_* functions deprecated in PHP 5.5● Lots of require_once.● Not a clear MVC pattern.● We need a real Database Layer.● No library dependency manager.● …● Legacy project ….

PHP-FIG

● Drupal, phpBB, PEAR, Symfony2, etc.● Standards

– PSR-0 (Autoloading standard)

– PSR-1 (Basic coding standard)

– PSR-2 (Coding style guide)

Dependency Manager

composer.json

● cd /var/www/chamilo-lms● composer install

profit

Silex

http://silex.sensiolabs.org

● PHP micro framework.● Based in Symfony2 components.● Very extensible.● Very modular.● Big responsibility.

Silex

● Define a controller and map to a route:

require_once __DIR__.'/../vendor/autoload.php';$app = new Silex\Application();

$app->get('/blog/{id}', function ($id) { return 'blog item'.$id;});

$app->get('/userportal', 'userPortal.controller:indexAction');

$app->get('/main/admin', function ($id) { return 'Legacy code here';});

$app->run();

In a Nutshell

Doctrine2

SilexTwig

Session

Security ...

Silex

● MVC pattern

– Doctrine2 (Database entities)

– Twig (Templates)

– Controllers (inspired by Symfony2)

New routes

● Old● http://campus.chamilo.org/user_portal.php

● New● http://campus.chamilo.org/web/userportal● http://campus.chamilo.org/web/julio/userportal● http://campus.chamilo.org/web/home/userportal

New components

● Silex– Doctrine2

– Twig

– Translation

– Session

– Security

– Chash

Chash

● Chamilo Shell = Chash● https://github.com/chamilo/chash

● php chash.php chamilo:install 1.9.6● php chash.php chamilo:update 1.10.0● php chash.php files:clean_temp_folders● etc

New directory structure

● chamilo– config (Chamilo settings)

● config/configuration.php

– data (Portal files)● data/courses● data/home● data/temp● data/upload

– vendor (Libraries)

– web (Public content)

Database

● Migrating MyISAM to InnoDB (in progress)● Doctrine migrations (1.11)

Chamilo 1.10

● Demo platform:

● http://unstable.chamilo.org/