Before you start
This "Create an interactive production wiki using PHP" series is designed for PHP application developers who want to to take a run at making their own custom wikis. You'll define everything about the application, from the database all the way up to the wiki markup you want to use. In the final product, you will be able to configure much of the application at a granular level, from who can edit pages to how open the blog really is.
At the end of this tutorial, you will have learned what goes into making a wiki, considerations in defining your wiki markup, potential pitfalls and challenges in dealing with file uploads, and some implications involved when setting up an environment where content is edited by a collective, rather than an individual. Some of these issues can make wikis tricky. But they can also make them great.
Part 1 of this series will draw the big picture. You will determine how you want the application to look, flow, work, and behave. You'll design the database and rough-out some scaffolding. Part 2 focuses on the primary wiki development, including defining the markup, tracking changes, and file uploads. In Part 3, you define some users and groups, as well as a way to control access to certain aspects of individual Wiki pages and uploaded files. Part 4 deals with a Calendaring and Milestones feature to track tasks, to-dos, and progress against set goals. And in Part 5, you put together an open blog to allow discussion of production topics and concerns.
PHP is a popular language choice when developing Web applications. Binary and source versions are available, and while the binaries are Windows®-specific, the source can be complied for most common platforms. PHP is widely available at most third-party hosting companies. It's easy to learn, but at the same time, it's powerful, flexible, and capable. All of these things make PHP a good choice for writing a wiki engine.
This tutorial focuses on application design. After you get your prerequisites out of the way, you'll get a picture for how the application is going to look, and jump into the database design and scaffolding parts. You're building the beginnings of your custom PHP wiki engine. But rather than refer to it as "your custom PHP wiki engine," you are going to have to give it an easy-to-remember name, such as Criki.
Topics include:
- What makes a wiki?
- Criki's architecture
- Database design
- Scaffolding
It is assumed that you have some experience working with PHP and MySQL. We won't be doing a lot of deep database tuning, so as long as you know the basic ins and outs, you should be fine. You may find it helpful to download and install phpMyAdmin, a browser-based administration console for your MySQL database.
Before you begin, you need to have an environment in which you can work. The general requirements are reasonably minimal:
- An HTTP server that supports sessions (and preferably mod_rewrite). This tutorial was written using Apache V1.3 with mod_rewrite enabled.
- PHP V4.3.2 or later (including PHP V5). This was written using PHP V5.0.4
- Any version of MySQL from the last few years will do. This was written using MySQL V4.1.15.
You'll also need a database and database user ready for your application to use. The tutorial will provide syntax for creating any necessary tables in MySQL.
Additionally, to save time, we will be developing Criki using a PHP framework called CakePHP. Download CakePHP by visiting CakeForge.org and downloading the latest stable version. This tutorial was written using V1.1.13. For information about installing and configuring CakePHP, check out the tutorial series titled "Cook up Web sites fast with CakePHP" (see Resources).




