Practical Joomla! for Developers
-
Upload
alexandru-pruteanu -
Category
Technology
-
view
207 -
download
3
Transcript of Practical Joomla! for Developers
Practical Joomla!for DevelopersOpen Source Day, Udine, Italy, 28 november 2015ALEXANDRU PRUTEANU @palexcom
1
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
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
Utilizzo nel mondo
4
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
Core Features
● Nested categorization● Tagging● Frontend Editing● Content Versioning● Menu Manager● Powerful Extensibility● Extensive ACL
6
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
Technical Requirements
8
Model-View-Controller
9
Architecture of Joomla!
10
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
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
Github
● A Git service, code review, and code management● https://github.com/joomla/joomla-cms
13
Composer
● Dependency Manager for PHP● Da poco, Joomla Framework● Software per la gestione di dipendenze esterne
14
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
PHPCode_Sniffer IDE example
16
Phing
● PHP project build system or build tool based on Apache Ant
17
Travis CI
● Easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes
18
Travis CI example
● Easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes
19
Travis CI example
20
Jenkins
● An extensible open source continuous integration server● https://jenkins-ci.org/
21
Jenkins example
22
Jenkins example
23
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
Semantic Versioning
● http://semver.org/● example Joomla! version 3.4.5
25
Come creare un ambiente di sviluppo per Joomla!
● Project Fork● Vagrant, Docker, XAMPP …● PHPStorm, Eclipse● Joomla Configurations for Development● XDebug
26
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
Vagrant
● Vagrant box per Joomla!○ https://github.com/joomlatools/joomla-vagrant
● Configure Vagrant○ > cd ./joomla-cms○ > vagrant init○ > vagrant up 28
Vagrant (LAMP stack)
29
IDE
● PHPStorm (free for Students)● Eclipse● Install and configure PHPCode_Sniffer● Inlcude Joomla! core libraries
○ ./includes○ ./administrator/includes○ ./libraries
30
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
Joomla Configurations for Development
32
Joomla Configurations for Development
33
Joomla Configurations for Development
34
Joomla Configurations for Development
35
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
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
Come creare un Plugin (manifest file)
38
Come creare un Plugin (main file)
39
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
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
Thanks. Q/A? :)ALEXANDRU PRUTEANU @palexcom
42