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

Oscar Merida:
Creating ZIP files and streaming the response with Silex
Jan 19, 2018 @ 17:28:44

On his site Oscar Merida has shared a post showing how to create a ZIP file and stream the response in a Silex-based application using the DOMPDF library and PHP's ZipArchive functionality.

Creating a zip file is easy and Rob Allen has you covered on that front to get you started. I needed to do this to create a zip file of PDF files generated by Dompdf. It turns out, you can add files to a ZipArchive object without actually creating the file if you can get the contents as a string.

The post includes the code to create the DOMPDF instance, load the HTML and render the result. From there the ZipArchive takes over and creates the archive from the PDF result. Finally the code takes the ZIP archive as input and pushes it out with a custom header to tell the browser to download it and streams back the raw ZIP contents.

tagged: tutorial silex dompdf pdf zip archive silex stream download

Link: http://oscarm.org/2018/01/stream-a-zip-file-via-silex/

PHP.net:
PHP 7.1.10 Release Announcement
Sep 29, 2017 @ 15:47:02

On the PHP.net site there's an announcement about the release of the latest version in the PHP 7.1.x series: PHP 7.1.10.

The PHP development team announces the immediate availability of PHP 7.1.10. This is a bugfix release, with several bug fixes included. All PHP 7.1 users are encouraged to upgrade to this version.

Changes in this release includes updates to the CLI server, cURL handling, gettext functionality and internationalization. As always you can get the latest release from the main downloads page or from windows.php.net for the Windows binaries.

tagged: download changelog bugfix release php71 language

Link: http://php.net/index.php#id2017-09-29-1

Symfony Blog:
The Symfony Unicorn: 1 Billion Downloads
Sep 12, 2017 @ 17:55:32

On the Symfony blog they talk about a major milestone the framework has reached: one billion downloads of the components that make up the Symfony framework.

A Symfony unicorn!!? It's real! On September 5th, the Symfony Components crossed a huge landmark: the 1 billionth download! This happened less than one year after the last milestone: 500 million downloads. That's right: the PHP community downloaded the Symfony components more than 500 million times in just one year. That's well over 1 million downloads every day!

There are so many people that have made this possible, and we would like to thank all of you who have supported Symfony: developers, contributors, companies, evangelists and - of course - users! There are now over 80 Symfony packages and 1,500 people have contributed code to these. None of this is possible without your help. Congrats!

The post then talks about the current state of the components (including their download numbers), their backwards compatibility promise and how it relates to the upcoming Symfony 4 release.

tagged: symfony component billion download achievement framework

Link: http://symfony.com/blog/the-symfony-unicorn-1-billion-downloads

PHP.net:
PHP 7.2.0 Alpha 2 Released
Jun 22, 2017 @ 14:12:12

The PHP.net site has announce the latest alpha release for the upcoming PHP 7.2.0 release: PHP 7.2.0 Alpha 2:

The PHP development team announces the immediate availability of PHP 7.2.0 Alpha 2. This release contains fixes and improvements relative to Alpha 1. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

[...] For information on new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive.

As these are just development releases, the downloads for them are on the QA sites: source packages and Windows binaries. The final alpha for PHP 7.2.0 (third) will be published July 6th. Next comes the beta stage then Release Candidates. You can see the full release schedule plan here.

tagged: language alpha release php72 download

Link: http://php.net/index.php#id2017-06-22-1

Weebly Engineering Blog:
Streamed File Zipping and Downloading in PHP
Feb 06, 2017 @ 17:24:01

The Weebly Engineering blog has a new tutorial posted about streamed file zipping and downloading in a PHP based application. This allows the download to start even while the file is being compressed into a zip archive on the backend.

Did you notice that on Dropbox.com, you can select a folder and start downloading it while it’s being zipped? This on-the-fly zipping feature comes handy for both the user and the server?—?as a user you don’t have to wait until the files are zipped on the back end before the downloading starts, and it saves the server from creating a temporary zip file and deleting it afterwards.

[...] To implement this feature with PHP, we handle the zipping and streaming work on the back end using ZipStream. Assuming your files are on the server and can be loaded with file_get_contents given a path.

They include some of the details of the HTTP request format for the stream (as an attachment type) and how you can use the ZipStream package to quickly implement it into your code. They include a simple example of implementing it in a form, allowing the user to easily integrate it and work around some of the browser based security controls.

tagged: stream zip archive download tutorial zipstream tutorial

Link: https://medium.com/weebly-engineering/streamed-file-zipping-and-downloading-in-php-1fb59b0a5b79#.jop61kzc6

TutsPlus.com:
Programming With Yii2: Using Amazon S3
Dec 08, 2016 @ 17:27:16

The TutsPlus.com site has continued their series of posts in the "Programming with Yii2" series with this new tutorial covering the use of the Amazon S3 service for sorting files remotely in your application.

In today's tutorial, I'll walk you through the basics of browsing, uploading and downloading files to and from Amazon's cloud-based S3 storage service. Essentially, I've created a simple storage model and controller as examples which you can extend for your needs.

He starts with a brief introduction to the S3 service (including a video from Amazon themselves) and what kinds of things it could be used for. He helps you get started via the AWS web GUI, creating an S3 "bucket" and viewing their contents. He shows how to get the credentials you'll need to connect to the bucket and defining them in the ini configuration file. The tutorial then shows how to use this AWS extension for Yii2 to connect to and work with the S3 bucket you've created. This includes browsing the content, uploading new files and downloading current ones.

tagged: yii2 framework series amazon s3 file storage download upload tutorial

Link: https://code.tutsplus.com/tutorials/programming-with-yii2-using-amazon-s3--cms-26347

PHP.net:
PHP 5.6.28 Released
Nov 14, 2016 @ 18:12:58

The PHP.net site has posted the official announcement about the latest release in the PHP 5.6.x series: PHP 5.6.28:

The PHP development team announces the immediate availability of PHP 5.6.28. This is a security release. Several security bugs were fixed in this release. All PHP 5.6 users are encouraged to upgrade to this version.

Fixes included in this release relate to:

  • core language functionality
  • GD image manipulation
  • fixing an overflow in the IMAP functionality
  • a SQLite issue fetching an integer as a string

As always, you can get this latest release from either the main downloads page (for source packages) or windows.php.net for the Windows binaries. As a reminder, the active support for the PHP 5.6.x series will be ending at the end of 2016 (December 31st) so there's never been a better time to upgrade to PHP 7.

tagged: language release php56 security update download

Link: http://php.net/index.php#id2016-11-10-3

Master Zend Framework:
The 3-Step Guide to Downloading Files in Zend Expressive
Aug 29, 2016 @ 15:37:44

On the Master Zend Framework site there's a tutorial posted showing you how to set up file download functionality in a Zend Expressive-based application.

A common requirement of web-based applications is to upload and download files. But, out of the box, there’s no simple way to download them in Zend Expressive. This tutorial shows you how - step-by-step.

Recently, I was asked on Twitter by @dgoosens, about how to download files using Zend Expressive. The timing was pretty good, as I’d done a simple implementation in a recent Zend Expressive project. So I knocked up a quick example and he, @acelayaa, and I talked it over, making various changes and suggestions along the way.

So, In today’s tutorial, I’m going to walk through a 3-step process for downloading files when using Zend Expressive.

He breaks the process down into three parts:

    1. The Download Functionality
    1. Using the Download Method
    1. Running the Application & Downloading the File

He includes code or commands for each step, showing you exactly how to set up this simple piece of functionality. Additionally it's implemented as a (mostly) self-contained method using the Stream handler to set the required headers and body.

tagged: zendframework zendexpressive file download tutorial stream

Link: http://www.masterzendframework.com/downloading-files-in-zend-expressive/?platform=hootsuite

PHP.net:
PHP 5.6.20 & 5.5.34 Released
Apr 01, 2016 @ 14:22:01

The main PHP.net site has officially announced the release of the latest versions in the PHP 5.5.x and 5.6.x series: PHP 5.6.20 and PHP 5.5.34.

The PHP development team announces the immediate availability of PHP [5.6.20 and 5.5.34]. This is a security release. Several security bugs were fixed in this release. All PHP [5.6 and 5.5] users are encouraged to upgrade to this version.

These releases fix issues in several parts of the language including Curl handing, Fileinfo, Mbstring and ODBC. You can get these latest versions from the main downloads page or windows.php.net for the Windows binaries.

tagged: language release php56 php55 bugfix security update download

Link: http://php.net/archive/2016.php#id2016-03-31-4

PHP.net:
PHP 7.0.2 Released
Jan 07, 2016 @ 15:30:21

The PHP project has officially released the latest in the PHP 7.0.x series of releases: PHP 7.0.2:

The PHP development team announces the immediate availability of PHP 7.0.2. 31 reported bugs has been fixed, including 6 security related issues. All PHP 7.0 users are encouraged to upgrade to this version.

There's quite a few bugs fixed in this release including updates in:

  • CURL
  • Filter
  • FTP
  • GD
  • Opcache
  • Session
  • SPL

As always you can download this release from the main download page or the Windows binaries from the windows.php.net site.

tagged: language release php7 minor bugfix download

Link: http://php.net/archive/2015.php#id2016-01-07-1


Trending Topics: