Structure of Chamilo 1.10: a new awakening

22
LMS 1.10

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

Page 1: Structure of Chamilo 1.10: a new awakening

LMS 1.10

Page 2: Structure of Chamilo 1.10: a new awakening

Julio Montoya

@jmontoyaChamilo LMS Lead developer

Page 3: Structure of Chamilo 1.10: a new awakening

Under the hood

LMS

Page 4: Structure of Chamilo 1.10: a new awakening

github

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

Page 5: Structure of Chamilo 1.10: a new awakening

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 ….

Page 6: Structure of Chamilo 1.10: a new awakening
Page 7: Structure of Chamilo 1.10: a new awakening

PHP-FIG

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

– PSR-0 (Autoloading standard)

– PSR-1 (Basic coding standard)

– PSR-2 (Coding style guide)

Page 8: Structure of Chamilo 1.10: a new awakening

Dependency Manager

Page 9: Structure of Chamilo 1.10: a new awakening

composer.json

Page 10: Structure of Chamilo 1.10: a new awakening

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

profit

Page 11: Structure of Chamilo 1.10: a new awakening
Page 12: Structure of Chamilo 1.10: a new awakening
Page 13: Structure of Chamilo 1.10: a new awakening

Silex

http://silex.sensiolabs.org

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

Page 14: Structure of Chamilo 1.10: a new awakening

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();

Page 15: Structure of Chamilo 1.10: a new awakening

In a Nutshell

Doctrine2

SilexTwig

Session

Security ...

Page 16: Structure of Chamilo 1.10: a new awakening

Silex

● MVC pattern

– Doctrine2 (Database entities)

– Twig (Templates)

– Controllers (inspired by Symfony2)

Page 17: Structure of Chamilo 1.10: a new awakening

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

Page 18: Structure of Chamilo 1.10: a new awakening

New components

● Silex– Doctrine2

– Twig

– Translation

– Session

– Security

– Chash

Page 19: Structure of Chamilo 1.10: a new awakening

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

Page 20: Structure of Chamilo 1.10: a new awakening

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)

Page 21: Structure of Chamilo 1.10: a new awakening

Database

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

Page 22: Structure of Chamilo 1.10: a new awakening

Chamilo 1.10

● Demo platform:

● http://unstable.chamilo.org/