Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Théo Fidry:
Create and deploy secure PHARs
Jan 04, 2018 @ 19:45:57

For those Phar users out there Théo Fidry has written up a guide to help you create and deploy them securely with the help of a few tools and OpenSSL to sign the release to ensure integrity.

For those who are not familiar with it, PHAR (Php Archive) is analogous to the JAR file concept but for PHP. It allows you to package an application into a single file making it convenient to deploy or distribute.

[...] So what are PHARs useful for then? Well still the same thing: packaging applications. Although not many people may want to use this technique for web applications, it is still extremely useful for console applications.

The tutorial starts off by showing a few different methods for installing Phars and how to build them from your code. While they can be built manually, he suggests using the box project to help make it simpler. It also covers self-updating phars and shows how to update the box.json configuration to use a generated key to sign the release. Finally it covers a method for using Travis-CI to auto-build the phar and how to keep the OpenSSL key safe and out of the checked in code.

tagged: phar tutorial install create sign openssl box build travisci

Link: https://medium.com/@tfidry/create-and-deploy-secure-phars-c5572f10b4dd

Facebook HipHop Open Source Blog:
Under the hood: Box's HHVM migration
Jul 20, 2015 @ 16:17:58

The Facebook HipHop Open Source blog has posted a case study from Box about their migration to HHVM and some of the challenges and benefits that came along with it.

Reducing latency and increasing the capacity of our infrastructure have always been top priorities at Box. We strive to deliver the best possible user experience in the most efficient manner, and historically our choice of PHP hasn’t aligned well with these goals. I'm very happy to report that we've recently made very significant strides toward these two ideals by successfully deploying HHVM (the HipHop Virtual Machine) as the exclusive engine that serves our PHP codebase. In the rest of this post, I will detail how we use PHP, how HHVM works, the challenges we faced migrating to HHVM, and the remarkable performance wins it provides.

The post talks about how central PHP is to their overall technology stack and how, despite the work being put in, the processing of requests was starting to be a bit too much. In came the HHVM and some discussion about how it might be used there at Box. They started a yearlong effort to migrate their entire stack to HHVM especially since HHVM has almost reached parity with the PHP language itself. They talk some about the differences in design between the two and how the migration changed their deployment process. They also cover some of the other interesting things that come with a major migration including phased rollout and host-based conversion methods. Finally they share some of the statistics around the performance of the end result, including the better response times and reduced CPU graphs.

tagged: hhvm hiphop opensource blog box migration

Link: https://code.facebook.com/posts/1607907626123431/under-the-hood-box-s-hhvm-migration/

SitePoint PHP Blog:
Boxing up your Apps as Phars Quickly and Easily with Box
Jun 16, 2015 @ 13:44:27

The SitePoint PHP blog has a new tutorial posted showing you how to easily package up your application with Box to make phar files without the extra hassle of building them yourself.

In this tutorial, we’ll use Box to package a PHP application into a Phar, in order to make it easily distributable and globally installable via Composer.

For his example he uses the PHP portion of the FolderBuilder project and makes a command-line executable that can return the information for a directory as JSON data. He starts by installing the "box" executable command on a local VM and defines the simple configuration file, a "box.json" with some basic settings. He then clones the FolderBuilder project, updates the configuration for the correct locations and files and executes the "build" command. The result is a phar file that contains the PHP script functionality. He also updates the configuration to make the result executable with a "chmod" setting, removing the need to call it with the PHP command line version. He ends the post showing how to test it out, taking the results and dropping them into FolderBuilder to make sure they're 100% correct.

tagged: tutorial build phar archive easy box commandline tool

Link: http://www.sitepoint.com/boxing-apps-phars-quickly-easily-box/

DevShed:
Factoring Content Boxes with the Factory Pattern in PHP 5
Jul 09, 2007 @ 19:36:00

DevShed finishes off their look at using the Factory design pattern in a PHP5 application with this last part of the series - using the pattern in factoring content boxes on your site.

I'd like to put the tiny details of the factory pattern to the side (at least momentarily) and introduce the topics that I plan to cover in this final article of the series. In this last tutorial I'm going to teach you how to implement this useful pattern to build a bunch of highly-customizable content boxes, which can be quickly included into any web page.

Building on the foundation from previous parts of the series, they create the different boxes with different types (like GreyContentBox and BlueContentBox based on ContentBox) and displaying them to a page via calls to their Factory interfaces.

tagged: factory designpattern content box php5 tutorial factory designpattern content box php5 tutorial

Link:

DevShed:
Factoring Content Boxes with the Factory Pattern in PHP 5
Jul 09, 2007 @ 19:36:00

DevShed finishes off their look at using the Factory design pattern in a PHP5 application with this last part of the series - using the pattern in factoring content boxes on your site.

I'd like to put the tiny details of the factory pattern to the side (at least momentarily) and introduce the topics that I plan to cover in this final article of the series. In this last tutorial I'm going to teach you how to implement this useful pattern to build a bunch of highly-customizable content boxes, which can be quickly included into any web page.

Building on the foundation from previous parts of the series, they create the different boxes with different types (like GreyContentBox and BlueContentBox based on ContentBox) and displaying them to a page via calls to their Factory interfaces.

tagged: factory designpattern content box php5 tutorial factory designpattern content box php5 tutorial

Link:

Edin Kadribasic's Blog:
PECL4WIN Build Box Dead
Nov 14, 2006 @ 22:38:00

Some unfortunate news from Edin Kadribasic to be felt particularly by the Windows PHP users out there - the box that hosts the PECL packages for Windows has suffered a bit from a power failure.

The power failures are very rare in Denmark, but nonetheless this one managed to take out the build box. The website itself is not affected, but there are no updates for the time being.

The PECL4WIN project hosts a repository of PECL extensions precompiled for the Windows platform. The packaging and distribution system used by PECL is shared with its sister, PEAR.

UPDATE (11.15.2006) - The box is back up and working at 100% again (faulty memory was to blame). A new build has already been created.

tagged: pecl4win box machine power failure downtime update pecl4win box machine power failure downtime update

Link:

Edin Kadribasic's Blog:
PECL4WIN Build Box Dead
Nov 14, 2006 @ 22:38:00

Some unfortunate news from Edin Kadribasic to be felt particularly by the Windows PHP users out there - the box that hosts the PECL packages for Windows has suffered a bit from a power failure.

The power failures are very rare in Denmark, but nonetheless this one managed to take out the build box. The website itself is not affected, but there are no updates for the time being.

The PECL4WIN project hosts a repository of PECL extensions precompiled for the Windows platform. The packaging and distribution system used by PECL is shared with its sister, PEAR.

UPDATE (11.15.2006) - The box is back up and working at 100% again (faulty memory was to blame). A new build has already been created.

tagged: pecl4win box machine power failure downtime update pecl4win box machine power failure downtime update

Link:

ThinkPHP Blog:
Real life SOAP - connecting your browser to a VoIP PBX
Jun 07, 2006 @ 10:53:55

Björn Schotte has a new post on the ThinkPHP blog today with details on a handy interface script, a port of this PhoneMonitor application, over to PHP5.

Here at Mayflower, we're using two Innovaphone IP800 gateways at each of our departments (Munich and Würzburg). They are connected to each other and replicate their data. Besides that, the Gateways do use LDAP for saving the contact data and provide a SOAP interface for connecting to the PBX.

In a crazy moment in my sparse free time, I had a look at Gregor's PhoneMonitor application he's written in C# and decided to write a PHP5 based approach to connect to the PBX and handle calls. The result is a SOAP client library that is able to connect to a PBX, poll for events, register users and create calls between two endpoints.

He also includes an example of a request to the server, dialing another phone number based on the name of the person. There's also a screenshot of the application showing a portion of its interface.

He doesn't offer the code up for download yet, so don't get too excited. He does hint, though, at some future functionality he might be adding other features as well.

tagged: soap voip box connection phonemonitor port innovaphone ip800 soap voip box connection phonemonitor port innovaphone ip800

Link:

ThinkPHP Blog:
Real life SOAP - connecting your browser to a VoIP PBX
Jun 07, 2006 @ 10:53:55

Björn Schotte has a new post on the ThinkPHP blog today with details on a handy interface script, a port of this PhoneMonitor application, over to PHP5.

Here at Mayflower, we're using two Innovaphone IP800 gateways at each of our departments (Munich and Würzburg). They are connected to each other and replicate their data. Besides that, the Gateways do use LDAP for saving the contact data and provide a SOAP interface for connecting to the PBX.

In a crazy moment in my sparse free time, I had a look at Gregor's PhoneMonitor application he's written in C# and decided to write a PHP5 based approach to connect to the PBX and handle calls. The result is a SOAP client library that is able to connect to a PBX, poll for events, register users and create calls between two endpoints.

He also includes an example of a request to the server, dialing another phone number based on the name of the person. There's also a screenshot of the application showing a portion of its interface.

He doesn't offer the code up for download yet, so don't get too excited. He does hint, though, at some future functionality he might be adding other features as well.

tagged: soap voip box connection phonemonitor port innovaphone ip800 soap voip box connection phonemonitor port innovaphone ip800

Link:

Gentoo Blog:
Reminder - You *Can* Run PHP4 And PHP5 On The Same Box At The Same Time
Apr 21, 2006 @ 20:06:26

Stuart Hebert of the Gentoo blog has posted this new item as a reminder to all of those naysayers out there that didn't think it could be done that PHP4 and PHP5 can live together happily on the same box.

Today has served as a timely reminder to me that not everyone understands that it's perfectly possible to have both PHP4 and PHP5 installed in Apache at the same time. A lot of folks just stop when they learn that you can't load mod_php4 and mod_php5 at the same time into Apache. There's no solution in the excellent PHP Manual that I could spot this afternoon (maybe I've just missed it?), and a lot of folks just don't get any further along than that.

As an illustration of its possiblity, he points to this article from Andreas Korthaus showing how it's done under various different types of installs (Apache/CGI, Aapche/suphp).

tagged: multiple versions same box simultaneous cgi module suphp multiple versions same box simultaneous cgi module suphp

Link:


Trending Topics: