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

SitePoint PHP Blog:
How to Install PHP Extensions from Source
June 30, 2014 @ 11:50:22

PHP extensions (from PECL) can be very handy when you need them. Unfortunately, not all distributions come with packages that will install them for you...this is where compiling comes in. On the SitePoint PHP blog Bruno Skvorc has posted a guide to compiling extensions from source to help you get started.

Sometimes it's hard to know which PHP extensions you'll need before you install PHP. In cases where you need to add extensions later on, you might get lucky and the extension could be in the repository of the OS you're using. [...] What if there's no such thing for other extensions, though? In this tutorial, we'll go through installing some custom extensions on Linux systems (and OS X - the process is nearly identical).

He uses a Laravel Homestead instance as a platform for his example and shows the compilation of the MongoDB for PHP driver. He walks you through the process of booting up the VM and getting the environment/required packages installed. He then shows the process for the installation of two different kinds of PHP extensions: internal and third-party. Finally he shows you how to update your configuration, load in the compiled extension and test it (in this case looking at the phpinfo() to ensure it's loaded).

0 comments voice your opinion now!
install extension source compile tutorial introduction

Link: http://www.sitepoint.com/install-php-extensions-source/

New Relic Blog:
25 PHP Developers to Follow Online
May 14, 2014 @ 09:14:55

On the New Relic blog today there's a new list posted of the 25 PHP developers they suggest you follow, both on Twitter and via their code contributions.

Building PHP frameworks is hard, but following these PHP source and framework committers on Twitter is easy. You'll learn lots of interesting bits about what's happening in their respective communities, and if you want to see where the PHP and PHP framework communities are going next, just watch your feed for these folks.

Included in their list are PHP notables like:

Check out the full post for the rest of the list!

0 comments voice your opinion now!
developers follow opinion twitter github source framework community

Link: http://blog.newrelic.com/2014/05/02/25-php-developers-follow-online/

Hasin Hayder:
Installing gearmand, libgearman & pecl gearman for php from source in Debian 6 & 7
October 31, 2013 @ 11:55:51

Hasin Hayder has posted a complete guide to getting Gearman and PHP playing nicely together. The guide gives you a step by step (and command by command) list to follow so you don't have the same pains he did trying to get it working.

I had a pretty rough evening today. No, not because the waiter forgot to add sugar in my tea, but because it was so boring to go through the trial and errors of installing gearman daemon and pecl gearman extension for php.

He walks though the whole process, starting with the failures, that he took getting it installed. Unfortunately it wasn't just as easy as installing a package and using PECL to drop in the extension. There was other software packages that needed to be installed as well and were a bit harder to figure out - libboost, gperf, libevent, uuid-dev and libcloog-ppl-dev. With these installed, the PECL install command was finally able to build and he got the shared module he needed.

0 comments voice your opinion now!
install guide gearman gearmand pecl debian source extension

Link: http://hasin.me/2013/10/30/installing-gearmand-libgearman-and-pecl-gearman-from-source/

Zumba Engineering Blog:
Incorporating Mongounit into Multi-datasource Models with Traits
October 31, 2013 @ 10:42:27

On the Zubma Engineering blog today Chris Saylor has written up a tutorial showing how they used traits to use multiple data sources with Mongounit, working around the single source limitations it enforces.

A while back we open sourced Mongounit, a PHPUnit extension for testing models utilizing mongodb. One key issue that we've discovered as we incorporate MongoDB into more of our data models is that extending Mongounit's TestCase class limits that unit test towards Mongo only as the datasource. Since only a portion of our data is in Mongo while the remaining is in MySQL, limiting a test case to work with one datasource or another is too limiting.

They tried two other solutions first, separating out the tests by data source and manually clear the Mongo data in the tests, but both ran into problems. Instead, they opted to use traits to provide drop-in Mongo testing support as needed. It provides a simple interface to set up and tear down the needed Mongo resources - an example of which is also provided in the post. The code for the trait can be found on Github.

0 comments voice your opinion now!
trait mongounit unittest database multiple source model

Link: http://engineering.zumba.com/2013/10/30/multiple-data-sources-phpunit-testing/

SitePoint PHP Blog:
Responsive Images Using Picturefill and PHP
October 10, 2013 @ 10:08:11

On the SitePoint PHP blog there's a new post from Lukas White showing you how to use the Picturefill plugin (Javascript) along with PHP to make responsive images.

One of the key challenges with responsive web design, and a subject of much discussion in recent years, is how to deal with images. Setting a max-width on image elements enables designers to allow their size to adapt to the page dimensions, but in itself that approach can lead to far bigger images being downloaded than are required. [...] You can use a similar approach [to "source sets" of images] straight away and in a cross-browser compatible manner by using Javascript; one such method is the Picturefill plugin. In essence, Picturefill allows you to specify different src attributes for an image, each image file corresponding to a different media query. Thus

The tutorial helps you create an application, powered by the Slim framework and the ImageMagick extension, for the basic structure. He then grabs the Picturefill library and drops them into place. Some sample code is also included showing how to create the HTML structure for the images and the Javascript to handle the switching.

0 comments voice your opinion now!
responsive image picturefill tutorial resolution source set

Link: http://www.sitepoint.com/responsive-images-using-picturefill-php/

Lorna Mitchell:
What Goes in Source Control?
April 30, 2013 @ 10:31:26

As developers, one of the best things you can do for a project is to use version control (or "source control") for your code. Lorna Mitchell suggest using it on a wider scale, though. She sees it as a great place for all sorts of other things around a project too.

Short answer: everything! However we need some good directory structures and source control configuration to make that a really practical answer, so this article is a quick outline of my usual advice for a good source control structure for a standard web project. The examples are for a PHP project but I'm sure you could apply this to your own language of choice, also.

These "other things" she suggests that should end up in source control including things like:

  • The actual "web root" of your application
  • Library code
  • Build scripts
  • Configuration files
  • Database patches
  • Tests (unit, functional, integration, etc)
0 comments voice your opinion now!
source version control suggestion contents

Link: http://www.lornajane.net/posts/2013/what-goes-in-source-control

Jani Hartikainen:
Parsing and evaluating PHP in Haskell Part 1
January 17, 2013 @ 11:13:23

Jani Hartikainen has posted the first part of a series of articles sharing his experiences with an experiment he's conducting - trying to parse and evaluate PHP in Haskell.

The other day I uploaded a new experimental project on GitHub - A Haskell PHP parser / evaluator. It doesn't understand 100% of all PHP syntax, but it was an interesting experiment nevertheless. Here's some insights and other thoughts from working on the code.

He gets the "why?" question out of the way early, noting that it was mainly a desire to play with Haskell and figured parsing something he already knew well was a good first project. He also mentions the "Parsec" library that seems well suited for the parsing part of the process. There were some issues that he came across, however including dealing with PHP's weak typing and handling all of the possible incarnations of PHP script structure. He includes an example AST showing his different data structures (PHPValue, PHPExpr and PHPStmt). The next part of the series will be more about the evaluation of this structure.

0 comments voice your opinion now!
parsing evaluation source haskell project experiment


PHP.net:
PHP 5.4.10 and PHP 5.3.20 released!
December 21, 2012 @ 06:57:21

The PHP project has officially released versions 5.4.10 and 5.3.20 if the language:

The PHP development team announces the immediate availability of PHP 5.4.10 and PHP 5.3.20. These releases fix about 15 bugs. Please note that the PHP 5.3 series will enter an end of life cycle and receive only critical fixes as of March 2013. All users of PHP are encouraged to upgrade to PHP 5.4.

Downloads are available here (source) or here for Windows installations. The Changelog has the full list of bugs fixed these two releases. If you're interested in the migration from PHP 5.3 to 5.4 and are wondering what changes you can expect, check out this migration guide with a list of the new features and changes.

0 comments voice your opinion now!
language release endoflife upgrade windows download source


PHPMaster.com:
Compiling PHP from Source on Windows
September 20, 2012 @ 10:56:21

For most PHP developers, when they hear "compile from source" they automatically assume that the person talking means they're working with a unix variant-based system. In this new tutorial from PHPMaster.com, though, they show how to "compile from source" on a different platform - Windows.

Those working in a Windows environment are more likely to download and install PHP from precompiled packages. And while I don't disagree it's easier to use a precompiled solution, even on Unix systems, there are some advantages that can come with compiling a binary from source. [...] But be forewarned: compiling can be a frustrating task, especially on Windows! You must ensure your build environment is set up correctly, learn how to use the compiler and other build tools properly, and satisfy any library dependencies. Hopefully this article is your first step in overcoming many of these obstacles.

The tutorial walks you through the steps you'll need to take to get your environment set up, including the tools you'll need to be able to perform the compile (including Microsoft's Visual C++ Express and the Windows Software Development Kit). Screenshots and commands are all included in the post to make the compile work. There's even a few instructions on compiling in the extensions you might need.

0 comments voice your opinion now!
compile language source visualcexpress sdk windows


Anthony Ferrara:
The Anatomy Of Equals - Opcode Analysis
July 19, 2012 @ 10:11:48

Anthony Ferrara has a new post today getting into the details of how "equals" works in PHP at the opcode level. He focuses on the answer to a question he received:

I was asked an interesting question via email yesterday. The question is fairly simple. The answer, not so much... So, rather than reply in an email, I figured that I'd write a post about it instead. The question, simply stated, is: "When comparing a float to an integer using ==, where does the conversion happen?"

He starts with a super simple piece of test code that compares an integer (1) to a float (1.0) and walks through the process PHP takes to perform the comparison (with a double equals "=="). He talks about opcode handlers, the "fast equal function" and how it handles the casting from one type to another, C source highlights included.

0 comments voice your opinion now!
equals opcode source language cast variable



Community Events





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


community language introduction series framework conference symfony list artisanfiles laravel version security composer opinion library podcast release tool voicesoftheelephpant interview

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