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

Displaying stream progress in PHP
May 27, 2015 @ 08:39:26

Hannes Van De Vreken has posted a tutorial to his site showing users of the Symfony Console component how to show progress on a stream using the ProgressBar helper and a bit of code to inspect the stream itself.

With PHP you can, next to handling HTTP requests, invoke scripts from the command line. [...] The Symfony console component is a very useful tool to define and invoke these kind of CLI tasks. [...] What is actually printed on the console is very important for the issuer of the task. Think of it as the command’s usability. Too little runtime information, the less usable the task. [...] Enter the ProgressBar. The ProgressBar is an output helper that wraps the OutputInterface object.

He talks briefly about how the ProgressBar helper works in the console component's output and gives a simple example of the output. He then shows how to hook it into a bit of PHP using the stream_notification_callback optional parameter (defined in stream_context_create) to point to another class method that handles the progress bar updates. It performs a bit of introspection on the stream and updates the progress as its contents progress. He does point out a few caveats though, including that the transfer is not made asynchronous by this handling.

tagged: symfony console stream progress progressbar helper tutorial

Link: https://hannesvdvreken.com/2015/05/12/stream-progress/

Zend:
Apigility Progress report: zf-mvc-auth, packagist, and PHP's built-in web server
Nov 01, 2013 @ 15:52:11

In a new post to the Apigility forums today Matthew Weier O'Phinney has announced the release of an authentication/authorization component for the recently announced project from Zend. Apigility is a Zend Framework-based tool for easily constructing and managing an API.

We've been working hard on Apigility since ZendCon, and have released some more code into the wild. zf-mvc-auth exists to provide both authentication and authorization for your APIs; in fact, it's a bit of a general-purpose library for ZF2 MVC apps! Right now, we support HTTP basic and digest authentication out of the box, and will be working next on OAuth support. Authorization is done by default via ZendPermissionsAcl, as we discovered a problem with using RBAC: RBAC is deny-by-default, which does not work when you want an open-by-default schema. You may opt-in to deny-by-default, as well as mark individual services as requiring permission by default. Finally, you have the option of denying/allowing per HTTP method of a service as well.

You can find out more details about this functionality in this quick screencast. The zf-apgility module depends on this new zf-mvc-auth module, so it will be included and available by default in your APIs. In that same post Matthew also talks about the listing of the Apigility packages on Packagist service and a note for those wanting to use the built-in HTTP server to run the tool (a PHP version dependency).

tagged: apigility progress zendframework mvc authentication authorization packagist http server

Link: https://groups.google.com/a/zend.com/forum/#!topic/apigility-users/_mOPkxxmGYI

PHPMaster.com:
Tracking Upload Progress with PHP and JavaScript
Feb 06, 2012 @ 13:58:32

In a new tutorial today from PHPMaster.com, they show you how to combine Javascript and a PHP feature to track the progress of an upload to your web application.

A problem that has plagued web developers for years is how to add real-time information to their applications, such as a progress bar for file uploads. [...] JavaScript can access a file’s name, type, and even the width and height of a local image, but it wasn’t until HTML5 that it could access a file’s size. [...] In this article I’ll show you how [the session.upload_progress] feature can be used to create a simple upload progress bar without any external libraries or browser dependencies.

The tutorial provides all the steps you'll need to get it working - defining the form with the extra required field, styling it and plugging the Javascript in to call a small script to get the progress of the upload. It returns the difference between the content-length of the file and the current size (as a percentage of 100).

tagged: track upload progress extension javascript tutorial progressbar

Link:

CodeIgniter.com:
Amazing Progress Report & Addition of IRC to CodeIgniter.com
Sep 02, 2011 @ 08:48:17

On CodeIgniter.com there's a new post updating the community on more of the current happenings surrounding the project including the status of their move to github and another source for developers to find the CI help they need.

In less than two weeks since the announcement was made at CICON that CodeIgniter was moving to GitHub, we’ve seen some incredible results from the change. Already CodeIgniter is the 10th most watched PHP project at GitHub (currently 758), with 42 open pull requests, 53 merged pull requests, 170 forks, and 41 individual contributors. Incredible!

[...] We also noticed what seemed to be a spike in activity on the #CodeIgniter Freenode IRC channel, so we’ve decided to make it more prominent to encourage its continued use. You’ll now notice an IRC tab in the main navigation, letting you access the #CodeIgniter IRC channel right here at CodeIgniter.com.

If you want more details on why they made the switch over to git, check out this blog entry from the EllisLab site for an explanation from Derek Jones

tagged: progress report codeigniter framework irc support github

Link:

DZone.com:
PHP 5.4 features poll: the results
Aug 03, 2011 @ 08:19:43

On DZone.com today Giorgio Sironi has posted the results of a poll taken a little while back concerning what people thought was the best feature of the upcoming PHP 5.4 release.

After two weeks, we have closed the poll among the PHP community of Web Builder Zone to establish which are the most wanted features, which will influence development of applications on PHP 5.4. Hopefully this poll would also shape our focus in tutorials in the future - I personally plan to dedicate more time to the winning features.

Runners up included the removal of magic quotes and strict mode with the top three being (in this order) the upload progress patch, traits and the array improvements leading the pack. You can see the results here.

tagged: poll results traits upload progress array improvement

Link:

Brian Swan's Blog:
SQL Server JumpIn! Camp Wrap Up
Jun 27, 2011 @ 12:28:18

Brian Swan (of Microsoft) has posted his wrapup of the recent Jump In! Camp they held around integration of SQL Server functionality into several popular PHP projects like the Zend Framework and PEAR.

During each day of the camp, PHP developers worked side-by-side with Microsoft developers to add SQL Server and SQL Azure support to their projects, but nearly everyone put in many extra hours late at night (and even early morning!) to add support for other Microsoft technologies (such as IIS, Web Platform Installer, and Windows Azure).

He includes some pictures taken of the progress board for the various projects and the wishlist that developers in attendance requested of the Microsoft team.

I can’t say thanks enough to all the participants for being 100% invested in the camp and for going the extra mile to investigate how their projects might be able to integrate Microsoft technologies beyond SQL Server and SQL Azure. I know that the entire SQL Server team echoes my thanks.
tagged: sqlserver jumpincamp wraup progress request project

Link:

Johannes Schluter's Blog:
Upload Progress in PHP trunk
Dec 06, 2010 @ 10:30:58

Johannes Schluter has a new post to his blog looking at the progress that the upload progress meter extension has been making and how a version of it, put together by Arnaud Le Blanc has been introduced to the trunk line of PHP's code.

For implementing this we have one architectural problem: PHP implements, for very good reasons, a shared nothing architecture. So one request from connection has no insight into another request/connection - but this is needed for the upload progress. [...] The obvious solution, of course, would be to use PHP's session handling system for this. [...] Now there were some technical issues why this wasn't done at first ... but then Arnaud Le Blanc sat down and created a proper implementation of an upload progress storage handler which has been commit to PHP trunk. Long story short: In the next version of PHP (5.4?) you will, most likely, have an Upload Progress mechanism built-in.

If you want all of the details on it, you can check out the RFC on it. Johannes shows a sample of the settings and code that, once the next release of PHP comes out, you can use to enable the extension and be able to poll the session for the progress details.

tagged: file upload extension trunk sessions progress

Link:

Christian Stocker's Blog:
Upload Progress Meter - Common issues and some answers
Mar 31, 2009 @ 09:31:49

On the Liip blog today Christian Stocker has posted about a few common issues developers seem to have with the upload progress meter extension and a few answers to help them out.

After I released uploadprogress 1.0.0 some days ago and finally declared it as stable, it's time to write that blogpost about some of the limitations and caveats one has to know.

The post links to a demo and answers a few different questions on issues such as:

  • Running it on other modules than mod_php on Apache ( like fastcgi)
  • Checking if files are too big
  • The position and content of UPLOAD_IDENTIFIER within the form is important
  • Why not use $_SESSION for the info?
  • It segfaults, when I don't include UPLOAD_IDENTIFIER

See the PECL page for the extension for more information.

tagged: upload progress meter pecl question answer common issue demo

Link:

Christian Stocker's Blog:
Upload Progress Meter for Windows - The next take
Mar 13, 2009 @ 09:38:35

Christian Stocker has posted about "the next take" on the PHP upload progress meter extension - a new version that plays a bit nicer on Windows than before.

The uploadprogress extension for PHP never really worked on Windows and since I don't have a Windows development environment I could never do a proper analysis of the problem. Until this week, when Tomas Holusa sent me an email telling me about some VCWD_RENAME problems on Windows.

A patch that was submitted a while back confirmed the issue and a new patch was written and submitted to take care of the problem. You can try out the new extension on Windows with either the normal Wind32 build or Win32 nts build.

tagged: upload progress meter windows patch vcwdrename fail extension

Link:

Christian Stocker's Blog:
Upload Progress Meter extension 0.9.2 released
Jan 22, 2009 @ 09:36:38

Christian Stocker has released the latest version of the uploadprogress extension to the PECL repository (0.9.2). The package allows the code to track the progress of an upload automatically.

The main new function since 0.9.1 is uploadprogress_get_contents($id), which allows you to analyse the content of an uploading file during the upload and do appropriate measure (for example warn the user, that he doesn't upload a supported video format). You have to enable this feature in php.ini to make it work. This feature was provided by Ben Ramsey, so you have to poke him, if something's wrong with it.

A simple example of it in action is also included (in the /examples subdirectory off of the PECL page) showing how to upload a file, get the progress and - most importantly - how to get useful error messages out of it.

tagged: upload progress pecl extension example contents analyze

Link: