1 / 30

Future Deployment of PHP Applications

Future Deployment of PHP Applications. Davey Shafik. davey@php.net. About Me. Davey Shafik is: A long time contributor to PEAR http://pear.php.net A long time blogger http://pixelated-dreams.com A long time helper irc.freenode.net ##PHP & #php.thinktank

brygid
Download Presentation

Future Deployment of PHP Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Future Deployment of PHP Applications Davey Shafik davey@php.net

  2. About Me • Davey Shafik is: • A long time contributor to PEAR • http://pear.php.net • A long time blogger • http://pixelated-dreams.com • A long time helper • irc.freenode.net ##PHP & #php.thinktank • Contributor to the Zend PHP Framework • http://framework.zend.com • Hard of hearing, so speak up! Orlando, Florida April 25-28, 2006

  3. Orlando, Florida April 25-28, 2006 This Session We will be covering: What are PEAR Channels? An in-depth look into PEAR Channels What is PHP_Archive? What is PHAR?

  4. Orlando, Florida April 25-28, 2006 Questions? Feel free to interrupt me!

  5. PEAR Channels

  6. Orlando, Florida April 25-28, 2006 PEAR Channels Robust and Effective way of distributing applications. Allow complex Dependencies. Even across channels. Standardized by the PEAR Project Easy for users. Uses the PEAR command-line tool. Installed by default with PHP.

  7. Orlando, Florida April 25-28, 2006 PEAR Packages PEAR Packages are a standardized distribution method for PHP code and PHP extensions. Cross Platform Optionally Gzip compressed Tar archives Common directory structure (recommended) Easily installed, removed and maintained Allows for post-install tasks to be run (e.g. Database setup.) Allow for non-PHP content.

  8. Orlando, Florida April 25-28, 2006 The Basics Channels use REST Web Services Smaller messages than XML-RPC Quicker to generate/parse Channels are defined using a simple XML file in the document root You can easily write your own Channel Server/Frontend OR Use Chiara_PEAR_Server & Crtx_PEAR_Channel_Frontend

  9. Orlando, Florida April 25-28, 2006 Setting up a PEAR Channel Setting up a PEAR Channel in 4 easy steps: 1) Install Chiara_PEAR_Server 2) Run the Post Install Script Creates channel.xml Sets up your Database Sets up your Document Root 3) Install Crtx_PEAR_Channel_Frontend Copy files to your Document Root 4) Upload Packages

  10. Orlando, Florida April 25-28, 2006 Chiara_PEAR_Server Created By: • Greg Beaver • Creator of PEAR Channels Improved and Maintained By: • Clay Loveless • Creator and Maintainer of pearified.com – A repository of PEARified applications • Davey Shafik • thats me, remember?

  11. Orlando, Florida April 25-28, 2006 Installing Chiara_PEAR_Server ... AKA using PEAR Channels for the first time. Discovering the Channel: $ pear channel-discover pear.chiaraquartet.net Adding Channel "pear.chiaraquartet.net" succeeded Discovery of channel "pear.chiaraquartet.net" succeeded

  12. Orlando, Florida April 25-28, 2006 Install Chiara_PEAR_Server $ pear install --alldeps chiara/Chiara_PEAR_Server-alpha downloading Chiara_PEAR_Server-0.18.4.tgz ... Starting to download Chiara_PEAR_Server-0.18.4.tgz (32,479 bytes) .........done: 32,479 bytes ..... install ok: channel://pear.chiaraquartet.net/Chiara_PEAR_Server-0.18.4 Chiara_PEAR_Server: Optional feature pearweb available (Public frontend for users to browse channel packages) To install use "pear install chiara/Chiara_PEAR_Server#featurename" chiara/Chiara_PEAR_Server has post-install scripts: /usr/share/pear/Chiara/PEAR/Server/mysqlinstall.php Use "pear run-scripts chiara/Chiara_PEAR_Server" to run DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES

  13. Orlando, Florida April 25-28, 2006 Crtx_PEAR_Channel_Frontend Created By: Davey Shafik Starting to see a pattern here? Improved and Maintained by: Greg Beaver Yeah, him again.

  14. Orlando, Florida April 25-28, 2006 Need To Know Plays nice with Chiara_PEAR_Server Actually, it doesn't work with out it CSS Styleable OR Do it from scratch Just works.

  15. Orlando, Florida April 25-28, 2006 Features Features: Package Page Links to Bugs, Dependencies, etc. Package List Package Search Maintainer List Contact Form RSS Feeds etc...

  16. Orlando, Florida April 25-28, 2006 Installation Discovering the Channel $ pear channel-discover pear.crtx.org Adding Channel "pear.crtx.org" succeeded Discovery of channel "pear.crtx.org" succeeded Starting to look familiar?

  17. Orlando, Florida April 25-28, 2006 Installation $ pear install crtx/Crtx_PEAR_Channel_Frontend-alpha downloading Crtx_PEAR_Channel_Frontend-0.3.1.tgz ... Starting to download Crtx_PEAR_Channel_Frontend-0.3.1.tgz (23,142 bytes) ........done: 23,142 bytes install ok: channel://pear.crtx.org/Crtx_PEAR_Channel_Frontend-0.3.1

  18. Orlando, Florida April 25-28, 2006 Final Tasks Move files Customize CSS Create packages, maintainers and categories. Starting with: $ mv /usr/share/pear/docs/Crtx_PEAR_Channel_Frontend/docs/examples/* /var/www/pear/ Don't forget to use your own directory structures!

  19. Orlando, Florida April 25-28, 2006 Note: Switch to Editor Here

  20. Orlando, Florida April 25-28, 2006 PEAR Packages 101 Packaging PEAR compatible packages is simple. Create your Package Create a PEAR_PackageFileManager script Run the script Install to test Upload

  21. Orlando, Florida April 25-28, 2006 Our Package /Test.php /Test /Subclass.php /docs /README /tests /basic.phpt

  22. Orlando, Florida April 25-28, 2006 Creating the Package Create a Packaging Script Run it Run the PEAR package command

  23. The End?

  24. PHP_Archive & PHAR

  25. Orlando, Florida April 25-28, 2006 PHP_Archive Created By Davey Shafik Improved and Maintained By Greg Beaver Marcus Böerger

  26. PHP Archives - PHARs Orlando, Florida April 25-28, 2006 PHP Archives (PHARs) are optionally compressed files containing entire PHP applications. This includes: • PHP Code • HTML Files • Images • CSS • JS • Anything • One notable exception: SQLite Databases.

  27. Orlando, Florida April 25-28, 2006 PHAR Then... Originally PHAR files were: Non-compressed Specially formatted, valid TAR archives Created and read using PHP code

  28. Orlando, Florida April 25-28, 2006 PHAR Now... Today, PHAR files are: Optionally Compressed Custom, optimized archive format Can be created/read using PHP Or Can be read using ext/phar Proposed for bundling in PHP 5.2.0/6.0

  29. Stability Orlando, Florida April 25-28, 2006 • PHARs are stable • Backwards incompatibility is impossible • PHARs are great for non-web apps • We're working on web apps…

  30. The End Orlando, Florida April 25-28, 2006 • Questions? • Comments? • Gripes? • E-Mail me, davey@php.net

More Related