Thursday, August 6, 2009

Flat-file based PHP CMSs

After several unsuccessful attempts to get access to the MySQL databases behind the web pages of my main client I have decided to look into another options that do not require a separate MySQL database with a separate password and separate set of skills.

To my surprise, since last time I checked, there have been emerged/developed quite a few (and good) options around that I'm listing below:

CMSimple is simple, small and fast. It writes page data directly to a HTML file on the web server. Configuration files and language files are also saved in .txt format.
CMSimple also offers a wide variety of plug-ins, including many made by third parties.
DokuWiki is wiki software that works on plain text files and thus needs no database. Its syntax is similar to the one used by MediaWiki and its data files remain readable outside the wiki.
It has a generic plugin interface which simplified the development and maintenance of add-ons.
DokuWiki is included in the Linux distributions of Debian and Gentoo Linux.
Pluck allows for easy web page creation for users with little or no programming experience, and does not use a database to store its data.
Pluck also includes a flexible module system, which allows developers to integrate custom functionality into the system. Pluck includes 3 default modules: Albums, Blog and Contact form.
razorCMS is designed to be as small as possible ( around 300 KB including a WYSIWYG - Editor), just enough to be useful on a base install. Then extra functionality can be added as needed via the Blade Pack management system.
Skeleton CMS isn't really a CMS as much as it is a very simple framework for rapid prototyping. If nothing more, it's a good structured site model to start building a website with. There is no need for a database and no fancy admin area, but if you're building a site for a client and you don't need the power of Wordpress this might be exactly what you're after.

As pointed out, the main advantage of using flat-file (text) files as a database for a PHP driven CMS is that you no longer depend on external software to edit and maintain a part of the CMS, without which the system simply will not run.

But you must keep in mind that although flat-file files are an acceptable solution for small databases, they become sluggish as the database grows because access mode is sequential.
Another disadvantage is their inability to support transactions and probably the biggest concern is Security: A database protects the data from outside intrusion better than a flat file because it provides a security layer of its own.
Having said that, NOTHING that is hosted on a server connected to the Internet is secure and if there are hackers equipped with enough resources who are intent in breaking into your system, they eventually will.

An intermediate solution would be the use of SQLite an Open Source embedded relational database management system contained in a small C programming library that when is linked in it becomes an integral part of the program. The entire database including definitions, tables, indices, and the data itself are stored as a single text file on a host machine.
SQLite is embedded into a growing number of popular applications, such as Mozilla Firefox or Google's Android OS.

Sounds good to me.
Below some of the CMSs that are able to use SQLite to store their data:

eoCMS (everyone’s Content Management System) uses MySQL or SQLite and php to deliver content in a user-friendly interface.
It features a forum, moderation features, custom 404 pages, personal Messaging , plug-ins, RSS output, ratings, etc.
Frog CMS is an extendable open source content management system designed to use PHP5 along with a MySQL database backend, although it also has support for SQLite. It is actually a port of Radiant, the Ruby on Rails CMS, although Frog has begun to take its own development direction.
FUDforum supports all the standard features you may come to expect from a modern forum with a robust MySQL, PostgreSQL or SQLite back-end, that allows for a virtually unlimited number of messages (up to 2^32 messages).
Habari is a modular, object-oriented blogging platform that supports Multiple users, Multiple sites, Plugins, Importers for Serendipity and WordPress, etc.
Habari prides itself in being standards compliant and more secure than other blogging platforms by making use of PDO and enabling prepared statements for all interactions with the database.
Jaws is a CMS and modular framework that focuses on User and Developer "Friendliness" by providing a simple and powerful framework to hack your own modules.
Lanius CMS comes out of the box with two flatfile database choices (Gladius DB and SQLite), that will work out-of-the-box with both PHP4 and PHP5.
phpSQLiteCMS is based on PHP and SQLite and runs "out of the box". phpSQLiteCMS uses PDO as database interface, which makes it also possible to run with MySQL.
Serendipity is a PHP based blog and web-based content management system that supports PostgreSQL, MySQL, and SQLite database backends, the Smarty template engine, and a plugin architecture is kept updated by automatically checking the plugin repository online.

The only drawback to this approach in many of the systems above is that they use the PHP Data Objects (PDO) extension, a lightweight, consistent interface for accessing databases in PHP that although greatly reduces the system's vulnerability to SQL injection attacks, it does require the new OO features in the core of PHP 5, and so will not run with earlier versions of PHP.

No comments:

Post a Comment