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

NetTuts.com:
Refactoring Legacy Code Part 9 - Analyzing Concerns
July 24, 2014 @ 11:27:56

The NetTuts.com site has posted part nine in their series sharing helpful hints and methods for refactoring legacy code. In this new post they continue on with their example application and look at where methods should be moved to/created and mocking in their tests.

In this tutorial, we will continue to focus on our business logic. We will evaluate if RunnerFunctions.php belongs to a class and if so, to which class? We will think about concerns and where methods belong. Finally, we will learn a little bit more about the concept of mocking.

They show how to move some of the "Runner" functions from procedural to OOP, integrating them with some of the classes and methods that already exist. Tests are also included showing how it all links together. From there they get into concerns about the placement of functionality and how that relates to the work at hand. They also use Mockery to mock out some of the needed objects in their tests for the new structure.

0 comments voice your opinion now!
refactor legacy code series part6 concerns functionality mock unittest

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-9-analyzing-concerns--cms-21760

SitePoint PHP Blog:
Getting Started with PHP Underscore
April 17, 2014 @ 13:50:28

The SitePoint PHP blog has a new article posted showing you how to get started with Underscore, a PHP library ported over from Javascript's popular Underscore.js library with many of the same methods intact.

If you've ever used the Backbone framework for JavaScript, you'll already be familiar with Underscore. Indeed, it's become incredibly useful for JavaScript developers in general. But did you know that it's been ported to PHP? [...] Underscore describes itself as a "utility belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It's the tie to go along with jQuery's tux, and Backbone.js's suspenders."

He starts by showing you how to get it installed and some of the basic syntax of the methods it defines (basically replace the period with the double-colon) for both the procedural and OOP handling. He shows examples of a few of the more handy methods it provides including:

  • Each
  • Pluck
  • Minimum and Maximum
  • Filter and Reject
  • sortBy
  • groupBy

...and many more. There's also a bit of talk about templating and extending the library via "mixins".

0 comments voice your opinion now!
underscore port introduction methods functionality

Link: http://www.sitepoint.com/getting-started-php-underscore/

Jonathan Hill:
What Is Wrong With PHP's Semaphore Extension
December 14, 2012 @ 11:08:18

In this recent post to his site Jonathan Hill takes a look at the PHP semaphore extension and talks about some of the issues he's had with it.

He lists five different pain points he discovered when trying to use the extension:

  • Lack of a true Semaphore
  • Undefined error handling
  • Undefined behavior of sem_get()
  • Cannot disable semaphore auto-releasing
  • A semaphore may be deleted when other processes are waiting to acquire it

The semaphore extension provides a PHP-based wrapper for the System V IPC family of functions (including semaphores, shared memory and inter-process messaging).

0 comments voice your opinion now!
issues semaphore extension systemv functionality


PHPClasses.org:
Lately in PHP, Episode 28 - Should PHP be Copying the Java features and practices?
November 13, 2012 @ 13:31:04

PHPClasses.org has posted the latest episode of their "Lately in PHP" podcast series - episode #29, Should PHP be Copying the Java features and practices?.

Particularly since version 5.0, PHP has been copying many of Java features and practices of Java programmers. This means that if Java programmers practices tend to be bureacratic and less productive, PHP programmers that use those features or adopt those Java practices may also become less productive. This was one of the main topics discussed by Manuel Lemos and Michael Kimsal on the episode 29 of the Lately in PHP podcast.

There's also a bit of discussion about adding generics to PHP and using OAuth in PHP. You can listen to this latest episode either via the in-page player, by downloading the mp3 or by watching the video of the recording. You can also subscribe to their feed to get the latest in the podcast series.

0 comments voice your opinion now!
latelyinphp podcast java functionality oauth generics


Sherif Ramadan:
Test Drive PHP 5.5 A Sneak Peek
October 22, 2012 @ 12:09:02

Sherif Ramadan has a new post that gets into some good detail about what you can expect in the upcoming PHP 5.5 release with loads of new features.

There's been some talk about PHP 5.5.0 over the past couple of months even though it is barely on the horizon. The reason for this is that the PHP project has seen some increased levels of activity over the last two years since the dawn of PHP 5.4 and now in to the early twilight phase of PHP 5.5.0-dev. For those of you that haven't been following the internals mailing list I'm about to give you a quick test-drive and sneak-peak at PHP 5.5 using the latest 5.5.0-dev branch (which is still TBD).

Obviously, since the actual release of this version has yet to be determined, some of this may change over time. He gets into some of the major advancements and features that will be included like:

  • the "finally" keyword
  • list() support in foreach()
  • the Password Hashing API
  • generators
  • a new property accessor syntax
  • scalar type hints

Code samples are provided in some places to help make a bit more sense out of the example.

0 comments voice your opinion now!
upcoming release version new feature functionality


Anthony Ferrara's Blog:
On PSR-0 Being Included In PHP's Core
November 04, 2011 @ 08:34:50

In a new post to his blog today Anthony Ferrara looks at the (heated) discussion that's popped up around having the PSR-0 autoloader standard included as a part of the PHP core. He gives his reasons (three of them) why he's not for the decision.

Recently there has been a rather heated and intense discussion on whether the PSR-0 autoloader "standard" should be included as part of the PHP core (in ext/spl to be exact). I've tried to stay out of the discussion and have successfully done so. Until today. I feel that there's something that's been missing to the discussion. So rather then posting this to the internals list, I feel it's better served by a blog post on the subject. So here's my take on it.

As mentioned, he's not in favor of the inclusion for three different reasons:

  • It's inconsistent with current PHP functionality and would bias development one way or another
  • It's not an actual standard, just a loosely defined practice based on functionality already in place
  • There's noting for core to gain by adopting it and could cause problems trying to make things fit a one-size-fits-all solution.
0 comments voice your opinion now!
psr0 core functionality autoload standard opinion


DZone.com:
Debate - How to Interface the PHP World
October 26, 2011 @ 08:33:53

In a new post to DZone.com today Mitchell Pronschinske responds to some comments that were made by Lukas Smith about working with interfaces in PHP and what he sees as an ideal "drop in" solution.

The PHP community was reacting to Lukas Smith's "Interfacing the PHP world" for most of last weekend. [...] It's a pretty major propositon to start 'interfacing the PHP' world. Catch up on the conversation and let us know what you think.

Mitchell summarizes Lukas' thoughts into three points - interfaces in separate repositories, PHP frameworks not adopting 5.3 yet and the customization of method names/naming conventions across frameworks and tools. Another response to Lukas came from Herman Radtke with Lukas following up his original post with "Why Bother?"

0 comments voice your opinion now!
debate interface lukassmith common functionality framework


Web Builder Zone:
What we don't need in object-oriented programming
October 04, 2010 @ 10:53:08

On the Web Builder Zone, Giorgio Sironi has a few suggestions about things that aren't really needed in object-oriented development but seem to have found their way in none the less (most of them are in PHP too).

It is in general true that you should strive for writing code as simple as possible (in length but in complexity too) to obtain an end result specified by a requirement or a user story. If there are two designs for a feature, almost always we would choose the simplest. This article takes a broader view on object-oriented programming, and ask the following question: What are the constructs we don't need in an object-oriented language? What we can take away without hampering our capabilities of building software?

He has a whole list of things that he thinks could be removed - "extra features" that wouldn't cause heartache if dropped including:

  • instanceof
  • break/continue
  • protected subclassing scope
  • if (conditional)
  • switch (conditional chain)
  • public (for fields)
0 comments voice your opinion now!
oop opinion remove feature functionality


Zend Developer Zone:
Trait-like Functionality for PHP
April 07, 2010 @ 10:05:52

In a new tutorial posted on the Zend Developer Zone today Steve Hollis looks at something several PHP developers have said they want to seen in the language - traits - and how, until then, you can use traits now (well, sort of).

So why do we need traits, anyway? PHP is a single inheritance language, meaning that each class can only extend one other. This allows us to build logical class hierarchies which extend functionality in a "vertical" way. [...] What we need is a means of re-using code other than simple inheritance. That's where traits come in. Traits are classes containing a collection of methods, usually relating to a particular behaviour.

He shares a way that you can mimic some of the functionality that traits would give you (full code is available here) with an abstract trait class, reflection and a "superclass" that's extended to pass off the requests to the correct child object.

0 comments voice your opinion now!
trait functionality tutorial mimic


Symfony Blog:
Updates to the Plugin Website/Resources
August 11, 2008 @ 08:45:08

Two new posts on the Symfony blog talk about improvements to the framework's plugin system (as found in recent releases).

A week after the release of the new plugin system, a lot of activity has taken place. More than 30 plugins were created, and 51 new releases were published on 27 different plugins. Based on the feedback I have received from the community, I have made some tweaks to the system.

These tweaks include a newly designed homepage, the inclusion of RSS feeds and a special URL to view the older wiki documentation for some plugins.

The second post describes more enhancements based on other feedback (on the previous post). Updates based on this information include an new "overview" field to describe the plugin, a download of the Markdown syntax to make the documentation conversion easier and a "stric mode" validation if you upload a PEAR package.

0 comments voice your opinion now!
symfony framework website update feedback functionality



Community Events





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


framework symfony podcast community update library release language list deployment install api opinion series laravel introduction tips interview zendserver package

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