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

Stefan Koopmanschap:
WeCamp Wrap-up (Days 1 - 5)
Sep 01, 2015 @ 12:37:21

For those that couldn't attend this year's WeCamp conference but wanted to get an idea of what it was like, I'd suggest checking out Stefan Koopmanschap's five part series if his experiences there. This year he participated as a coach rather than just an attendee so his perspective changed a bit.

He's posted summaries from each day of the event, chronicling their journey from a group of unknowns to a cohesive team with a finished project by the end of the event:

The WeCamp "conference" is more of a large hackathon where teams are camping on an island for the duration. They form random teams the first day and come up with a product idea to take to fruition over the course of a few days. If you're interested in the event and want to learn more about future plans, be sure to check out the main conference site.

tagged: wecamp15 conference event coach stefankoopmanschap

Link: http://leftontheweb.com/blog/categories/wecamp15/

SitePoint PHP Blog:
Writing PHP Git Hooks with Static Review
Sep 01, 2015 @ 11:16:01

On the SitePoint PHP blog Matthew Setter introduces the use of git hooks to help with automatic static analysis of your application's code, integrating it directly into your current workflow. He shows how to use this library to make creating and installing them as easy as a single command (and they're written in PHP).

If you’ve been using Git for more than a short length of time, you’ll hopefully have heard of Git hooks. [...] There are hooks for pre- and post-commit, pre- and post-update, pre-push, pre-rebase, and so on. The sample hooks are written in Bash, one of the Linux shell languages. But they can be written in almost any language you’re comfortable or proficient with. [...] Thanks to Static Review, by Samuel Parkinson, you can now write Git hooks with native PHP, optionally building on the existing core classes. In today’s post, I’m going to give you a tour of what’s on offer, finishing up by writing a custom class to check for any lingering calls to var_dump().

He walks you through the installation of the library and helps you create a simple working example that ensures you've correctly set up your (Composer) dependencies. He explains a bit about what's involved in the StaticReview package and the three "introspection" objects initialized for each run. He ends the post by walking you through the creation of a custom, more real-world check that evaluates your code (via a simple grep) to ensure no var_dump statements were left in.

tagged: static review git hook analysis tutorial

Link: http://www.sitepoint.com/writing-php-git-hooks-with-static-review/

Community News:
Laravel 5 Now Includes Authorization
Sep 01, 2015 @ 10:50:41

In the latest release of the Laravel framework (v5.1.1) they've introduced authorization handling to the native framework. This allows you to integrate permissions checks and perform policy validation both on the backend and in the templates.

In addition to providing authentication services out of the box, Laravel also provides a simple way to organize authorization logic and control access to resources. There are a variety of methods and helpers to assist you in organizing your authorization logic.

The functionality includes the concepts of "abilities" (permissions, essentially) and validate the allow/deny status based on object properties, such as Users. The documentation shows how to perform the evaluations in the controllers, user model, form requests and even in the Blade templates. There's also a section on creating policies for more complex evaluations than just one-off permission checks.

To get a feel for what the community things of this new functionality, be sure to check out this Reddit thread with feedback, both positive and negative, on how it was implemented.

tagged: laravel framework authorization functionality permission policy allow deny

Link: http://laravel.com/docs/5.1/authorization

7PHP.com:
Pacific Northwest PHP Conference | Sneak Glance At The Pre-Event!
Sep 01, 2015 @ 09:09:17

In another in their series of interviews about people and things happening in the PHP community, the 7php.com site has posted a sneak peak of the Pacific Northwest PHP Conference and interviews one of the organizers, Jeremy Lindblom.

Khayrattee Wasseem talks with Jeremy about some of his work with the Seattle PHP User Group and where he'll be working in the near future (the Engrade team at McGraw-Hill Education). He also answers questions about:

  • What the conference is about and when it was first launched
  • Where the idea came from and what some of the objectives are
  • How the feedback has been so far
  • Who else has been on the team helping organize the event (and provided advice)
  • How they're handing sponsors and what challenges came around that

Jeremy also shares a message to thinking about attending the conference:

I honestly believe that everyone who attends, both in person and online is going to have a good experience, learn new things, and make new friends. My hope is that you will feel the strength of the PHP community and have a desire to contribute back to it afterwards.
tagged: 7php interview jeremylindblom pnwphp15 pacific northwest conference

Link: http://7php.com/pre-pnwphp-2015/

Community News:
Latest PECL Releases (09.01.2015)
Sep 01, 2015 @ 08:01:42

Latest PECL Releases:

  • swoole 1.7.19
    - Added swoole_atomic module, support for atomic integer operations

    • Fixed timer in the system can not recover after the resumption of the operation
    • Fixed ssl_server cannot send more than 30K large packages in a slow network
    • Added supports for UDP/UDP6/UNIX_DGRAM big packages(64K)
    • Fixed addtimer/tick timer can't be used in BASE mode
    • Added addProcess in SWOOLE_BASE mode
    • Fixed SWOOLE_KEEP core dump
  • msgpack 0.5.7
    - Add support deserializing the bin format family - Implement Issue #49, implement the 'compatibility mode' mentioned in msgpack implementation guidelines
  • WinCache 1.3.7.7
    1.3.7.7: - Fix crash when user/session cache encounters error during creation. - Fix error if session fails during creation and using SessionHandler class - Bug Fix: Add space for null terminator for PHP 5.4 and above. - Bug Fix: Don't copy the key name in zvcache if there isn't a key name. - Fixed metrics on shared memory segments - Add ETW tracing - Convert init event to a mutex (improve stability if something gets killed while holding the event) - Bug 69609: rmdir/unlink function reroutes do not clear resolve path cache
  • WinCache 2.0.0.0
    2.0.0.0: - PHP7 Support - x64 Support - Remove opcode cache support - Remove custom SRW locking - Remove unused settings - Enforce NTS-only build - Comment clean up - Minor bug fixes and tweaks
  • v8js 0.2.3
    - Fix FLAG_FORCE_ARRAY affecting V8Function objects - Fix memory leak with repeated calls of methods on exported PHP objects
  • v8js 0.2.2
    - Fix CommonJS module caching - Fix use-after-free issue on CommonJS module reuse - Fix memory leaks in CommonJS module loader - Fix memory leak regarding lost script resources (compileScript call et al) - Improve V8Function call performance
  • mongo 1.6.11
    ** Bug * [PHP-1467] - PHP driver on big endian platform not connecting to MongoDB
tagged:

Link:

Edd Mann:
Developing a Resizable-Indexed Array as a PHP Extension with Joe Watkins
Aug 31, 2015 @ 12:43:11

Edd Mann has a post to his site sharing a new screencast about developing PHP extensions by Joe Watkins, specifically about using a resizable-indexed array.

Following on from our first screencast, which touched upon how to setup a PHP extension development environment and creating a simple ‘array_sum’ like function. We now further this topic by implementing a resizable-indexed array class which supplies very similar functionality to that of the SplFixedArray class. Throughout this discussion we look into creating a custom Zend object class, using this to invoke an implemented data-structure located in another file, implementing internal interfaces, object handlers and the importance of PHP extension tests.

You can watch the video either through the in-page video player or directly on YouTube if you'd like a bit more control over the sizing. You can find the resulting code for the extension in this repository on Joe's account.

tagged: resizable indexed array extension tutorial screencast youtube threedevsandamaybe

Link: http://eddmann.com/posts/developing-a-resizable-indexed-array-as-a-php-extension-with-joe-watkins/

Tideways.io:
Dodge the thundering herd with file-based Opcache in PHP7
Aug 31, 2015 @ 11:55:37

The Tideways.io site has posted a tutorial showing you how to "avoid the thundering herd" of incoming requests to your application using a file-based PHP 7 opcode cache to reduce load and increase performance on your site.

In the last blog post about Fine-Tuning Opcache Configuration I mentioned the thundering herd problem that affects Opcache during cache restarts. When Opcache is restarted, either automatically or manually, all current users will attempt to regenerate the cache entries. Under load this can lead to a burst in CPU usage and significantly slower requests.

[...] In Rasmus talk at FrOsCon 2015 (Video at 12:30, Slides), he showed the persistent secondary file-based cache Opcache gets in PHP 7. It can read the generated opcodes from disk instead of having to recompile the code after cache restart. This happens only when the compiled opcaches are not found in shared memory.

They talk about the benefits that this caching can provide, not only to web-based applications but also to command line scripts. There's a mention of possible security issues if an attacker is able to read/write to the cache files (but permissions can help that). The post ends with how to install it on your own PHP 7 instance, using the --enable-opcache-file flag on compilation.

tagged: thunderherd opcode cache problem php7 example commandline

Link: https://tideways.io/profiler/blog/dodge-the-thundering-herd-with-file-based-opcache-in-php7

Community News:
Sunshine PHP 2016 Call for Papers Now Open
Aug 31, 2015 @ 10:14:10

The 2016 edition of the Sunshine PHP conference, happening in Miami, Florida between February 4th and 6th, has officially opened their Call for Papers for their upcoming event.

We’re pleased to announce our conference, SunshinePHP is one of the best PHP conferences where community members from around the world come together to learn and share information about the latest trends and technologies in professional PHP development.

The speaker package for their 2016 event includes an all-access pass to the conference itself, airfare/travel to the event, two hotel nights and lunch provided on regular conference days. They're accepting submissions until midnight (EST) on September 30th and highly advise submitting more than one session idea. They also have a few suggested topics they'd like to see at this year's event including:

  • Virtualization and environments
  • Development principles
  • User Experience/Usability
  • Continuous Integration
  • Debugging
  • Teamwork and/or Developer Management
  • Professional development

It may be a PHP-centric conference but they're looking for a wide range of other topics to round it out too. If you have an idea for a session you'd like to present, be sure to submit as soon as possible!

tagged: sunshinephp16 conference callforpapers cfp open announcement

Link: http://cfp.sunshinephp.com/

SitePoint PHP Blog:
Voice controlled PHP apps with API.ai
Aug 31, 2015 @ 09:36:14

The SitePoint PHP blog has posted a tutorial showing you how to help your applications understand natural language with the help of the Api.ai service.

In this tutorial we’ll be looking into Api.ai, an API that lets us build apps which understand natural language, much like Siri. It can accept either text or speech as input, which it then parses and returns a JSON string that can be interpreted by the code that we write.

They start by explaining some of the concepts you'll need to know in using the service: agents, entities, intents, contexts, aliases and domains (each with a summary and examples). In their example, they show how to get the current time from any given places using their API. He shows you how to set up a free account and create a new agent. He then uses Guzzle (the HTTP client library) to make the request to the API with your API and subscription keys. They show the result of a query for "What's the current time in Barcelona Spain?" and how to extract the "location" value from the results. With this they then search the Google API for the local time of "Barcelona Spain". With the time in hand, they then use the responsive-voice.js library to convert the text to speech at the click of a button.

With all these concepts under your belt, they also walk you through a second application, a currency converter. It uses the same workflow as the previous example with the exception of using the CurrencyLayer.com API to perform the financial conversion. All code needed for this example is included as well. If you'd like to just jump to the end, they've also shared the complete code for both examples over on Github.

tagged: voice control api apiai tutorial localtime currency convert

Link: http://www.sitepoint.com/voice-controlled-php-apps-with-api-ai/

Community News:
Latest PEAR Releases (08.31.2015)
Aug 31, 2015 @ 08:04:58

Latest PEAR Releases:

tagged:

Link: