SlideShare une entreprise Scribd logo
1  sur  28
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
and Composer 
Photo: arianta@flickr
Composer in general 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
What is Composer? 
is a Dependency Manager for PHP 
written in PHP 
URL: https://getcomposer.org
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
What does Composer do? 
❖ Loads source code (packages) from different 
locations to your project 
❖ Central composer repository: 
https://packagist.org/ 
❖ Composer ♥ JSON
Example of a composer package: 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
TYPO3 Flow
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
First steps in Composer 
1. Download composer: 
curl -sS https://getcomposer.org/installer | php 
2. Call composer like this: 
./composer.phar create-project typo3/flow 
>> Downloads TYPO3 Flow with all dependencies
What Composer also can do for you 
❖ Composer puts packages per default to folder 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
“vendor” 
❖ API existing to write own plugins 
➢ Hooks/Events for every part of composer 
➢ Move packages from vendor folder to own destination 
❖ Create own packages
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Composer’s advantages 
❖ No code redundancy 
❖ Easy to maintain (updates) 
❖ Very flexible 
❖ Standard for PHP dependency management
How to handle TYPO3 
extensions in VCS? 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014
How to handle T3 extensions in VCS? 
❖ Just check them in, like any other code 
➢ Standard extensions like realurl, powermail or dce ;-) 
are located in several repositories at the same time 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
➢ Probably in different versions 
➢ Very costly to keep them up to date 
➢ Extrem high redundancy
How to handle T3 extensions in VCS? 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
❖ Use SVN externals 
➢ No redundancy anymore 
➢ But not all extensions got a SVN repository 
➢ So we had to create our own SVN repository for 
extensions we were using in several projects 
■ Also very costly, because each new extension or version 
of an extension needs to get imported to SVN
Composer for TYPO3 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Composer for TYPO3 
❖ Works with all VCS like Git, SVN or Mercurial 
❖ Requirements: 
➢ A composer.json file in root of your TYPO3 project 
➢ Possibility to run composer (on server or locally) 
❖ URL: http://composer.typo3.org
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
composer.json 
{ 
"repositories": [ 
{ 
"type": "composer", 
"url": "http://composer.typo3.org/" 
}, 
{ 
"type": "composer", 
"url": 
"http://user:pass@composer.sunzinet.com/" 
} 
],
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
composer.json 
"replace": { 
"typo3/cms": "*" 
}, 
"require": { 
"typo3/cms-composer-installers": "*", 
"typo3-ter/realurl": "1.12.*", 
"typo3-ter/nc-staticfilecache": "2.5.1", 
"sunzinet/gridelements": "3.0.0", 
"sunzinet/t3ddy": "0.2.0", 
"sunzinet/sz_nc_staticfilecache": "0.4.2" 
} 
}
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
composer.json parts 
1. Repositories 
➢ List of composer repositories (with T3 extensions) 
2. Replace 
➢ Optional. Disables download of TYPO3 itself 
3. Require 
➢ Defines which extensions should be included to your 
project. Underscores in extkeys become minus!
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Run composer 
./composer.phar install 
❖ Composer downloads all extensions 
❖ Moves them from vendor/ to typo3conf/ext/ 
➢ Because of hook which is also provided by TYPO3 
Composer Repository 
❖ vendor/ folder may get deleted manually
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
How to update extensions? 
❖ Just change version number in composer.json 
❖ Or add/remove extensions 
❖ Perform Composer update: 
./composer.phar update
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Known issues 
❖ Bugtracker in forge (9 bugs, 3 features, 2 tasks open) 
❖ Extensions with sysext dependencies fail 
➢ Because the sysext is not located in repository 
➢ gridelements is such an extension 
➢ And all extensions based on gridelements (like t3ddy) 
➢ Ticket in forge: 60950
How to get your own Composer repo 
❖ Composer repositories are also just JSON files 
❖ Located under: domain.com/packages.json 
❖ It contains packages 
❖ and different versions for each package 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
packages.json example
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Composer and Git 
❖ In .gitignore you should exclude some stuff: 
/composer.lock 
/composer.phar 
/vendor 
/vendor/** 
/typo3conf/ext/** 
!/typo3conf/ext/your_own_extension 
!/typo3conf/ext/your_own_extension/**
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
.htaccess improvements 
❖ In .htaccess you should also exclude access to: 
# Deny direct access to several files 
RewriteCond %{REQUEST_URI} ^/typo3_src [OR] 
RewriteCond %{REQUEST_URI} ^/composer.json [OR] 
RewriteCond %{REQUEST_URI} ^/composer.lock [OR] 
RewriteCond %{REQUEST_URI} ^/.gitignore [OR] 
RewriteCond %{REQUEST_URI} ^/.gitattributes [OR] 
RewriteCond %{REQUEST_URI} ^/phpci.yml 
RewriteRule .* / [L,R=301]
PHPCI, Composer and 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
TYPO3
URL: https://www.phptesting.org/ 
❖ Continuous Integration based on PHP 
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
➢ Automated code checks: 
■ PhpLoc, Mass Detector, Code Sniffer, PhpUnit 
➢ Composer support 
■ Execution after code checks 
➢ Creation of deployable archives 
➢ Report state of build back to Git GUI
Armin Rüdiger Vieweg |@Twitter | 19.11.2014
Armin Rüdiger Vieweg |@Twitter | 19.11.2014 
Questions? 
Photo: an_untrained_eye@flickr
Armin Rüdiger Vieweg Photo: wi|n@stTownaitvtiecrh|@19fl.i1c1k.r2014 
Thank you! 
POWERED BY

Contenu connexe

Tendances

Tendances (20)

CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Pipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingPipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of Testing
 
Ci with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgiumCi with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgium
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Jenkins pipeline as code
Jenkins pipeline as codeJenkins pipeline as code
Jenkins pipeline as code
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development Pipeline
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
Continuous integration ( jen kins travis ci)
Continuous integration ( jen kins  travis ci)Continuous integration ( jen kins  travis ci)
Continuous integration ( jen kins travis ci)
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
 
JUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and GroovyJUC Europe 2015: Plugin Development with Gradle and Groovy
JUC Europe 2015: Plugin Development with Gradle and Groovy
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 
From Virtual Machines to Containers
From Virtual Machines to ContainersFrom Virtual Machines to Containers
From Virtual Machines to Containers
 
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data ProjectsJUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
 
Dockerizing your java development environment
Dockerizing your java development environmentDockerizing your java development environment
Dockerizing your java development environment
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 
Jenkins : Pipeline As Code
Jenkins : Pipeline As CodeJenkins : Pipeline As Code
Jenkins : Pipeline As Code
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2
 
Building Good Containers for Python Applications
Building Good Containers for Python ApplicationsBuilding Good Containers for Python Applications
Building Good Containers for Python Applications
 

En vedette

En vedette (9)

Integration des ownCloud CardDAV Servers mit TYPO3
Integration des ownCloud CardDAV Servers mit TYPO3Integration des ownCloud CardDAV Servers mit TYPO3
Integration des ownCloud CardDAV Servers mit TYPO3
 
Rsyslog log normalization
Rsyslog log normalizationRsyslog log normalization
Rsyslog log normalization
 
Composer und TYPO3
Composer und TYPO3Composer und TYPO3
Composer und TYPO3
 
Frontend Formulare in TYPO3 8 LTS
Frontend Formulare in TYPO3 8 LTSFrontend Formulare in TYPO3 8 LTS
Frontend Formulare in TYPO3 8 LTS
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
TYPO3 CMS 7.0 - Die Neuerungen - pluswerk
TYPO3 CMS 7.0 - Die Neuerungen - pluswerkTYPO3 CMS 7.0 - Die Neuerungen - pluswerk
TYPO3 CMS 7.0 - Die Neuerungen - pluswerk
 
TYPO3 Monitoring mit t3monitoring
TYPO3 Monitoring mit t3monitoringTYPO3 Monitoring mit t3monitoring
TYPO3 Monitoring mit t3monitoring
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
HP ArcSight
HP ArcSight HP ArcSight
HP ArcSight
 

Similaire à TYPO3 & Composer

Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
 

Similaire à TYPO3 & Composer (20)

ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScriptENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
 
Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017Php Dependency Management with Composer ZendCon 2017
Php Dependency Management with Composer ZendCon 2017
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013
 
Composer - The missing package manager for PHP
Composer - The missing package manager for PHPComposer - The missing package manager for PHP
Composer - The missing package manager for PHP
 
Composer Lightning Talk
Composer Lightning TalkComposer Lightning Talk
Composer Lightning Talk
 
CodeIgniter For Project : Workshop 001 - Install Docker and CodeIgniter
CodeIgniter For Project : Workshop 001 - Install Docker and CodeIgniterCodeIgniter For Project : Workshop 001 - Install Docker and CodeIgniter
CodeIgniter For Project : Workshop 001 - Install Docker and CodeIgniter
 
An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony An introduction to the Symfony CMF - creating a CMS on top of Symfony
An introduction to the Symfony CMF - creating a CMS on top of Symfony
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupal
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Nextcloud Android App Development Process Insights
Nextcloud Android App Development Process InsightsNextcloud Android App Development Process Insights
Nextcloud Android App Development Process Insights
 
Ian huston getting started with cloud foundry
Ian huston   getting started with cloud foundryIan huston   getting started with cloud foundry
Ian huston getting started with cloud foundry
 
Ian Huston - "Deploying your data driven web app on Cloud Foundry"
Ian Huston - "Deploying your data driven web app on Cloud Foundry" Ian Huston - "Deploying your data driven web app on Cloud Foundry"
Ian Huston - "Deploying your data driven web app on Cloud Foundry"
 
Composer
ComposerComposer
Composer
 
August OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub ExplainedAugust OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub Explained
 
Keeping a codebase fresh for over a decade
Keeping a codebase fresh for over a decadeKeeping a codebase fresh for over a decade
Keeping a codebase fresh for over a decade
 
Composer Best Practices
Composer Best PracticesComposer Best Practices
Composer Best Practices
 
Composer Best Practices
Composer Best PracticesComposer Best Practices
Composer Best Practices
 

Dernier

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 

Dernier (20)

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 

TYPO3 & Composer

  • 1. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 and Composer Photo: arianta@flickr
  • 2. Composer in general Armin Rüdiger Vieweg |@Twitter | 19.11.2014
  • 3. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 What is Composer? is a Dependency Manager for PHP written in PHP URL: https://getcomposer.org
  • 4. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 What does Composer do? ❖ Loads source code (packages) from different locations to your project ❖ Central composer repository: https://packagist.org/ ❖ Composer ♥ JSON
  • 5. Example of a composer package: Armin Rüdiger Vieweg |@Twitter | 19.11.2014 TYPO3 Flow
  • 6. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 First steps in Composer 1. Download composer: curl -sS https://getcomposer.org/installer | php 2. Call composer like this: ./composer.phar create-project typo3/flow >> Downloads TYPO3 Flow with all dependencies
  • 7. What Composer also can do for you ❖ Composer puts packages per default to folder Armin Rüdiger Vieweg |@Twitter | 19.11.2014 “vendor” ❖ API existing to write own plugins ➢ Hooks/Events for every part of composer ➢ Move packages from vendor folder to own destination ❖ Create own packages
  • 8. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Composer’s advantages ❖ No code redundancy ❖ Easy to maintain (updates) ❖ Very flexible ❖ Standard for PHP dependency management
  • 9. How to handle TYPO3 extensions in VCS? Armin Rüdiger Vieweg |@Twitter | 19.11.2014
  • 10. How to handle T3 extensions in VCS? ❖ Just check them in, like any other code ➢ Standard extensions like realurl, powermail or dce ;-) are located in several repositories at the same time Armin Rüdiger Vieweg |@Twitter | 19.11.2014 ➢ Probably in different versions ➢ Very costly to keep them up to date ➢ Extrem high redundancy
  • 11. How to handle T3 extensions in VCS? Armin Rüdiger Vieweg |@Twitter | 19.11.2014 ❖ Use SVN externals ➢ No redundancy anymore ➢ But not all extensions got a SVN repository ➢ So we had to create our own SVN repository for extensions we were using in several projects ■ Also very costly, because each new extension or version of an extension needs to get imported to SVN
  • 12. Composer for TYPO3 Armin Rüdiger Vieweg |@Twitter | 19.11.2014
  • 13. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Composer for TYPO3 ❖ Works with all VCS like Git, SVN or Mercurial ❖ Requirements: ➢ A composer.json file in root of your TYPO3 project ➢ Possibility to run composer (on server or locally) ❖ URL: http://composer.typo3.org
  • 14. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 composer.json { "repositories": [ { "type": "composer", "url": "http://composer.typo3.org/" }, { "type": "composer", "url": "http://user:pass@composer.sunzinet.com/" } ],
  • 15. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 composer.json "replace": { "typo3/cms": "*" }, "require": { "typo3/cms-composer-installers": "*", "typo3-ter/realurl": "1.12.*", "typo3-ter/nc-staticfilecache": "2.5.1", "sunzinet/gridelements": "3.0.0", "sunzinet/t3ddy": "0.2.0", "sunzinet/sz_nc_staticfilecache": "0.4.2" } }
  • 16. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 composer.json parts 1. Repositories ➢ List of composer repositories (with T3 extensions) 2. Replace ➢ Optional. Disables download of TYPO3 itself 3. Require ➢ Defines which extensions should be included to your project. Underscores in extkeys become minus!
  • 17. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Run composer ./composer.phar install ❖ Composer downloads all extensions ❖ Moves them from vendor/ to typo3conf/ext/ ➢ Because of hook which is also provided by TYPO3 Composer Repository ❖ vendor/ folder may get deleted manually
  • 18. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 How to update extensions? ❖ Just change version number in composer.json ❖ Or add/remove extensions ❖ Perform Composer update: ./composer.phar update
  • 19. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Known issues ❖ Bugtracker in forge (9 bugs, 3 features, 2 tasks open) ❖ Extensions with sysext dependencies fail ➢ Because the sysext is not located in repository ➢ gridelements is such an extension ➢ And all extensions based on gridelements (like t3ddy) ➢ Ticket in forge: 60950
  • 20. How to get your own Composer repo ❖ Composer repositories are also just JSON files ❖ Located under: domain.com/packages.json ❖ It contains packages ❖ and different versions for each package Armin Rüdiger Vieweg |@Twitter | 19.11.2014
  • 21. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 packages.json example
  • 22. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Composer and Git ❖ In .gitignore you should exclude some stuff: /composer.lock /composer.phar /vendor /vendor/** /typo3conf/ext/** !/typo3conf/ext/your_own_extension !/typo3conf/ext/your_own_extension/**
  • 23. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 .htaccess improvements ❖ In .htaccess you should also exclude access to: # Deny direct access to several files RewriteCond %{REQUEST_URI} ^/typo3_src [OR] RewriteCond %{REQUEST_URI} ^/composer.json [OR] RewriteCond %{REQUEST_URI} ^/composer.lock [OR] RewriteCond %{REQUEST_URI} ^/.gitignore [OR] RewriteCond %{REQUEST_URI} ^/.gitattributes [OR] RewriteCond %{REQUEST_URI} ^/phpci.yml RewriteRule .* / [L,R=301]
  • 24. PHPCI, Composer and Armin Rüdiger Vieweg |@Twitter | 19.11.2014 TYPO3
  • 25. URL: https://www.phptesting.org/ ❖ Continuous Integration based on PHP Armin Rüdiger Vieweg |@Twitter | 19.11.2014 ➢ Automated code checks: ■ PhpLoc, Mass Detector, Code Sniffer, PhpUnit ➢ Composer support ■ Execution after code checks ➢ Creation of deployable archives ➢ Report state of build back to Git GUI
  • 26. Armin Rüdiger Vieweg |@Twitter | 19.11.2014
  • 27. Armin Rüdiger Vieweg |@Twitter | 19.11.2014 Questions? Photo: an_untrained_eye@flickr
  • 28. Armin Rüdiger Vieweg Photo: wi|n@stTownaitvtiecrh|@19fl.i1c1k.r2014 Thank you! POWERED BY