News Feed
Jobs Feed

News Archive
feed this:

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

SitePoint PHP Blog:
Database Versioning with Ladder Migrations
April 22, 2014 @ 10:48:41

The SitePoint PHP blog has posted another tutorial looking at database versioning (see this postfocusing on Ladder migrations. Ladder is a simple PHP-based way to write migrations with rollbacks in a clear, easy to read format.

Version control systems are invaluable for tracking changes in your code, particularly when you're working in a team. However, most applications don't consist solely of application code. Managing changes to the database has always been a little more challenging, particularly when you're adding new features which require changes to the schema. [...] One solution is to move responsibility for creating and modifying the database schema into code, using migrations. That way, changes can be managed along with the rest of your application, and features we take for granted in version control - such as being able to compare versions and keep an audit trail - can be used for database changes.

He introduces the Ladder tool briefly, shows how to get it installed/configured and gets into writing a first simple migration. It creates a "users" table with two columns and comes with both "up" and "down" methods to make rollbacks easier. Ladder also provides functionality for database seeding, pre-populating the database tables with sample data either from hard-coded values or from a CVS file.

0 comments voice your opinion now!
database migration ladder versioning tutorial project

PHP objects in MongoDB with Doctrine
March 21, 2012 @ 10:03:59

On today Giorgio Sironi has a new post showing how you can use Doctrine with MongoDB to work with Document objects from the database.

In the PHP world, probably the Doctrine ODM for MongoDB is the most successful. This followes to the opularity of Mongo, which is a transitional product between SQL and NoSQL, still based on some relational concepts like queries. [...] The case for an ODM over a plain Mongo connection object is easy to make: you will still be able to use objects with proper encapsulation (like private fields and associations) and behavior (many methods) instead of extracting just a JSON package from your database.

He briefly mentions that the PECL extension for Mongo needs to be installed prior to trying out any of the examples. His first example shows how to create a DocumentManager (similar to the normal EntityManager for those familiar with Doctrine). He also shows an integration with the ORM and shares some of the findings he's made when it comes to versioning the resources (hint: annotations are your friend).

0 comments voice your opinion now!
mongodb doctrine object orm tutorial versioning

Tilllate Blog:
Caching of Dynamic Data Sets
December 05, 2007 @ 10:29:00

On the Tilllate Blog, there's a new post discussing the use of caching in applications, specifically for dynamic data.

Consider you have a set of data that is changing dynamically for each page request and you need to cache that data the fastest way possible. You can't cache dynamic and unpredictable data as a whole, can you? Hence, we would put each data entry into cache separately to be able to fetch it separately and dynamically. But this means bombing your cache infrastructure with with requests.

They break it up into a few different topics - caching text elements on the page, two-tiered caching (grouping cached items), incremental caching and cache versioning. They don't share an example of their code unfortunately, but they do mention something about a possible contribution to the Zend_Cache component of the Zend Framework.

0 comments voice your opinion now!
caching dynamic data text element incremental versioning cache caching dynamic data text element incremental versioning cache

Community Events

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

composer application install hack component introduction unittest framework package security podcast release hhvm language opinion facebook series symfony2 database performance

All content copyright, 2014 :: - Powered by the Solar PHP Framework