News Feed
Sections




News Archive
feed this:

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

ClanCats Station:
Writing a webserver in pure PHP - Tutorial
March 26, 2015 @ 11:27:42

On the Clancats.com blog there's a recent post showing how to create a web server in pure PHP, an interesting experiment but definitely not recommended for any kind of higher load situation.

Well, this is pretty useless, but it is possible. But again its pretty.. uesless. This tutorial will hopefully help you to better understand how a simple webserver could work and that it's no problem writing one in PHP. But again using this in production would be trying to eat a soup with a fork. So just, .... just don't. Let me shortly explain why this is not a that good idea.

PHP is a scripting language that simply is not really designed for such tasks. A webserver is a long running process which PHP is not made for. Also PHP does not natively support threading ( pthreads ), which will make developing a good performing webserver a really hard task.

He walks you through all the code needed to create the web server (also available on GitHub) by making:

  • A "server" that does the listening for incoming and sends outgoing requests
  • A request object that parses the incoming request and makes header and body content available
  • A response object that allows for the setting of response codes, body content and headers
  • Exception handling for problems encountered during the request/response process

The full code is provided during the process along with explanations of what each part does. There's also a basic introduction to what a typical web server is and how the process of request/response usually flows.

0 comments voice your opinion now!
webserver tutorial version request response server

Link: http://station.clancats.com/writing-a-webserver-in-pure-php

Derick Rethans:
Xdebug 2.3 Improvements to Debugging
March 25, 2015 @ 09:13:34

In the latest in his series covering some of the improvements in the latest Xdebug release, Derick Rethans has posted this new article detailing some of the performance enhancements related to remote debugging that come with this new version.

This is the fourth article in a series about new features in Xdebug 2.3, which was first released on February 22nd. In this article we are looking at the improvements towards "remote" debugging.

The updates include showing the values of user-defined constants, being able to set an exception breakpoint on all exceptions and additional features around debugging the exceptions themselves. The output now includes the exception's error code and which exception the flow was broken on (though in his example of PHPStorm, the IDE won't report that information back). The last change he mentions is a change that reverts the output to a log if it can't write to a socket (usually SELinux related).

0 comments voice your opinion now!
xdebug performance improvement remote debugging version release

Link: http://derickrethans.nl/xdebug-2.3-debugging-improvements.html

PHP.net:
Release of PHP 5.6.7, 5.5.23 and 5.4.39
March 20, 2015 @ 10:45:27

The PHP development group has announced the release of the latest versions in all three major versions of PHP currently supported: PHP 5.6.7, 5.5.23 and 5.4.39. These releases are bugfix only with several security updates included.

The PHP development team announces the immediate availability of [these new versions]. Several bugs have been fixed as well as CVE-2015-0231, CVE-2015-2305 and CVE-2015-2331. All PHP [5.6, 5.5 and 5.4] users are encouraged to upgrade to this version.

As always, you can get the latest released for each of these versions from the main downloads page (for Windows users on windows.php.net) and if you'd like to see the other changes besides the security-related fixes check out the full Changelog.

0 comments voice your opinion now!
version release language php54 php55 php56 security bugfix

Link: http://php.net/index.php#id2015-03-20-2

Freek Lijten:
Testing and improving PHP extensions for PHP 7
March 13, 2015 @ 10:02:47

In his latest post Freek Lijten talks about PHP extensions, the upcoming PHP version - well, PHP7 - and the things that can be (and are being) done to help improve and prepare the extension ecosystem. In his post he walks you through the process of getting a PHP7 install set up, a sample extension set up and writing some tests to help improve it.

PHP7 is coming. And it is coming to a neighbourhood near you :) A couple of people started an initiative to ensure extensions will be running out of the box once PHP7 hits the shelves. The fun part: You can help too! No C knowledge is necessary (although it is fun to dive into PHP's internals!). This piece is a short intro to help you help PHP! Help triaging extensions, write tests, add documentation and who knows when you'll be diving into C code.

He's encouraging this work as a part of the recently launched GoPHP7 - Extensions initiative launched a while back. He starts by helping you get PHP7 installed (from source, compiled). Once that's installed and working, he helps you get an extension up and running, in this case the enchant extension. He shows you how to run the tests for the extension and how to write some tests to contribute back to the project. He includes instructions for generating code coverage reports, walks you through some sample code and a link to a page with more information if you get stuck.

0 comments voice your opinion now!
testing improving extension php7 version phpt unittest coverage gophp7

Link: http://www.freeklijten.nl/home/2015/03/12/Testing-and-improving-PHP-extensions-for-PHP-7

Coen Jacobs:
Updating PHP is everyone's responsibility
March 11, 2015 @ 10:06:46

In his latest post Coen Jacons suggests that updating PHP is everyone's responsibility - that keeping the PHP installation on your systems up to date is important for everyone, not just the system administrators.

The number one remark I heard when I launched WPupdatePHP, is that users shouldn't be bothered with this. In an ideal world, this is true, but in reality this isn't going to stand for long. [...] I know the WordPress core team is working really hard to get webhosting companies to update their PHP versions and I agree up to a certain level that this is the best way. It's not the only way though. [...] This will help lower the percentage of PHP 5.2 and 5.3 users out there. There still will be people on older PHP versions who are caught out and without them knowing what is going on, nothing will change for them.

He talks about the efforts the WordPress core team is doing to try to convince hosting providers to update, but points out that while WordPress aims to run on those old versions, staying on them is a mistake. He also mentions that an effort like this is a constant thing, always changing as the PHP versions released change. He ends the post with a "call to arms" for users out there, encouraging them to get talking to their hosting provider and get those PHP versions updated.

Don't understand me wrong, I like what WordPress is doing to get these requirements bumped, but I think it's not enough. I disagree on the fact that users shouldn't be involved in this. It's easy enough for users to request their hosting platform to be upgraded. If their request isn't heard, they should find a better webhosting company. [...] It's been long enough, I choose to act now.
0 comments voice your opinion now!
update version responsibility opinion hosting company wordpress

Link: http://coenjacobs.me/updating-php-everyones-responsibility/

SitePoint Web Blog:
On Our Radar PHP 7 Controversy and Dependency Injection
February 17, 2015 @ 09:08:39

The SitePoint Web blog has a recent post with two things that are on the radar when it comes to PHP - the upcoming PHP version and the practice of dependency injection.

To change things up a bit, we're going to start bringing to you items and information from those discussions that have caught our attention. Sometimes these discussions will be useful and interesting, and sometimes they may be challenging or insightful. Either way, they're likely to bring new information to light that you haven't come across before, and will help to provide insight and perspective on topics you're interested in.

He starts with an overview of the controversy surrounding PHP 7 including its name, feature removal and links to some responses to the proposed changes. The second topic, dependency injection, how it might be evil and some of the opinions that have been expressed around it.

0 comments voice your opinion now!
php7 controversy dependency injection di version

Link: http://www.sitepoint.com/radar-php-7-controversy-dependency-injection-troubles/

NetTuts.com:
What's New in Laravel 5
February 13, 2015 @ 10:24:47

The NetTuts.com site has a new post today sharing some of what's new in Laravel 5, the latest release of the popular PHP framework. Version 5 was announced back on February 5th.

The PHP community has recently been blessed with a new release of one of its most loved frameworks, Laravel. Version 5.0.1 is a major release, so not only are there some great new features available, but the architectural foundations of the framework have also been altered to some extent. So, without any further ado, I am going to dive right into the framework and show you all the good things the latest release has to offer.

He touches on a few of the main differences between version 5 and the previous versions including:

  • Differences in directory structure
  • How method injection is handled
  • The use of contracts (interfaces)
  • Route caching and middleware
  • Authentication changes
  • Events and commands

There's more on his list, each with a description and sometimes a bit of code to help explain the changes. Check out the full post for the remainder of the list and details on those listed above.

0 comments voice your opinion now!
laravel5 framework version whatsnew update upgrade list

Link: http://code.tutsplus.com/tutorials/whats-new-in-laravel-5--cms-21842

thePHP.cc:
PHPUnit 4.5 and Prophecy
February 06, 2015 @ 13:56:21

On thePHP.cc blog today Sebastian Bergmann has posted about the new release of PHPUnit (4.5) and how it now comes with support for the Prophecy mocking tool.

PHPUnit has had built-in support for creating test doubles for many years. This implementation was originally inspired by the first generation of mocking frameworks for Java. Since then mocking frameworks have evolved. Modern mocking frameworks are more intuitive to use, lead to more readable code, and may even allow for a clear separation of a test double's configuration and the actual test double object itself.

Like many users of PHPUnit I am not satisfied with the API of PHPUnit's own mocking framework. This dissatisfaction has lead to the development of alternative mocking frameworks for PHP such as Mockery, Phake, or Prophecy. If I were to create a new mocking framework today it would probably look a lot like Prophecy. Which is why PHPUnit 4.5 introduced out-of-the-box support for it.

He gets into some of the basics of the Prophecy tool and how it handles mocking differently than the current internal mocking PHPUnit provides. Some code examples are included showing dummies, stubs and mocks with an example of the output when some of the "predictions" have failed.

0 comments voice your opinion now!
phpunit version upgrade prophecy mock dummy stub framework

Link: http://thephp.cc/news/2015/02/phpunit-4-5-and-prophecy

Community News:
Laravel 5 Released
February 04, 2015 @ 11:16:24

According to this new post on the Laravel News site the latest major version of the Laravel framework has been released - Laravel 5.

Several new features come in this release including:

  • A new, more granular directory structure
  • Changes to the Blade templating library
  • The introduction of Contracts for core services
  • Commands & Events
  • Routing updates
  • Controller method injection

...and plenty more. You can find out about all of these new features (along with some code examples) in this release announcement on the Laravel News site.

0 comments voice your opinion now!
laravel framework laravel5 release version announcement

Link: https://laravel-news.com/2015/01/laravel-5/

Liip Blog:
New Relic extension for HHVM updated to latest version
January 20, 2015 @ 10:04:14

In his latest post to the Liip blog Christian Stocker points out that the New Relic extension for HHVM has been updated for the latest versions of HHVM to work a bit more seamlessly.

Since HHVM 3.4 it's theoretically possible to have your own external profiler for function level profiling (like xhprof or xdebug) without having to recompile HHVM itself. Unfortunately it wasn't perfect (or I couldn't make it running), but there's a patch in the master branch now (the upcoming 3.6), which seems to solve that problem. So I worked a little bit on my extension in the last few days and I adjusted a lot of things and improved some other stuff.

He talks about the improvements New Relic has made on their functionality and some slowness that still exists in the "hotprofiler". He points out, however, that if you just want overall statistics and not specific, method level ones, you don't really even need to use it. He offers a word of caution when using his extension and when it may fall back to "userland level profiling" instead.

0 comments voice your opinion now!
liip hhvm newrelic extension update version release

Link: http://blog.liip.ch/archive/2015/01/19/new-relic-extension-for-hhvm-updated-to-latest-version.html


Community Events

Don't see your event here?
Let us know!


laravel video unittest library example introduction language voicesoftheelephpant version interview release security opinion community podcast framework laravel5 api series php7

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework