PHP Icon

PHP

PHP is a scripting language that works particularly well for server-side web development.
41 Stories
All Topics

JavaScript changelog.com/posts

GitHub Follow Friday for 20101029

Another Friday, time to spotlight some GitHub folks you should follow. tenderlove (Aaron Patterson) The author of nokogiri and mechanize, Aaron also empowers you to do fuzzy texticle searches. isaacs (Isaac Z. Schlueter) The man who helps you manage your package using npm. abraham (Abraham Williams) The author of the canonical PHP library for the Twitter API and fun Chrome extensions, a cool dude who is master of his domain — name.

read more

PHP changelog.com/posts

modernizr-server: Modernizr on the server-side

James is a technologist, executive & entrepreneur, working in the arena of the mobile web, all while living around the world. This year he happens to be living on an island off Belize. He also wrote modernizr-server - a way to bring Modernizr browser data to your server scripting environment. PHP is currently supported, and James intends to offer other server-side environments in the future, but that’s going to be based on demand! We’ve covered Modernizr being used in other projects before. Modernizr is a great way to find out about your user’s browser capabilities. However, you can only access its API on the browser itself, which means you can’t easily benefit from knowing about browser capabilities in your server logic. Progressive enhancement, media queries and body classes are fine for tweaking sites and their appearance. But for structural changes to sites and pages, sometimes it’s much simpler to just emit the right markup from the server in the first place. The modernizr-server library is a way to bring Modernizr browser data to your server scripting environment. For example, in PHP: <?php include('modernizr-server.php'); print 'The server knows:'; foreach($modernizr as $feature=>$value) { print "<br/> $feature: "; print_r($value); } ?> The server knows: canvas: 1 canvastext: 1 geolocation: 1 crosswindowmessaging: 1 websqldatabase: 1 indexeddb: 0 hashchange: 1 ... How it works The first time the user accesses a page which includes the modernizr-server.php library, the library sends the Modernizr script to the client, with a small script added to the end. Modernizr runs as usual and populates the feature test results. The small suffix script then serializes the results into a concise cookie, which is set on the client using Javascript. It then refreshes the page immediately. This second time the PHP script is executed, the library takes the cookie and instantiates the server-side $modernizr object with its contents. If possible, this is placed in the PHP $_SESSION so that it can be quickly accessed in subsequent requests. While either of the cookie or session remain active, no further execution of the Modernizr script will take place. If they both expire, the next request to a page containing modernizr-server.php will cause the browser to rerun the Modernizr tests again. And also … You might also want to read James’ blog post on Modernizr on the server-side. Check out the codes [Source on GitHub] & [Documentation]

read more

PHP changelog.com/posts

WatchWednesday for 20100929

It’s Wednesday again, time for us to serve up another quick list of projects to watch on GitHub. These are projects you might have missed or should could keep an eye on. Heroku::Autoscale David Dollar makes automatically scaling your Heroku dynos a snap with this gem. Simply add the gem to your Gemfile gem 'heroku-autoscale' and configure your Heroku credentials and the minimum and maximum numbers of dynos for your app in your rackup file use Heroku::Autoscale, :username => ENV["HEROKU_USERNAME"], :password => ENV["HEROKU_PASSWORD"], :app_name => ENV["HEROKU_APP_NAME"], :min_dynos => 2, :max_dynos => 5, :queue_wait_low => 100, # milliseconds :queue_wait_high => 5000, # milliseconds :min_frequency => 10 # seconds Now your app will scale up with traffic and down as traffic wanes. Tempalias Warning! This email address will self destruct. Perfect for media site content walls, contests, or auction transactions, Tempalias is powered by Node.js and lets you create email addresses with a built-in expiration using http://tempalias.com/ or hosted on own your own site. Justin.tv’s Apple Push Notification Service gem Send and read Apple Push Notifications from Ruby: Jtv-apns is a gem for accessing the Apple Push Notification Service that allows both sending notifications and reading from apple’s feedback service. This gem is based heavily on the work of James Pozdena. Tweetnest Tweetnest is a PHP app to archive, browse, and search your tweets. fugitive.vim A nice Git wrapper for Vim: View any blob, tree, commit, or tag in the repository with :Gedit (and :Gsplit, :Gvsplit, :Gtabedit, …). Edit a file in the index and write to it to stage the changes. Use :Gdiff to bring up the staged version of the file side by side with the working tree version and use Vim’s diff handling capabilities to stage a subset of the file’s changes.

read more

PHP changelog.com/posts

Slim: A PHP5 Sinatra Clone

Frank Sinatra was the Chairman of cool. Some fourteen years after his death, the crooner is still imitated. Just like its namesake, Sinatra, the class Ruby web application DSL still inspires all sorts of projects from Sammy.js to Padrino to Denied. Slim, a PHP5 project from Josh Lockhart is the latest project to cover the classics. Setup To get started, just require the script and call init <?php require('slim/Slim.php'); Slim::init(); ?> Routing Slim supports the familiar Sinatra-style routes for all four HTTP verbs: Slim::get('/books/:id', function ($id) { //Do something }); Slim::post('/books', function () { //Do something }); Slim::put('/books/:id', function ($id) { //Do something }); Slim::delete('/books/:id', function ($id) { //Do something }); Middleware and callbacks Slim also allows you to run code before and after your actions: Slim::before(function () { //Do something }); Slim::after(function () { //Do something }); Templating Slim supports a variety of templates including Smarty and Twig. [Source on GitHub] [Hompage]

read more

JavaScript changelog.com/posts

Snapbird - Twitter search on steroids

If you’ve ever spent time looking for a long lost tweet and have gotten frustrated by the short window that tweets are indexed by Twitter Search, then check out Snapbird from Remy Sharp of jQuery for Designers fame. Snapbird lets you search someone’s timeline, favorites, or your own direct messages without the 7 day Twitter Search restriction. It even lets you permalink favorite queries. Snapbird also uses Twitterlib, Remy’s JavaScript Twitter API wrapper. Snapbird is open source so you can either use the hosted version or fork the project and run your own. [Source on GitHub] [Homepage]

read more

PHP changelog.com/posts

Phake: M/Rake for PHP

It’s always refreshing to see language communities learning from eachother. PHP now as its own clone of GNU Make and Ruby’s Rake: Phake. Automation Ahoy! Phake supports task grouping, before/after blocks, and task descriptions. Requires PHP >= 5.3 (for closures). Here’s a simple task definiton: task('dependency1', function() { echo "i will run first!n"; }); task('dependency2', function() { echo "i will run second!n"; }); task('task_name', 'dependency1', dependency2', function() { echo "i will run last!n"; }); And to run the task, simply: ./phake task_name [Source on GitHub]

read more

PHP changelog.com/posts

CoreyLib: PHP Universal API Wrapper

The PHP world is filled with API and XML Parsers that often bring page rendering to a crawl. Aaron Collegeman’s CoreyLib library is an incredibly simple universal API wrapper with caching built in. It can handle most modern APIs with full XML, JSON, authentication, parameterization, xmlNode, and Xpath support. All requests can be cached in MySql and parsed at a custom interval to dramatically improve page rendering speed. Here’s all the code needed to get the latest 5 tweets from twitter: Source on GitHub

read more

PHP changelog.com/posts

Fiber: A simple PHP interface to CouchDB

Fiber from Luis Gomez is a simple way to add CouchDB storage to your PHP app. Given a User class that extends a Fiber Document: $user = User::find('john'); $user->email = "john@example.com"; $user->city = "San Francisco"; $user->save(); Fiber also includes some nifty chaining: $user->set( array( "email" => "peter@example.com", "city" => "Caracas" ) )->save(); Check out the examples in the source. [Source on GitHub]

read more

PHP changelog.com/posts

storytlr - lifestreaming for geeks

Open Source has its own Circle of Life. As we discussed in Episode 0.1.1, Open Source creates opportunities for entrepreneurs. Sometimes those businesses can spin off their own projects, paving the way for the next round of startups. Sometimes commercial apps just don’t survive, but let’s not confuse viable with valuable. Take the case of Storytlr, a hosted lifestreaming service which sought to let you remix your social networking interactions into your own “stories.” When the hard decision was made to pull the plug on the service at the end of last year, the founders did what many apps have done and handed the source code over to the community. The official Storytlr open source project is on Google Code but John Hobbs has a fork on GitHub that adds: A tool to rename users (dangerous if not handled properly) Plugins built in for… Github goodreads Foursquare Stack Overflow Twitter favorites Google Buzz Ability to delete items that are from other sources (not just ones from Storytlr itself) tidy is replaced by htmLawed Misc fixes for issues reported on the Google group Misc fixes from other forks, esp. paths courtesy of Stuart Herbert For a live demo, check out @abraham’s Storytlr at http://stream.abrah.am/. Storytlr runs on PHP (which runs darn near everywhere) and installation instructions can be found in the README. [Official Google Code Project] [Source on GitHub]

read more

PHP changelog.com/posts

riak - high performance document store built on JSON and REST

Riak, REE-ahk, combines the power of Erlang with the ubiquity of JSON to deliver a highly scalable document store over REST. Hold on CouchDB fans, before you pounce, you haven’t heard this one before. Master-less replication Riak is architected for master-less replication from the GET-go. All nodes participate equally in the replication so scaling horizontally means just adding new servers to join the party. Links for powerful object graphs Riak supports link-walking which is far more powerful than traditional relational DB joins. As Sean Cribbs explains: Every datum stored in Riak can have one-way relationships to other data via the Link HTTP header. In the canonical example, you know the key of a band that you have stored in the “artists” bucket (Riak buckets are like database tables or S3 buckets). If that artist is linked to its albums, which are in turn linked to the tracks on the albums, you can find all of the tracks produced in a single request. As I’ll describe in the next section, this is much less painful than a JOIN in SQL because each item is operated on independently, rather than a table at a time. Here’s what that query would look like: GET /raw/artists/TheBeatles/albums,_,_/tracks,_,1 More powerful Map/Reduce Map/Reduce works a bit differently in Riak. Riak’s Map function expects a list of keys on which it should run. You can of course pass every key in your bucket, but doing Map in this way allows Map to be run on the node where the data is actually stored. Riak ships with libraries for Python, Ruby, Java, Erlang, and even JavaScript. Want to know more? Stay tuned. Riak will be the focus of an upcoming episode of The Changelog. [Source on BitBucket] [Homepage] [Brian Fink’s NYC-NoSQL talk]

read more

PHP changelog.com/posts

Kohana - The Swift PHP Framework

Kohana is a PHP MVC web framework that aims to be easy, lightweight, and secure. It has no dependencies on PECL or PEAR extensions and uses strict PHP 5 OOP. It uses what it calls “cascading resources” to allow developers to extend the framework without editing the core system. There is an extensive list of [modules], even a MongoDB ORM, MangoDB. [Source on GitHub] [Homepage] [Docs]

read more

PHP changelog.com/posts

Facebook's HipHop leaves PHPers dancing

When Twitter faced early scaling issues, much was made of decisions to rewrite large portions of the Rails site in Scala. Facebook however has decided to double down on PHP, releasing HipHop, a PHP source code transfomer: HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP’s runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations. ** Update ** We posted this blind yesterday when GitHub was unavailable. Looks like the repo isn’t public yet. Keep an eye out. GitHub explore shows five watchers… [Source on GitHub] [Announcement]

read more

PHP changelog.com/posts

phpMoAdmin: MongoDB admin tool for PHP

Extra (or deducted, depending on your point of view) points for an SEO optimized repo name, phpMoAdmin aims to be mo’ admin than phpMyAdmin by providing a MongoDB administration tool for PHP. phpMoAdmin is built on a stripped-down version of the Vork high-performance framework. Features include: Database List Create/drop Repair Collection Show collections Create/drop collection List indexes Create/drop indexes Data objects Show objects with 3-different viewing options (full, compact & uniform) Create/delete objects Edit object data Mongo GridFS GridFS objects automatically link GridFS chunks to GridFS files [Source on GitHub] [Homepage]

read more

Drupal changelog.com/posts

Drupal 7.0 Alpha 1 released

After nearly two years of development, we are proud to announce the release of the first alpha version of the Drupal 7.x family. This alpha includes a tremendous number of new features and new under-the-hood improvements for both users and developers. What’s new, what’s changed? Revamped User Interface Custom Fields Image Handling Update Manager Front-end “under-the-hood” improvements Back-end “under-the-hood” improvements [Mirror on GitHub] [Official Release] [Homepage]

read more

PHP changelog.com/posts

WordPress 2.9 released

WordPress 2.9 ‘Carmen’ is out. Release highlights include: Global undo/”trash” feature, which means that if you accidentally delete a post or comment you can bring it back from the grave (i.e., the Trash). This also eliminates those annoying “are you sure” messages we used to have on every delete. Built-in image editor allows you to crop, edit, rotate, flip, and scale your images to show them who’s boss. This is the first wave of our many planned media-handling improvements. Batch plugin update and compatibility checking, which means you can update 10 plugins at once, versus having to do multiple clicks for each one, and we’re using the new compatibility data from the plugins directory to give you a better idea of whether your plugins are compatible with new releases of WordPress. This should take the fear and hassle out of upgrading. Easier video embeds that allow you to just paste a URL on its own line and have it magically turn it into the proper embed code, with Oembed support for YouTube, Daily Motion, Blip.tv, Flickr, Hulu, Viddler, Qik, Revision3, Scribd, Google Video, Photobucket, PollDaddy, and WordPress.tv (and more in the next release). [Download] [Announcement]

read more

0:00 / 0:00