Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
HOLGER WOLTERSDORF
CIO • FATHER • HUSBAND • PHP DEV
ORGA-MITGLIED DER
@hollodotme
@phpindd
phpind.de
github.com/hollodotme...
1 2 3
Einführung in
PHAR Tools
PHARs verteilen
& updaten
Anwendungs-
Beispiele
PhiVE
4
Was sind PHARs eigentlich?
๏ PHARs sind (ausführbare) gepackte PHP
Applikationen
๏ PHP-eigenes Format, aber konvertierbar ...
Hallo Welt!
<?php
$phar = new Phar( __DIR__ . '/hello.phar' );
$phar->buildFromDirectory( __DIR__ . '/HelloPHAR' );
$phar-...
php.ini
[Phar]
; http://php.net/phar.readonly
;phar.readonly = On
; http://php.net/phar.require-hash
;phar.require_hash = ...
php.ini
[Phar]
; http://php.net/phar.readonly
;phar.readonly = On
phar.readonly = Off
; http://php.net/phar.require-hash
;...
Einführung in PHAR Tools1
Automate
everything!
Einführung in PHAR Tools1
PHAR Tools vs. Tool-Scripts:
๏ Kaum Mehraufwand
๏ Beliebige Komplexität und Größe
๏ Einfach zu v...
Einführung in PHAR Tools1
Console /
Process
BOX
Project
Dependency
Manager
Einführung in PHAR Tools1
Features Symfony Console:
๏ Coloured Logging / Verbosity-Levels
๏ App-Struktur / Commands
๏ Inpu...
Einführung in PHAR Tools1
Features BOX Project:
๏ Einfache Config für das PHAR-Building
๏ Placeholder z.B. für GIT-Version...
Anwendungs-Beispiele2
Anwendungsbeispiele2
“Standard” PHAR Tools:
๏ Testing: phpunit / codecept
๏ Analysis: pdepend, phpcpd, phpcs, phploc,
phpm...
Anwendungsbeispiele2
DEMO
PHARs verteilen
& updaten
3
PHARs verteilen & updaten3
Tipps für die Verteilung:
๏ Eigenes Repo für die PHARs
๏ Versionierung nach SemVer (ohne “v”!)
...
PHARs verteilen & updaten3
Install / Update-Strategien:
๏ Self-Hosted
๏ GitHub als Download zum Release
๏ PhiVE / PHAR.IO
VIELEN DANK!
@hollodotme
@phpindd
phpind.de
github.com/hollodotme
github.com/PHPinDD
www.fortuneglobe.com
www.phpug-dresde...
AppendixA
Links / Quellen:
๏ Official PHAR documentation: http://php.net/phar
๏ Symfony Console Component: http://symfony....
PHAR better Tools
Upcoming SlideShare
Loading in …5
×

PHAR better Tools

740 views

Published on

Slides of my talk at PHP USERGROUP DRESDEN on 29.06.2016 bei Collab & Couch

* Example-Source-Code: https://github.com/PHPinDD/phar-better-tool-example
* Example-Distribution: https://github.com/PHPinDD/phar-better-tool-distribution

Published in: Software
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

PHAR better Tools

  1. 1. HOLGER WOLTERSDORF CIO • FATHER • HUSBAND • PHP DEV ORGA-MITGLIED DER @hollodotme @phpindd phpind.de github.com/hollodotme github.com/PHPinDD
  2. 2. 1 2 3 Einführung in PHAR Tools PHARs verteilen & updaten Anwendungs- Beispiele PhiVE 4
  3. 3. Was sind PHARs eigentlich? ๏ PHARs sind (ausführbare) gepackte PHP Applikationen ๏ PHP-eigenes Format, aber konvertierbar nach ZIP und TAR ๏ Kann mit der PHAR Extension oder PEARPHP_Archive erstellt werden ๏ Lese-/Schreibzugriff über StreamWrapper 1 Einführung in PHAR Tools
  4. 4. Hallo Welt! <?php $phar = new Phar( __DIR__ . '/hello.phar' ); $phar->buildFromDirectory( __DIR__ . '/HelloPHAR' ); $phar->setDefaultStub( 'bin/main.php' ); /makephar.php <?php echo 'Hello World!'; /HelloPHAR/bin/main.php Einführung in PHAR Tools1
  5. 5. php.ini [Phar] ; http://php.net/phar.readonly ;phar.readonly = On ; http://php.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = Einführung in PHAR Tools1
  6. 6. php.ini [Phar] ; http://php.net/phar.readonly ;phar.readonly = On phar.readonly = Off ; http://php.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = Einführung in PHAR Tools1
  7. 7. Einführung in PHAR Tools1 Automate everything!
  8. 8. Einführung in PHAR Tools1 PHAR Tools vs. Tool-Scripts: ๏ Kaum Mehraufwand ๏ Beliebige Komplexität und Größe ๏ Einfach zu verteilen und zu aktualisieren ๏ Nicht ohne weiteres manipulierbar ๏ Herkunft kann verifiziert werden ๏ Dependency Encapsulation
  9. 9. Einführung in PHAR Tools1 Console / Process BOX Project Dependency Manager
  10. 10. Einführung in PHAR Tools1 Features Symfony Console: ๏ Coloured Logging / Verbosity-Levels ๏ App-Struktur / Commands ๏ Input / Output Interfaces ๏ Optionen und Argumente Handling ๏ Diverse Helpers ๏ Hilfe
  11. 11. Einführung in PHAR Tools1 Features BOX Project: ๏ Einfache Config für das PHAR-Building ๏ Placeholder z.B. für GIT-Version ๏ Stubbing für CLI Executables ๏ Include/Exclude Files ๏ Signing / Verifying mit OpenSSL Key
  12. 12. Anwendungs-Beispiele2
  13. 13. Anwendungsbeispiele2 “Standard” PHAR Tools: ๏ Testing: phpunit / codecept ๏ Analysis: pdepend, phpcpd, phpcs, phploc, phpmd, … ๏ Dependencies: composer, graph-composer ๏ und viele mehr…
  14. 14. Anwendungsbeispiele2 DEMO
  15. 15. PHARs verteilen & updaten 3
  16. 16. PHARs verteilen & updaten3 Tipps für die Verteilung: ๏ Eigenes Repo für die PHARs ๏ Versionierung nach SemVer (ohne “v”!) ๏ Permalink für den latest Build ๏ Katalog für alle Builds (JSON)
  17. 17. PHARs verteilen & updaten3 Install / Update-Strategien: ๏ Self-Hosted ๏ GitHub als Download zum Release ๏ PhiVE / PHAR.IO
  18. 18. VIELEN DANK! @hollodotme @phpindd phpind.de github.com/hollodotme github.com/PHPinDD www.fortuneglobe.com www.phpug-dresden.de @phpugdd HOLGER WOLTERSDORF slides available on slideshare
  19. 19. AppendixA Links / Quellen: ๏ Official PHAR documentation: http://php.net/phar ๏ Symfony Console Component: http://symfony.com/doc/current/components/console ๏ Symfony Process Component: http://symfony.com/doc/current/components/process ๏ BOX-Project (GitHub): https://github.com/box-project/box2 ๏ BOX-Project Documentation: http://box-project.github.io/box2/ ๏ PHAR-Update Lib: https://packagist.org/packages/herrera-io/phar-update ๏ Blog-Post “Distributing a PHP CLI app with ease” by Matthieu Moquet (@MattKetmo): https://moquet.net/blog/distributing-php-cli/ ๏ Blog Post “Secure PHAR Automation” by Matthew Weier O’Phinney: https://mwop.net/blog/2015-12-14-secure-phar-automation.html ๏ PHAR Updater: ๏ https://github.com/padraic/phar-updater ๏ https://github.com/kherge-abandoned/php-phar-update ๏ Example-Tools: https://github.com/PHPinDD/phar-better-tool-example ๏ Example-Distribution: https://github.com/PHPinDD/phar-better-tool-distribution

×