2013年8月27日星期二

Community News: Latest PECL Releases for 08.27.2013

Latest PECL Releases:
  • leveldb 0.1.4
    - Fixed build on some linux for issue #6, pecl bug #65353
    - Compatible with PHP5.5
    - Fixed build break for PHP5.2


  • graphdat 1.0.1
    Stable release, linux based platforms only


  • graphdat 1.0.0
    Stable release, linux based platforms only


  • WinCache 1.3.5.0
    1.3.5.0 release:
    - Compiled for PHP 5.5
    - Opcode Cache is disabled by default for PHP 5.5 because Opcache is available in Core
    - Added support for traits and trait aliases


  • raphf 1.0.2
    * Fixed ZTS shutdown crash


  • raphf 1.0.1
    * Fixed ZTS build


Community News: Packagist Latest Releases for 08.27.2013

Recent releases from the Packagist:

ServerGrove.com: New features of PHP 5.5


For those that might not had a chance to try out the latest major release in PHP (PHP 5.5), there's a new post to the ServerGrove blog talking about the new features and includes some sample code of each in action.



PHP 5.5 was released on June, 20th and soon after we made it available on ServerGrove VPS images. Since then, many users have upgraded their virtual servers to PHP 5.5 taking advantage of its performance improvements, bug fixes, and several of its new features. Here are some of the new features that stand out...


In his list of new features are things like:



  • generators
  • finally handling in exceptions
  • empty accepting expressions
  • array and string dereferencing
  • Class name resolution via "::class"
  • foreach support for list() and non-scalar keys
  • OPcache extension added
  • Password hashing API
  • GD


Some of the items in the list were added pre-5.5, but they're all in there now, so give it a spin in your application and try out some of these new features!


Link: http://blog.servergrove.com/2013/08/26/new-features-of-php-5-5

SitePoint PHP Blog: Handle Incoming Email with SendGrid


On the SitePoint PHP blog today Lukas White has a new tutorial showing you how to handle incoming emails from SendGrid (well, pulled from SendGrid) and translate them into posts for your blog or site.



In this article, I'm going to look at how you might implement an email-to-post feature, using SendGrid. SendGrid is a service for sending email - usually in bulk, but they also offer a less well-publicized feature for handling incoming email. SendGrid can be configured to handle all incoming messages for a given domain by pinging a URI of your choosing, and by implementing a simple webhook, you can act on the incoming mail accordingly.


He bases the simple example off of the Slim framework, creating a structure with a basic database for users and posts. He then goes through the SendGrid interface, pointing out where you add the hostname and URL to call back when a new email comes in. He includes the code to create the callback functionality that accepts the POST request coming from SendGrid. This is then validated and inserted into the database to be pulled out later by the "posts" page. There's also a bit about saving images (or other files) that come in as attachments to the email.


Link: http://www.sitepoint.com/handle-incoming-email-with-sendgrid/

NetTuts.com: Building a CodeIgniter Web Application From Scratch - Part 1


NetTuts.com has started up a new tutorial series perfect for those wanting to get into PHP frameworks for modern hybrid (PHP backend, Javascript frontend) applications. This is the first part of their series introduces you to the technologies they'll be using and helps you get the basics setup.



In this series we're going to build a web billboard application from scratch, we're going to use CodeIgniter to handle the back-end service and BackboneJS for the web client. In the first two parts of the series we'll create the back-end service and then the client application in the last two.


They walk you through the steps to to set up a MongoDB to handle the data for the backend and configuring CodeIgniter to work with it. He helps you get it set up to handle REST requests from the BackboneJS frontend too (including OPTIONS handling). He shows how to parse the input and handle the output as well as models to connect to the database resources and how to handle sessions.


Link: http://net.tutsplus.com/tutorials/php/building-a-codeigniter-web-application-from-scratch-part-1/

2013年8月26日星期一

Community News: Packagist Latest Releases for 08.26.2013

Recent releases from the Packagist:

ServerGrove.com: MongoDB TTL collections


On the ServerGrove blog today there's a new post talking about TTL collections in MongoDB - queries with a time-to-live set on the indexes - and includes how to use them in PHP.



MongoDB (v. 2.2+) provides a mechanism to expire data from collections by setting a TTL -time to live- on indexes. This is a great feature if you have data that needs to persist in the database for a specific period of time. The TTL feature allows you to expire data using the MongoDB daemon instead of having to create cron jobs to delete expired data. [...] The MongoDB daemon (mongod) checks regularly for documents in collections with a TTL and removes the expired documents.


Using it from PHP is relatively simple - all that's needed is a configuration parameter on the "ensureIndex" call setting an "expireAfterSeconds" value. There's also a bit included in the post for the Doctrine users out there, showing the docblock comment to use to set the value.


Link: http://blog.servergrove.com/2013/08/23/mongodb-ttl-collections/