2013年11月7日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

Community News: Packagist Latest Releases for 11.07.2013

Recent releases from the Packagist:

SitePoint PHP Blog: Yii Routing, Active Record and Caching


On the SitePoint PHP blog today Sandeep Panda has a new article looking at routing, using Active Record and caching with the Yii Framework. The Yii framework is a " a high-performance PHP framework best for developing Web 2.0 applications".



Almost all modern web apps have 3 major concerns: Retrieving data from a database easily and effectively, caching the web content and URL rewriting to create user friendly URLs. Yii, like any other good framework, offers simple and easy solutions to all of the above. [...] In this tutorial we will look at how Yii greatly simplifies the development of database driven websites with its Active Record support. Additionally, Yii lets you further improve your websites by implementing user friendly URLs and powerful caching techniques.


He creates a simple application based on the Yii framework skeleton called "gadgetstore" that works with fictional phone data. He shows how to set up a few sample routes and adding the "phone" table to the database. He then uses the framework's tools to auto-generate the model and shows the save/delete operations. He then creates the "Phone" controller and an add action to handle the create submissions. Finally, he gets into caching the response data and uses the built-in "cache" function for the models to store the results of a "findAll" request.


Link: http://www.sitepoint.com/yii-routing-active-record-caching/

Paul Reinheimer: Using GeoIP at WonderProxy


Paul Reinheimer has a new post talking about some of his experience implementing GeoIP at his HTTP testing proxy service WonderProxy (and the steps you'd need to take to make it work for your application). The GeoIP service helps you identify the sources (geolocation) of connections to your applications.



At WonderProxy we've been helping people test their GeoIP sensitive applications since launch. It's why we launched. Perhaps ironically it's never been a technology we've used on our own website. With our upcoming re-design that's changing.


He's broken it down into four major steps, each with a bit of description to go along with them:



  • Using GeoIP
  • Acquire a database
  • Rebuild Apache & PHP (with the Apache module)
  • Handle edge cases


This isn't a detailed tutorial to getting GeoIP support working in your app, but it does provide a good direction and links to several resources to help you along your way.


Link: http://blog.preinheimer.com/index.php?/archives/421-Using-GeoIP-at-WonderProxy.html

Sameer Borate: Easy PHP debugging with Kint


Sameer Borate has posted about using Kint, a "more powerful debugger" that lets you output more data than just the usual var_dump or print_r provides and in a much more readable format.



My standard debugging tool when using PHP is xdebug. Pairing xdebug with Komodo gives me a very productive environment for building PHP applications. However, testing an application code on a hosted server can be many times frustrating as one has only the print_r and var_dump functions at our disposal. What I need is a library that I can easily install on the server and start using. Although there are a few debugging libraries around, one of my favorites is Kint.


He walks you through the installation of the tool and provides an example of the most basic usage (and output) from a call to the tool's "dump" function. He also gets into some of the additional features the library provides including intelligent formatting, debug tracing and limited theme configuration.


Link: http://www.codediesel.com/tools/easy-php-debugging-with-kint/

2013年11月6日星期三

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 11.06.2013

Recent releases from the Packagist: