Lorna Mitchell: Generating a File List for Phan

Lorna Mitchell has shared a tip she’s found helpful when using the phan static analysis tool for finding only PHP files via a simple grep.

Phan is the PHP Analyzer for PHP 7 code. I’ve been using it, partly out of curiosity, and partly to look at what the implications of upgrading my various projects will be. […] I generated my filelist.txt files with a little help from grep – by looking for all files with opening PHP tags in, and putting that list of filenames into a file.

The phan tool is still pretty young but it provides a good example of how to use the new php-ast handling to parse and analyze PHP code.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Jordi Boggiano: PHP Versions Stats – 2015 Edition

It’s come to "that time of year" again and Jordi Boggiano has posted the latest update in his series of PHP usage statistics. In this summary he looks at the PHP versions installed based on the packagist.org logs for developers using Composer.

It’s that time of the year again, where I figure it’s time to update my yearly data on PHP version usage. Last year’s post showed 5.5 as the main winner and 5.3 declining rapidly. Let’s see what 2015 brought.

[…] A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. […] Composer sends the PHP version it is running with in its User-Agent header, so I can use that to see which PHP versions people are using Composer with. Of course this data set is probably biased towards development machines and CI servers and as such it should also be taken with a grain of salt.

He first compares the statics for his 2015 searches against the 2014 stats and shows the differences in usage for PHP versions 5.3.3 up to 5.6.0. Fortunately, the results show a rise in the usage of PHP 5.5 and a decline in all others…but it’s not too much of a difference (2-3% range). Pie graphs are also included to help visualize these differences. He also includes some statistics on what PHP versions are required by certain packages for the ones listed on Packagist with increases starting with 5.4 and the largest advance for 5.5.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

SitePoint PHP Blog: Sourcehunt PHP: Contribute to Crypto, Validation, Payments…

The SitePoint PHP blog has published the first edition of their "Sourcehunt" effort, sharing several PHP libraries to promote them and give them wider exposure to the community at large. In this post they talk about tools covering a wide range of functionality including cryptography, validation, user agent parsing and "humanizing" strings.

Last month, we introduced a new effort called Sourcehunt – a category of post intended to direct attention to less popular open source projects that show promise and need exposure. We’ve called for new submissions and accumulated an impressive list.

Included in their list for this edition are tools like:

…and many more. A summary of the features, code and output examples are provided for most of the tools mentioned and the number of GitHub stars at the time of the posting is listed next to each library name.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , , | Hinterlasse einen Kommentar

Matthieu Napoli: Approaching coding style rationally

In a post to his site Matthieu Napoli shares some of his thoughts about "code style rationality" including code formatting in general and some suggestions on one of the harder things in development – naming things.

Habits are sometimes making us blind. We think X looks prettier than Y but that’s just the habit speaking. In this article I’ll try to take a rational approach at coding style. That means leaving the “it looks ugly/better” at the door.

If at any point you feel like something “just doesn’t look good”, breath in, breath out, and try it! Nothing beats hands-on experience, not even some random article on the internet.

He looks at a few subjects specifically (there’s way too many to cover them all in detail):

  • the use of trailing commas
  • alignment of values in docblock comments
  • keeping docblock comments minimal
  • using the "Interface" suffix
  • using the "Exception" suffix

He ends the post by reminding readers that the point is to think about code style logically and that no rules are written in stone.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Alfred Nutile: Laravel Training: The Laravel Maven and the Laravel Novice

Alfred Nutile has posted information about a series of Laravel-related training videos that aim to help you go from "Laravel 0 to Deploy" as they walk you through the creation and deployment of a simple blog based on the Laravel framework features.

The two of us come together in this raw footage of building a Blog in Laravel. You get both the insights of an experienced Laravel Software Writer (Alfred Nutile) and the questions of a WordPress developer new to Laravel, (Joe Bacal)

As of the time of this post there’s four episodes in the series with more planned:

Other topics to come include working with Homestead, managing Gulp dependencies, creating a contact form and working with single page applications.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar

Thijs Feryn: Interviewing Gary Hockin from JetBrains (Dev Evangelism, travel, PHPStorm & PHP cons)

Thijs Feryn has posted his latest in his series of video interviews with members of the PHP community. In this latest episode he talks with Gary Hockin of JetBrains about developer evangelism, the PHPStorm IDE and community conferences.

A couple of weeks ago I was in Las Vegas for Zendcon where I had to opportunity to chat with a lot of friends from the PHP community. This week’s episode features Gary Hockin, developer evangelist at JetBrains. Gary advocates the PHPStorm project and is a proud Welshman.

Because Gary and I are both evangelists, one of the central themes of the interview is developer evangelism. We talk about the life, the travel, the public speaking, but also about the not so glamorous parts of the job. Throughout the conversation we also talk about PHPStorm and PHP community conferences.

You can watch the video either through his in-page video player or over on YouTube. If you prefer the audio-only route, you can also listen on SoundCloud. You can also check out previous interviews Thijs has done in this category on his site.


Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , , , , , , | Hinterlasse einen Kommentar

Community News: Recent posts from PHP Quickfix (11.04.2015)

Recent posts from the PHP Quickfix site:

  • Running LDAP tests on travis-ci
    #phpquickfix, #ldap, #test, #travisci, #unittest, #pear
  • Improving Your PHP Project Structure with Dependency Injection Part 1: How it Works? – PHP Dependency Injection Container package blog – PHP Classes
    #phpquickfix, #phpclasses, #dependency, #injection, #part1, #container
  • 10 less-known (but awesome!) Laravel Collections methods – Laravel Daily
    [object Object] #laravelquickfix, #collections, #methods, #top10, #awesome, #phpquickfix
  • Feral Concurrency Control: An Empirical Investigation of Modern Application Integrity | the morning paper
    #phpquickfix, #feral, #concurrency, #control, #application, #integrity
  • Changing Author Homepage URL Properly in WordPress | The Storyteller
    #phpquickfix, #wordpress, #author, #homepage, #url, #change
  • The Hitchhiker’s Guide to SQL Injection protection
    #phpquickfix, #sqlinjection, #sqli, #protection, #guide, #tutorial
  • PHP Package Checklist
    #phpquickfix, #package, #checklist, #development, #opensource
  • SymfonyCon Paris 2015 welcomes an additional track to its schedule! (Symfony Blog)
    #phpquickfix, #symfony, #somfonycon, #paris, #track
  • Running Symfony Applications with PHP-PM | Symfony Finland
    #phpquickfix, #symfony, #application, #phppm, #tutorial
  • Changing Apigility’s auth token expiry | Rob Allen’s DevNotes
    #phpquickfix, #apigility, #authentication, #token, #expire, #change
  • New in Symfony 2.8: Deprecated service definitions (Symfony Blog)
    #phpquickfix, #symfony2, #deprecated, #service, #definition, #feature
  • How to Securely Allow Users to Upload Files – Paragon Initiative Enterprises Blog
    #phpquickfix, #security, #file, #upload, #user, #tutorial, #websecquickfix
  • New Training: Symfony Forms Best Practices – webmozart.io
    #phpquickfix, #training, #symfony, #forms, #bestpractices
  • PHP 7 Nested Anonymous Classes Tutorial – PHP Classes blog – PHP Classes
    #phpquickfix, #phpclasses, #anonymous, #class, #php7, #nested
  • Container-Interop support for Prophiler > bitExpert AG
    #phpquickfix, #container, #interoperability, #support, #prophiler
  • How to examine the reports files for Magento | ESchrade – Kevin Schroeder’s Blog
    #phpquickfix, #magento, #report, #files, #examine


  • Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , , | Hinterlasse einen Kommentar

    Julien Pauli: Huge Page usage in PHP 7

    In this post to his site Julien Pauli looks at the concept of "huge pages" and how it relates to some of the behind the scenes work done in PHP 7 to improve memory usage.

    Memory paging is a way Operating Systems manage userland process memory. Each process memory access is virtual, and the OS together with the hardware MMU must translate that address into a physical address used to access the data in main memory (RAM).

    Paging memory is dividing memory in chunks of fixed size, called pages. […] Why use huge pages? The concept is easy. If we make the OS Kernel use bigger page sizes, that means that more data can be accessed into one single page. That also means that we’ll suffer from less TLB miss, once the page translation is stored into the TLB, because one translation will now be valid for more data.

    He briefly covers how some updated memory handling and opcode restructuring helps PHP 7 perform even better, especially when it comes to the OPCache handling. He talks about the changes made in the extension specifically to support the "huge pages" idea, complete with code examples (in C) of how this was accomplished.


    Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , | Hinterlasse einen Kommentar

    Ross Tuck: Formatting Exception Messages

    In a post to his site Ross Tuck shares some of his experience and some helpful hints around formatting exception messages and how doing so effectively can make life for fellow developers much easier.

    Over the last couple years, I’ve started putting my Exception messages inside static methods on custom exception classes. This is hardly a new trick, Doctrine’s been doing it for the better part of a decade. Still, many folks are surprised by it, so this article explains the how and why.

    He shares his tips as a part of a "refactoring" in a simple example, a CSV import where there are failures during the import process on certain lines. He starts with the basic Exception and works through the logic to customize it and make it more useful. He shows the inclusion of additional details in the message, abstracting out the formatting to custom methods based on the error type and using static methods for the more complex message formatting. He also suggests the creation of methods to handle specific error cases with more details than a simple single-line error in a normal exception being thrown.

    When you co-locate the messages inside the exception, however, you gain an overview of the error cases. If these cases multiply too fast or diverge significantly, it’s a strong smell to split the exception class and create a better API. […] Sometimes we underestimate the little things that shape our code. […] Creating good environments at a high level starts with encouraging them at the lowest levels. Pay attention to what your habits encourage you to do.


    Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , | Hinterlasse einen Kommentar

    QaFoo Blog: Analyze the Quality Of Your PHP Code

    QaFoo has posted an announcement to their blog about a new tool they’re offering to help developers better visualize the quality of their PHP code with a new visualization tool, the Quality Analyzer.

    In code reviews we often browse metrics, source code and reported code issues together with our customers. This leads to discussions about the current state of the code and possible improvements. First we used a bunch of shells scripts for that. In a second step we developed a simple PHP (Open Source) application helping us to do the job. Now we did the third step and rewrote that application into a React based client side (Open Source) application.

    They start with an overview of why they created the tool (an evolution of the older Code Review tool) and why it was split into a frontend/backend model to provide easier pipeline integration. They then introduce the functionality in the new tool, based on a D3.js interface. A few screenshots of the interface are also included to give you an idea of how it reports its findings and the dashboard providing an overview of the findings. You can try it out by grabbing it from the project’s GitHub repository.


    Veröffentlicht unter Allgemein | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar