News Feed
Jobs Feed
Sections




News Archive
feed this:

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

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


Grzegorz Godlewski's Blog:
Choosing your Source Code Management System
June 11, 2012 @ 10:10:53

In a recent post to his blog Grzegorz Godlewski talks about some of the criteria to consider when selecting your source code management tool (between Subversion, Git and Mercurial).

Each of them has its own advantages and disadvantages so the project's requirements, development environment and team members receptivity should be taken into consideration. Relying on my own experience in project management and using version control systems to manage the development process I've formed the conclusions listed below that may be helpful while considering usage of one of described SCM's in your own projects.

He talks about how the size of the project can effect the decision and a bit more detail about what each of the version control systems are good at. The PHP project itself has recently made the shift to git away from Subversion (you can find more information on the PHP.net site).

0 comments voice your opinion now!
source code management choice advice opinion subversion mercurial git


PerishablePress.com:
Encoding & Decoding PHP Code
June 08, 2012 @ 10:56:26

On the PerishablePress.com site there's a recent article showing you how to encode your PHP project's code (though some of the methods are more obfuscation than actual encryption).

There are many ways to encode and decode PHP code. From the perspective of site security, there are three PHP functions - str_rot13(), base64_encode(), and gzinflate - that are frequently used to obfuscate malicious strings of PHP code. For those involved in the securing of websites, understanding how these functions are used to encode and decode encrypted chunks of PHP data is critical to accurate monitoring and expedient attack recovery.

They show examples of several methods of encoding/obfuscation of the code including rot13, base64, gzinflate/gzdeflate and links to some other resources.

0 comments voice your opinion now!
encoding source obfuscate tutorial



Community Events











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


package framework install language podcast symfony2 hhvm facebook introduction composer performance hack component series database unittest application release security opinion

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