42
Practical Joomla! for Developers Open Source Day, Udine, Italy, 28 november 2015 ALEXANDRU PRUTEANU @palexcom 1

Practical Joomla! for Developers

Embed Size (px)

Citation preview

Page 1: Practical Joomla! for Developers

Practical Joomla!for DevelopersOpen Source Day, Udine, Italy, 28 november 2015ALEXANDRU PRUTEANU @palexcom

1

Page 2: Practical Joomla! for Developers

Topics

1. Cos’è Joomla!2. Come viene sviluppato Joomla!3. Come creare un ambiente di sviluppo per Joomla!4. Come creare un Plugin5. Live (hope sh*t does not happen)6. Come pubblicare un estensione su Joomla! Extension Directory (JED)

2

Page 3: Practical Joomla! for Developers

Cos’è Joomla!

● Homepage joomla.org● Content Management System (CMS)● © 2005 - 2015 (Mambo fork)● GNU General Public License● Versione attuale 3.4.5● Chi usa Joomla? Citibank, eBay, Harvard University, Ikea, McDonald's and

Sony utilizzano Joomla● Più di 7.000+ estensioni (http://extensions.joomla.org/)

3

Page 4: Practical Joomla! for Developers

Utilizzo nel mondo

4

Page 5: Practical Joomla! for Developers

Core Features

● Multilingual○ more than 64 languages

● Easy Upgrades○ One Click Version Update

● Integrated Help System● Media Manager● Contact Management● Content Management (core system, WYSIWYG editor)

5

Page 6: Practical Joomla! for Developers

Core Features

● Nested categorization● Tagging● Frontend Editing● Content Versioning● Menu Manager● Powerful Extensibility● Extensive ACL

6

Page 7: Practical Joomla! for Developers

Core Features for Developers

● Design Uncoupled○ Model-View-Controller

● Responsive with Bootstrap● User Management

○ protocols: LDAP, OpenID, and even Gmail

● Cloud Storage APIs○ Amazon S3, Google Cloud Storage, Rackspace and Dropbox

● Web Services○ Facebook, Github, Twitter

7

Page 8: Practical Joomla! for Developers

Technical Requirements

8

Page 9: Practical Joomla! for Developers

Model-View-Controller

9

Page 10: Practical Joomla! for Developers

Architecture of Joomla!

10

Page 11: Practical Joomla! for Developers

Come viene sviluppato Joomla!

● Sviluppato da volontari a differenza di WordPress dove c’è un’azienda● PHP, CSS, JavaScript, HTML, SQL● Git / Github● Composer● PHPUnit (unit testing)● PHPCode_Sniffer● Travis CI● Jenkins● Phing

11

Page 12: Practical Joomla! for Developers

Git

● a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency

12

Page 13: Practical Joomla! for Developers

Github

● A Git service, code review, and code management● https://github.com/joomla/joomla-cms

13

Page 14: Practical Joomla! for Developers

Composer

● Dependency Manager for PHP● Da poco, Joomla Framework● Software per la gestione di dipendenze esterne

14

Page 15: Practical Joomla! for Developers

PHPCode_Sniffer !!!!!!!!!!!!!!!!!!!!!!!!! USE IT !!!!!!!!!!!!!!!!!!!!!!!!!

● Free and open source distributed version control system○ an essential development tool that ensures your code remains clean and consistentcheck

and automatically correct coding standard violations○ https://github.com/squizlabs/PHP_CodeSniffer

● Guida installazione○ https://docs.joomla.org/Joomla_CodeSniffer

● Joomla! Coding Standards○ https://github.com/joomla/coding-standards

15

Page 16: Practical Joomla! for Developers

PHPCode_Sniffer IDE example

16

Page 17: Practical Joomla! for Developers

Phing

● PHP project build system or build tool based on Apache Ant

17

Page 18: Practical Joomla! for Developers

Travis CI

● Easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes

18

Page 19: Practical Joomla! for Developers

Travis CI example

● Easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes

19

Page 20: Practical Joomla! for Developers

Travis CI example

20

Page 21: Practical Joomla! for Developers

Jenkins

● An extensible open source continuous integration server● https://jenkins-ci.org/

21

Page 22: Practical Joomla! for Developers

Jenkins example

22

Page 23: Practical Joomla! for Developers

Jenkins example

23

Page 24: Practical Joomla! for Developers

Joomla Framework™

● https://framework.joomla.org

● The Joomla! Framework™ is a new PHP framework (a collection of software libraries/packages) for writing web and command line applications in PHP

● parts of the Framework integrated into the CMS (e.g. the Dependency Injection package, added in Joomla! 3.2

24

Page 25: Practical Joomla! for Developers

Semantic Versioning

● http://semver.org/● example Joomla! version 3.4.5

25

Page 26: Practical Joomla! for Developers

Come creare un ambiente di sviluppo per Joomla!

● Project Fork● Vagrant, Docker, XAMPP …● PHPStorm, Eclipse● Joomla Configurations for Development● XDebug

26

Page 27: Practical Joomla! for Developers

Project Fork

● Fork project○ > git clone https://github.com/joomla/joomla-cms.git

● Composer dependencies install○ > composer install

● Create a project directory○ > mkdir MyProjectDirectory (e.g. OpenSourceDay2015)

27

Page 28: Practical Joomla! for Developers

Vagrant

● Vagrant box per Joomla!○ https://github.com/joomlatools/joomla-vagrant

● Configure Vagrant○ > cd ./joomla-cms○ > vagrant init○ > vagrant up 28

Page 29: Practical Joomla! for Developers

Vagrant (LAMP stack)

29

Page 30: Practical Joomla! for Developers

IDE

● PHPStorm (free for Students)● Eclipse● Install and configure PHPCode_Sniffer● Inlcude Joomla! core libraries

○ ./includes○ ./administrator/includes○ ./libraries

30

Page 31: Practical Joomla! for Developers

Joomla Configurations for Development

● Go to admin panel○ http://joomla.dev/administrator

● Menu > System > Global Configuration > System > Debug Settings○ turn on: Debug System○ turn on: Debug Language

● Menu > System > Global Configuration > Site > SEO Settings○ turn off: Search Engine Friendly URLs

31

Page 32: Practical Joomla! for Developers

Joomla Configurations for Development

32

Page 33: Practical Joomla! for Developers

Joomla Configurations for Development

33

Page 34: Practical Joomla! for Developers

Joomla Configurations for Development

34

Page 35: Practical Joomla! for Developers

Joomla Configurations for Development

35

Page 36: Practical Joomla! for Developers

Come creare un Plugin

● Observer Pattern● è un Event listener● https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla● https://docs.joomla.org/Plugin/Events

36

Page 37: Practical Joomla! for Developers

Come creare un Plugin

● Manifest File for Joomla Installer○ osd.xml

● Languages files○ en-GB.plg_content_osd.ini

● Main file extends JPlugin○ osd.php

● Licence○ LICENCE

37

Page 38: Practical Joomla! for Developers

Come creare un Plugin (manifest file)

38

Page 39: Practical Joomla! for Developers

Come creare un Plugin (main file)

39

Page 40: Practical Joomla! for Developers

Consigli per iniziare lo sviluppo di Template, Componenti

● Look & Copy existing code (Templates, Components, Plugins, Modules)● Component Creator

○ https://www.component-creator.com/en/

● Debug

40

Page 41: Practical Joomla! for Developers

Come pubblicare un estensione su Joomla! Extension Directory (JED)

● Documentation: https://docs.joomla.org/Publishing_to_JED● http://extensions.joomla.org/● Register and Publish● Unique Name● Free and Commercial extensions

● only Joomla! extensions licensed under the GNU GPL will be accepted into the JED

41

Page 42: Practical Joomla! for Developers

Thanks. Q/A? :)ALEXANDRU PRUTEANU @palexcom

42