News Feed
Sections




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

Evert Pot:
Accessing protected properties from objects that share the same ancestry.
September 16, 2014 @ 11:19:23

In his latest post Evert Pot shows an interesting side effect of working with two objects from the same class: accessing protected properties from one instance to the other.

I realized something odd about accessing protected properties the other day. It's possible in PHP to access protected properties from other objects, as long as they are from the same class. [...] I always thought that protected strictly allows objects to access things from the current inheritence tree, but didn't realize that this also extends to other instances of the same object.

He includes a bit of sample code showing two object instances each being able to access the protected "val" property from the other. He also shows an example of how it works in two different objects, both that derive from a common ancestor. He shares a few other code examples showing this relationship and points out a few places where it could come in handy.

0 comments voice your opinion now!
protected property object ancestor access

Link: http://evertpot.com/properted-properties-from-shared-ancestry/

SitePoint PHP Blog:
Create a Movie Recommendation App with Prediction.io - Implementation
September 16, 2014 @ 10:54:16

The SitePoint PHP blog continues their series about creating a movie prediction engine with Prediction.io in this second part focusing on implementation. In the first part of the series they set up the server and configuration to make the jump into the code. This second part gets more into the application side and features working code linking the prediction engine with the TheMovieDB API.

He jumps right into the code, showing how to:

  • Fetch the data from the TMDB (via Flight and Guzzle)
  • Populate the data back into the Prediction.io database
  • Picking a random movie from the list (and outputting it to a page)
  • Get movies the engine predicts as recommendations

The recommendations are based on ratings on other movies in the database with most of that logic happening behind the scenes instead of in the PHP script. The results are then output to the page along with the other movie data.

0 comments voice your opinion now!
movie recommendation predictionio server tutorial api implementation

Link: http://www.sitepoint.com/create-movie-recommendation-app-prediction-io-implementation/

Rob Allen:
Sending attachments in multipart emails with ZendMail
September 16, 2014 @ 09:18:09

Rob Allen has a new post today showing you how to use the ZendMail component of the Zend Framework 2 to send attachments with multipart emails. A multipart email allows you to combine both the HTML and plain text versions of the content into a single email.

I've written before about how to send an HTML email with a text alternative in ZendMail, but recently needed to send an attachment with my multipart email. With help from various sources on the Internet, this is how to do it.

He includes the full code for the example first: a "sendEmail" function that sets up the MIME and plain-text parts and uses the "MimeMessage" and "MimePart" objects to attach the file. He goes through each of the parts of the script and describes what's happening and how that changes the content of the email. You can find out more about the ZendMail component in this section on the Zend Framework manual.

0 comments voice your opinion now!
tutorial send email attachment multipart zendframework2 zendmail

Link: http://akrabat.com/zend-framework-2/sending-attachments-in-multipart-emails-with-zendmail/

Community News:
Packagist Latest Releases for 09.16.2014
September 16, 2014 @ 08:08:02

Recent releases from the Packagist:

Community News:
Latest PECL Releases for 09.16.2014
September 16, 2014 @ 07:03:14

Latest PECL Releases:
  • pthreads 2.0.8 resolve bugs in static class members resolve bug in property table write failure causing fault introduce Collectable convenience class for Pools get deep copying of functions working add message to termination info make consistent isset/empty behaviour on Threaded objects add Threaded::extend voodoo method solve system memory leaks in windows introduce object cache, saving on allocation for access to all members fix crash when class has legacy ctor fix fault in ::chunk fix fault in fpm fix overflow in ::wait various other stability improvements

  • termbox 0.1.1 build fixes; arginfo

  • termbox 0.1.0 initial release

  • xmp 4.2.0 - Initial release

  • phdfs 0.1.1 - Fix package

  • phdfs 0.1.2 - Modify the config.W32

  • phdfs 0.1.0 First release

  • pecl_http 2.1.1 * Fix httpVersion retrieval on bigendian (Remi) * Fix etag/crc32b on bigendian (Remi)

  • swoole 1.7.5 - Added swoole_client->sendfile() - Added swoole_table - Remove onMasterConnect/onMasterClose - Added pipe output buffer - TCP short connection have 50% performance improvement

0 comments voice your opinion now!



Peter Aba:
phpmetrics of popular php projects
September 15, 2014 @ 10:11:01

Peter Aba has put together a a set of visualizations around the popularity of various PHP projects using the phpmetrics tool. He decided to run it against several projects he knows of and share the results.

I came across a new tool called phpmetrics. It can be used for, what a surprise, calculating and displaying metrics for php. I fell in love with this cute little tool in an instance and decided to run it on some php projects that I consider important. I'm aware of the fact that the list is currently far from complete, but it's probably still worth a look. I especially love the "maintenability" (sic!) reports, I find those big red spots just as disgusting as I find ugly code the same.

He's broken it up into a few different sections with lots of different projects under each:

  • Frameworks
  • CMS
  • E-commerce
  • Development tools

There's also an "Other" (and "Backfire") category that contains the results for the results of phpmetrics itself. He also includes a few issues he ran across during the processing of the metrics, some with the phpmetrics tool itself and some with the libraries themselves.

0 comments voice your opinion now!
metrics popular projects phpmetrics results visualization

Link: https://peteraba.com/blog/phpmetrics-of-popular-projects/

SitePoint PHP Blog:
Create a Movie Recommendation App with Prediction.io - Setup
September 15, 2014 @ 09:47:24

On the SitePoint PHP blog today Wern Ancheta has posted the first part of a series about creating a recommendation engine with the help of PHP and a system called Prediction IO.

In this tutorial, I'm going to walk you through Prediction IO, an open-source machine learning server. It allows you to create applications that could do the following: recommend items (e.g. movies, products, food), predict user behavior, identify item similarity and rank items. You can pretty much build any machine learning application with ease using Prediction IO. You don't have to deal with numbers and algorithms and you can just concentrate on building the app itself.

He walks you through the download and install of the Prediction IO software, how to start up the server and how to access its web interface. He shows you how to create an "engine" that will be used to make the recommendations and some of the settings allowing you to tailor it to your needs. The script will hook into The Movie DB API for content. He starts in on the PHP packages that will be needed to make the API connection and recommendations, but the actual code will come in a later article.

0 comments voice your opinion now!
movie recommendation predictionio server tutorial api movie

Link: http://www.sitepoint.com/create-movie-recommendation-app-prediction-io-setup/

Community News:
Packagist Latest Releases for 09.15.2014
September 15, 2014 @ 08:06:48

Recent releases from the Packagist:

Community News:
Packagist Latest Releases for 09.14.2014
September 14, 2014 @ 08:09:50

Recent releases from the Packagist:
0 comments voice your opinion now!



Community News:
Packagist Latest Releases for 09.13.2014
September 13, 2014 @ 08:09:25

Recent releases from the Packagist:


Community Events





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


framework development code application list laravel developer introduction deployment release series interview conference tips community api language version podcast zendserver

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