Modified: branches/monolith/doc/manual/index.html (1531 => 1532)
--- branches/monolith/doc/manual/index.html 2008-03-30 03:26:59 UTC (rev 1531)
+++ branches/monolith/doc/manual/index.html 2008-03-30 05:02:56 UTC (rev 1532)
@@ -539,67 +539,266 @@
Here is [http://www.chrisjdavis.org/asides-with-habari another tutorial] for doing inline asides. That is, asides listed along with primary posts, however with the ability to format them differently.</pre>
</div>
-<div title="Choosing a Custom Theme" modifier="miklb" created="200710131835" tags="MediaWikiFormat" changecount="1">
-<pre>Habari now supports a basic way to change themes. The first step is to create a new directory in /user/themes/ for your new theme. Either copy your k2 theme over, or start from scratch.
+<div title="Choosing a Custom Theme" modifier="miklb" modified="200710132257" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="694">
+<pre>#REDIRECT [[Creating a Custom Theme]]</pre>
+</div>
+<div title="Code Submisson" modifier="habari" modified="200710161723" created="200710132030" tags="MediaWikiFormat" changecount="2">
+<pre>== Editing the Code ==
+First, you must [[Installation#Downloading_Habari|download the source code]] from SVN.
-If you are copying k2 over, you can simply edit the theme.xml file in the theme directory. You should leave the first line alone, and simply edit the tags below that. They are pretty self explanatory. If you are creating a theme from scratch, the theme.xml file should start with <pre><?xml version="1.0" encoding="UTF-8" ?></pre>
-Then add a <pre><theme></pre> tag.
+Then, following the [[Coding Standards]], make your changes to the code.
-Below that, add these tags:
+Next, create a .diff file of the changes you have made. Here is an example of how to do this, where ''filename.php'' is the name of the file you've changed, and ''rXXX'' is the version you've made the change to.
+<pre> svn diff filename.php > filename.php.rXXX.diff </pre>
-===Name===
-<pre><name></name></pre> This is the name you are giving your theme.
+Then, attach your .diff file to the appropriate issue in the [http://trac.habariproject.org/habari issue tracker].
+Other users will then be able to apply your patch to test its compatibility with other configurations, and once tested and approved a comitter will then be able to apply your patch to the code to become a part of '''Habari'''
+</pre>
+</div>
+<div title="Coding Standards" modifier="Massimiliano" modified="200802022119" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1200">
+<pre>These are the Coding Standards for Habari:
-===Author===
-<pre><author></author></pre> Your name, or whom ever is being credited with the design.
+*Use tabs instead of spaces for indentation
+*for functions and classes, the opening brace { should be on its own line
+*conditionals have the opening brace on the same line: <code>if ( foo == bar ) {</code>
+*on an else condition, closing brace on new line, else and opening brace on same line: <code>} ''[line break]'' else {</code>
+*Classes are named like so: <code>ClassName</code>
+*Variables are named with underscores: <code>variable_name</code>
+*spaces inside parentheses and operators: ( parentheses ), <code>foo == bar</code>
+*no space before assignment, space after: <code>$foo= bar</code>
+{{developer}}
-===Url===
-<pre><url></url></pre> The url the theme can be found at.
+[[Category:Manual]]</pre>
+</div>
+<div title="Creating A Plugin" modifier="Massimiliano" modified="200802022118" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1199">
+<pre>Habari's functionality can be modified or extended using plugins, which are written in PHP. Writing a plugin for Habari is extremely simple.
+The steps below describe in detail how to create a plugin for Habari, and provide some examples of the sorts of things that can be done with a plugin.
-===Version===
-<pre><version></version></pre> The version number for the theme/design.
+== Step 1: Create The Plugin Class File ==
+Create a new directory in your <tt>/user/plugins</tt> directory that uses the name of your plugin. As an example, you could create: <tt>/user/plugins/mysample</tt>
-===Template Engine===
-<pre><template_engine></template_engine></pre> The template engine that the theme uses. Currently Habari supports rawphpengine, however, by design, any number of other engines can be supported (Smarty and PHPTal are currently being developed for Habari).
+In that directory, create a php file that contains the name of your plugin (the same as the directory) plus <tt>.plugin.php</tt> added to the end. For our example, we would create: <tt>/user/plugins/mysample/mysample.plugin.php</tt>
+== Step 2: Create the Base Plugin Class ==
+All plugins in Habari must extend the core <tt>Plugin</tt> class. This allows the system to easily find and register your plugin. The following code creates a plugin called <tt>MyPlugin</tt>.
-Finally, a closing <pre></themes></pre> tag is needed.
+<code>
+ class MyPlugin extends Plugin
+ {
+ function info()
+ {
+ return array(
+ 'name' => 'My Plugin',
+ 'version' => '1.0',
+ 'url' => 'http://habariproject.org/',
+ 'author' => 'Habari Community',
+ 'authorurl' => 'http://habariproject.org/',
+ 'license' => 'Apache License 2.0',
+ 'description' => 'Description',
+ );
+ }
+ }
+</code>
-This file should be uploaded the new theme's directory if it's not there already.
+The <tt>info()</tt> member of the plugin is _required_. It indicates the basic plugin information. If you want your plugin to appear properly in Habari's list of plugins in the admin, then you need to provide these fields at a minimum:
-You can now visit your Admin -> Themes page, and should have the option to "active" your new theme. Note, you must have at least a home.php file in your theme directory, however Habari currently supports numerous templates (see [[Template_File_Hierarchy]]), and at this point, you should also have the theme.php file (see the example in k2).
-</pre>
-</div>
-<div title="Code Submisson" modifier="habari" modified="200710161723" created="200710132030" tags="MediaWikiFormat" changecount="2">
-<pre>== Editing the Code ==
-First, you must [[Installation#Downloading_Habari|download the source code]] from SVN.
+;name: The name of the plugin as it will appear in the admin console.
+;version: The version of your plugin. It is important that this version number be compatible with PHP's [http://php.net/version_compare version_compare()] function if you want your plugin to be compatible with the habariproject.org update beacon.
+;url: The URL location of your plugin. This will be used to create a link to your plugin from the admin console.
+;author: The name of the author of your plugin. (Your name!)
+;authorurl: The URL location of your blog/web site if any.
+;license: The distribution license of your plugin.
+;description: Description of your plugin.
-Then, following the [[Coding Standards]], make your changes to the code.
+You should not create an instance of your plugin (<tt>$foo = new MyPlugin()</tt>) within your plugin class file. Habari will find your plugin and create an instance of it for you when your plugin is activated. It is able to do this because your plugin extends the core <tt>Plugin</tt> class. (If your plugin requires a separate class, Habari won't create an instance of it, because it wouldn't extend <tt>Plugin</tt>.)
-Next, create a .diff file of the changes you have made. Here is an example of how to do this, where ''filename.php'' is the name of the file you've changed, and ''rXXX'' is the version you've made the change to.
-<pre> svn diff filename.php > filename.php.rXXX.diff </pre>
+== Step 3: Add Actions and Filters ==
-Then, attach your .diff file to the appropriate issue in the [http://trac.habariproject.org/habari issue tracker].
+The plugin system in Habari is based on Actions and Filters.
-Other users will then be able to apply your patch to test its compatibility with other configurations, and once tested and approved a comitter will then be able to apply your patch to the code to become a part of '''Habari'''
-</pre>
-</div>
-<div title="Coding Standards" modifier="habari" modified="200710161723" created="200710132028" tags="MediaWikiFormat" changecount="4">
-<pre>These are the Coding Standards for Habari:
+An Action occurs when a certain event in the software takes place. For example, when a post is saved or displayed an Action is triggered. An Action notifies your plugin that the event has taken place, allowing your plugin to perform some function. Values that are passed to an action cannot be changed.
-* Use tabs instead of spaces for indentation
-* for functions and classes, the opening brace { should be on its own line
-* conditionals have the opening brace on the same line: <code>if ( foo == bar ) {</code>
-* on an else condition, closing brace on new line, else and opening brace on same line: <code>} ''[line break]'' else {</code> are named like so: <code>ClassName</code>
-* Variables are named with underscores: <code>variable_name</code>
-* spaces inside parentheses and operators: ( parentheses ), <code>foo == bar</code>
-* no space before assignment, space after: <code>$foo= bar</code>
-</pre>
+A Filter is similar to an Action but allows your plugin to change data that will be used by the system when an event occurs. Filters are passed the value of a parameter to filter, and return that parameter, possibly having altered it in some way. Some Filters also pass additional parameters to give plugins extra information. An example is a Filter that responds to a comment submission and returns the "spamminess" of the comment. The value that is returned from a Filter is passed to subsequent Filters as the first parameter, and is eventually used as the value for the filtered item.
+
+Each Action or Filter has a name called a "hook name" that represents an event. A plugin "hook" is the place in the code where Habari checks to see if any plugins need to be informed of an event. A hook is either an Action or a Filter. See [[Plugin Hooks]] for more information on plugin hooks, including a list of available Actions and Filters. A plugin "sink" is one of the actual functions that is executed when the plugin hook code is run. Creating sinks that are activated for specific hooks is as simple as adding a method to your class with the appropriate name, either <tt>filter_hook_name</tt> or <tt>action_hook_name</tt>.
+
+=== Action Example ===
+
+Assume that you want your plugin to perform a task whenever the system has finished loading all plugins. The hook name of this hook is <tt>plugins_loaded</tt>. <tt>plugins_loaded</tt> is an Action.
+
+To sink this action, create a new method in your plugin like so:
+
+<code>
+ function action_plugins_loaded()
+ {
+ Utils::debug('Hello!');
+ }
+</code>
+
+The prefix of <tt>action_</tt> in your function name tells Habari that you are creating a sink for an Action. The <tt>plugins_loaded</tt> part of the function name tells Habari what hook you want to sink.
+
+When you activate the plugin with this function in it, the "Hello!" message will be displayed inside the pink debug box immediately after all active plugins are loaded.
+
+Some Actions will pass values to the sink methods. These values can be checked and acted upon.
+
+=== Filter Example ===
+
+Assume that you want your plugin to check the spamminess of a comment. The hook name of a hook that will do this is <tt>spam_filter</tt>. <tt>spam_filter</tt> is a Filter.
+
+To sink this Filter, create a new method in your plugin like so:
+
+<code>
+ function filter_spam_filter($rating, $comment, $handler_vars)
+ {
+ if ( strpos( $comment->content, 'viagra' ) ) {
+ $rating++;
+ }
+ return $rating;
+ }
+</code>
+
+The prefix of <tt>filter_</tt> in your function name tells Habari that you are creating a sink for a Filter. The <tt>spam_filter</tt> part of the function name tells Habari what hook you want to sink.
+
+When you activate the plugin with this method, Habari will pass every submitted comment through it. The function looks for the word "viagra" in the content of the comment, and upon finding it, increases the spam rating of the comment.
+
+Finally, the rating is returned for use by the next plugin, and by the system. Note that even when no adjustment is made to the value of <tt>$rating</tt> it *must* be returned, otherwise the system will not have a value to process.
+
+In this sink method, the <tt>$handler_vars</tt> parameter is provided to the method by the system, but it is not used by the method. This parameter could have been omitted in the method declaration, but it might be useful to leave it there for future use.
+
+=== XMLRPC Example ===
+
+Implementing XMLRPC via plugins is very easy by use of a special prefix for a plugin function.
+
+<code>
+ function xmlrpc_namespace__function($param1, $param2, ...);
+</code>
+
+A hook implemented in this way uses the "namespace" part of the hook name as the XMLRPC namespace, and the "function" part as the XMLRPC function. The two are separated by two underscore characters.
+
+Values passed from to this hook function are those interpreted by processing the incoming values posted to Habari's XMLRPC endpoint.
+
+To return a properly formatted XMLRPC value, simply return a standard PHP data type. This will be converted into a proper XMLRPC response by the plugin system.
+
+== Step 4: Common Plugin Tasks ==
+
+The previous steps provide instructions for constructing the basic structure of a Habari plugin. With that knowledge, leveraging the many plugin hooks is a simple task.
+
+What follows are a few things that are common tasks when creating a plugin.
+
+=== Add Output to a Theme ===
+
+So, you have created your killer plugin and want to provide theme developers a chance to show off your work. Based on the action example above, you can do something like this:
+
+<code>
+ function action_add_template_vars( $theme ) {
+ {
+ $theme->yourvariable= 'Sweet Plugin Output';
+ }
+</code>
+
+This makes <tt>$yourvariable</tt> available in the theme, where you can do something like
+
+<code>
+<?php echo $yourvariable ?>
+</code>
+
+and that will output the value directly in the theme template file.
+
+=== Use FormUI to Create an Options Page ===
+
+Adding an options control to your plugin is also very easy, and most users will be more comfortable with setting the options via the admin panel than editing plugin code directly. Thankfully Habari provides a mechanism called FormUI that enables plugin developers to quickly create their own option controls.
+
+The basic structure that needs to be added to the plugin, is as follows:
+<code>
+ public function filter_plugin_config( $actions, $plugin_id )
+ {
+ if ( $plugin_id == $this->plugin_id() ) {
+ $actions[]= _t('Configure');
+ }
+ return $actions;
+ }
+</code>
+The _t() function translates the string into the language used by the site. For English-language blogs, the output would be "Configure", while for Spanish-language blogs, for example, the output might be "Configurar".
+<code>
+ public function action_plugin_ui( $plugin_id, $action )
+ {
+ if ( $plugin_id == $this->plugin_id() ) {
+ switch ( $action ) {
+ case _t('Configure') :
+ $ui = new FormUI( strtolower( get_class( $this ) ) );
+ $customvalue= $ui->add( 'text', 'customvalue', _t('Your custom value:') );
+ $ui->on_success( array( $this, 'updated_config' ) );
+ $ui->out();
+ break;
+ }
+ }
+ }
+</code>
+<code>
+ public function updated_config( $ui )
+ {
+ return true;
+ }
+
+</code>
+
+The first function, <tt>filter_plugin_config</tt>, creates a simple configure link for the plugin, on the Plugin Administration page.
+<tt>action_plugin_ui</tt> adds the form controls, in this example a text field called <tt>customvalue</tt> is added.
+The call to <tt>on_success</tt> registers a callback function, in this case <tt>updated_config</tt>. This is called when the FormUI is successfully submitted to allow you to perform actions if the form is successfully submitted and passes validation. If the FormUI object makes use of the on_success callback, it must return true from the callback for FormUI to save the options to the options table. If the on_success callback returns false, then the callback is responsible for saving its own options. If no callback is defined, then the fields will be saved automatically. When FormUI saves fieldvalues, the fields are saved in the Options table in the format <tt>{plugin_name}:{field_name}</tt>, your plugin name in lowercase and the field name separated by a colon.
+
+To read the value of the variable have defined in an Action or Filter, call <tt>Options::get( 'myplugin:customvalue' );</tt>, and build logic around the value it returns.
+
+To store a user-specific option - an option that is different for each logged-in user - apply the prefix "user:" to the name of the added control. Instead of being stored in the options table, the user-specific option will be stored in the user's info record as <tt>{plugin_name}_{field_name}</tt>. So a plugin named "Foo" with an option named "user:bar" will have its value accessible from:
+<code>User::->identify()->info->foo_bar</code>
+
+For more information about using the FormUI, including other controls and validation, see [[Building Forms]].
+
+=== Change the Priority of Execution for Your Plugin ===
+
+Sometimes you want your implementation of a plugin hook to execute before certain core hooks or other plugins' implementations. To do this, you need to set the priority of your hooks.
+
+By default, the priority of every hook in your plugin is 8. Hooks with a lower priority execute sooner.
+
+To set the priority of one of your hooks, add the method <tt>set_priorities()</tt> in your plugin class. Have it return an associative array using the full function name of the hook (including the 'filter_' or 'action_' prefix) as the key and the priority integer as the value.
+
+<code>
+ function set_priorities()
+ {
+ return array(
+ 'action_add_template_vars' => 10,
+ );
+ }
+</code>
+
+Habari will process this function for priorities, and use them to order the execution of plugin hooks.
+
+=== Create an Automatic Update Notification ===
+
+Habari can notify users of changes to your plugin if you follow a few simple steps.
+
+'''Step 1:'''
+Get GUID, for example from http://www.somacon.com/p113.php, using the "Normal" setting.
+
+'''Step 2:'''
+Add this function to your plugin, and replace the strings therein:
+
+<code>
+ function action_update_check() {
+ Update::add( 'My Plugin Name', 'My GUID (from link above)', $this->info->version );
+ }
+</code>
+
+'''Step 3:'''
+Beacon settings for plugins are stored on http://habariproject.org. You should update these when your plugin is updated. There will eventually be a script that processes changes to the beacon information, but this script does not yet exist. To update the beacon, contact someone with access to edit files on the server. Be sure to specify a brief description of changes and whether the update is a "Critical", "Feature", or "Bugfix" update.
+
+{{developer}}
+
+[[Category:Manual]]</pre>
</div>
<div title="Creating_A_Plugin" modifier="habari" modified="200710161723" created="200710132108" tags="MediaWikiFormat" changecount="2">
<pre>Writing a plugin in Habari is dirt-simple.
@@ -781,16 +980,17 @@
Habari will process this function for priorities, and use them to order the execution of plugin hooks.
</pre>
</div>
-<div title="Customizing Theme Behavior" modifier="habari" modified="200710161723" created="200710132019" tags="MediaWikiFormat" changecount="3">
+<div title="Customizing Theme Behavior" modifier="Massimiliano" modified="200802022117" created="200803130446" tags="Category:Asides Category:Theming" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1198">
<pre>In addition to the ability of using custom templates to display output for particular requests, Habari allows customization of the code that controls which templates are called for display and what values are passed to them.
-To accomplish this, Habari attempts to load a <tt>theme.php</tt> file located in the theme directory. If this file is present, is it included in the code before the theme is rendered for any incoming request.
+To accomplish this, Habari attempts to load a <tt>theme.php</tt> file located in the theme directory. If this file is present, it is included in the code before the theme is rendered for any incoming request.
To override the core behavior for themes (defined in <tt>/system/classes/theme.php</tt>), define a new class structure in the theme's <tt>theme.php</tt> that extends the core <tt>Theme</tt> class.
Consider this custom class:
-<pre>// Set a custom theme to use for all public page (UserThemeHandler) theme output
+<source lang="php">
+// Set a custom theme to use for all public page (UserThemeHandler) theme output
define('THEME_CLASS', 'CustomTheme');
/**
@@ -817,11 +1017,13 @@
parent::act_display_posts();
}
-}</pre>
+}
+</source>
+This class defines two custom functions for output. Both of these functions would be executed based on the action field value set for the <tt>rewrite_rules</tt> record that matches an incoming URL request.
-This class defines two custom functions for output. Both of these functions would be executed based on the action field value set for the <tt>rewrite_rules</tt> record that matches an incoming URL request.
-</pre>
+[[Category:Asides]]
+[[Category:Theming]]</pre>
</div>
<div title="DefaultTiddlers" modifier="miklb" modified="200707302054" created="200703132340" server.type="file" server.host="file:///Users/blogworks/Sites/MyHabari/Docs/Habari_Manual.20070916.0135310976.html" server.page.revision="200707302054">
<pre>[[Introduction]]
@@ -930,14 +1132,14 @@
Additionally, as development is still in a state of rapid growth, you can consult the online wiki to learn more about [http://wiki.habariproject.org/en/Habari_Classes classes] and [http://wiki.habariproject.org/en/Plugin_Hooks plugin hooks].
</pre>
</div>
-<div title="FAQ" modifier="habari" modified="200710161721" created="200704162101" tags="MediaWikiFormat" server.type="file" server.host="file:///Users/blogworks/Sites/MyHabari/Docs/Habari_Manual.20070916.0135310976.html" server.page.revision="200708031911" changecount="3">
+<div title="FAQ" modifier="michaeltwofish" modified="200802200620" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1267">
<pre>==What does "habari" mean?==
"Habari" is a Swahili word that means "what's the news?" It's similar to the English "What's up?" or the Spanish "¿Qué pasa?" The typical response is "mzuri sana", which means "very good."
==What are the system requirements?==
Habari is a modern solution for blogging, and requires modern software. To successfully use Habari, you will need:
-* A web server ([http://httpd.apache.org/ Apache] and [http://www.lighttpd.net/ lighttpd] tested so far)
+* A web server ([http://httpd.apache.org/ Apache], [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] tested so far)
* [http://www.php.net/ PHP] version 5.2.x or above. Habari ''will not'' work with PHP 4.
* [http://www.php.net/pdo PHP Data Objects] support
* A database. [http://www.mysql.com/ MySQL] and [http://www.sqlite.org/ SQLite] tested, [http://www.postgresql.org/ PostgreSQL] coming soon.
@@ -945,17 +1147,8 @@
Habari has been successfully tested on Etch, the stable version of [http://www.debian.org/ Debian].
==Will Habari work with my web host?==
-Habari should work with any web host that support the above requirement, the below hosts were successfully tested to run Habari:
+Habari should work with any web host that supports the above requirements. A list of web hosts where Habari has been tested and run successfully can be found at [[Supported Hosts]].
-* [http://dreamhost.com/ Dreamhost]
-* [http://www.site5.com/ Site5]
-* [http://www.mediatemple.net/webhosting/gs/ (mt) Media Temple - (gs) Grid-Server]
-* [http://www.asmallorange.com/ A Small Orange] (servers Claire, Epsilon, Libby, Nu, Pickett)
-* [http://www.celeonet.fr/ Celeonet]
-* [http://www.1and1.fr 1and1 France]
-* [http://www.nearlyfreespeech.net NearlyFreeSpeech (with PHP5 requested)]
-* [http://slicehost.com/ Slicehost ''(running apache 2, php5, mysql5 or sqlite3)'']
-
==How is this different from the eleventy billion other blog packages?==
It's true that there are tons of blogging software solutions from which to choose. Each has their place, and their legion of ardent followers.
@@ -977,13 +1170,13 @@
Developers contributing to the Habari project itself should note that, unless explicitly stated otherwise, any contribution intentionally submitted for inclusion shall be under the terms and conditions of the Habari license, without any additional terms or conditions. However, plugins and themes designed to work with Habari are not required to have the same license as Habari itself.
-You can find our license included in the source, and [http://trac.habariproject.org/habari/browser/trunk/LICENSE in our code repository].
+You can find our license included in the source, and http://svn.habariproject.org/habari/trunk/LICENSE in our code repository].
==Why HTML vs XHTML==
A consensus amongst project members concluded a thorough discussion as to the merits of the two DOC types, and what would be appropriate for the Admin pages of Habari. The conclusion was that HTML was the "proper" way, however, end users are welcome to serve their pages in any way they prefer by declaring the DOC type in their theme. A more [[XHTML_vs_HTML|comprehensive outline]] of the discussion, culled from the information in the original discussion is provided.
==How can I help?==
-* Open new issues [http://trac.habariproject.org/habari here] describing problems you experience, or to request new features.
+* Open new issues [http://trac.habariproject.org/habari/ on our issue tracker] describing problems you experience, or to request new features.
* Join the Google Group(s) in which you have the most interest, and start sharing!
** The [http://groups.google.com/group/habari-users habari-users] group is for end user support, and general discussion.
** The [http://groups.google.com/group/habari-dev habari-dev] group is for nitty-gritty implementation discussions of the code, database schemas, and the like.
@@ -1000,7 +1193,8 @@
As you prepare your changes, ask for review on the development mailing list as often as you need it.
When your changes are complete, file code changes as a diff in the issue that you're tracking, and attach any associated files. Be sure to mention how the files are to be applied if there are any special considerations. Your issue will be reviewed, and if suitable, will be applied in the code repository.
-</pre>
+
+[[Category:Manual]]</pre>
</div>
<div title="Formatting" modifier="habari" modified="200710161724" created="200704162110" server.type="file" server.host="file:///Users/blogworks/Sites/MyHabari/Docs/Habari_Manual.20070916.0135310976.html" server.page.revision="200704162110" changecount="1">
<pre>Like most wikis, TiddlyWiki supports a range of simplified character formatting:
@@ -1028,103 +1222,120 @@
<div title="Habari Classes" modifier="habari" modified="200710161724" created="200710132032" tags="MediaWikiFormat" changecount="3">
<pre></pre>
</div>
-<div title="Habari Workflow" modifier="habari" modified="200710161724" created="200710132029" tags="MediaWikiFormat" changecount="2">
-<pre>''Workflow'' might be the wrong term. This page will attempt to describe in general terms what happens when '''Habari''' receives a request from a user. The process is basically the same for visitors (anonymous or otherwise) and users (administrators or otherwise), but each will be explained in detail for your benefit.
+<div title="Habari Workflow" modifier="Massimiliano" modified="200802022122" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1203">
+<pre>''Workflow'' might be the wrong term. This page will attempt to describe in general terms what happens when Habari receives a request from a user. The process is basically the same for visitors (anonymous or otherwise) and users (administrators or otherwise), but each will be explained in detail for your benefit.
-For the purposes of this document, we will assume that a client somewhere on the internet is accessing an instance of '''Habari''' at <code><nowiki>http://habariproject.org/en/</nowiki></code>.
+For the purposes of this document, we will assume that a client somewhere on the internet is accessing an instance of Habari at <code><nowiki>http://habariproject.org/en/</nowiki></code>.
-==End User Workflow==
-The client computer will initiate an HTTP request to <code><nowiki>http://habariproject.org/en/</nowiki></code>. The '''Habari''' instance on the server will accept the request.
+==Set up==
+The client computer will initiate an HTTP request to <code><nowiki>http://habariproject.org/en/</nowiki></code>. The Habari instance on the server will accept the request. All requests begin in the same way. This section describes Habari's set up process.
===mod_rewrite===
-Before '''Habari''' is ever invoked, the web server software (Apache, Lighttpd, IIS) will evaluate whether the incoming request is an actual file on the server's hard disk(s) or not. If the request is for a specific file that does actually exist, the web server software will deliver this file to the client, and '''Habari''' will not be involved. This happens when serving <code>.css</code> stylesheets, for example. This might also happen when serving media files (images, podcasts, etc).
+Before Habari is ever invoked, the web server software (Apache, Lighttpd, IIS) will evaluate whether the incoming request is an actual file on the server's hard disk(s) or not. If the request is for a specific file that does actually exist, the web server software will deliver this file to the client, and Habari will not be involved. This happens when serving <code>.css</code> stylesheets, for example. This might also happen when serving media files (images, podcasts, etc).
-If the client request is not for a specific file that exists on the server's hard disk(s), the web server software will pass the request on to the '''Habari''' <code>index.php</code>.
+If the client request is not for a specific file that exists on the server's hard disk(s), the web server software will pass the request on to the Habari <code>index.php</code>.
===Version Check===
-The very first thing <code>index.php</code> does is to determine whether the version of PHP installed on the server is at least version 5.1.0 or above. This is the absolute bare minimum version of PHP that '''Habari''' will support.
+The very first thing <code>index.php</code> does is to determine whether the version of PHP installed on the server is at least version 5.2.0 or above. This is the absolute bare minimum version of PHP that Habari will support.
===HABARI_PATH===
-Next, <code>index.php</code> sets a constant -- <code>HABARI_PATH</code> -- that will be used throughout the program. This constant contains the filesystem path to the <code>index.php</code> file. For example, if '''Habari''' is installed at <code>/home/habari/public_html</code>, then <code>HABARI_PATH</code> will contain ''/home/habari/public_html''. The <code>HABARI_PATH</code> constant is used in many places throughout the '''Habari''' code.
+Next, <code>index.php</code> sets a constant -- <code>HABARI_PATH</code> -- that will be used throughout the program. This constant contains the filesystem path to the <code>index.php</code> file. For example, if Habari is installed at <code>/home/habari/public_html</code>, then <code>HABARI_PATH</code> will contain ''/home/habari/public_html''. The <code>HABARI_PATH</code> constant is used in many places throughout the Habari code.
===Output Buffering===
-Once the constant has been set, '''Habari''' enables output buffering. This is a process to delay sending any data to the client until such time as the server is ready to do so. In the normal execution of a web site, content is delivered to the client directly from the server as it is read in by the server. With output buffering, content is held on the server until the script on the server specifically tells the server to send it to the client.
+Once the constant has been set, Habari enables output buffering. This is a process to delay sending any data to the client until such time as the server is ready to do so. In the normal execution of a web site, content is delivered to the client directly from the server as it is read in by the server. With output buffering, content is held on the server until the script on the server specifically tells the server to send it to the client.
===__autoload()===
-The next portion of the <code>index.php</code> defines a function, <code>__autoload()</code>, that represents one of the fundamental building blocks of '''Habari'''. Although it is defined here in <code>index.php</code>, it is not executed at this time. The <code>[http://www.php.net/autoload __autoload()]</code> function automatically locates and loads any PHP class files that are referenced for use within '''Habari'''. This function looks for class files first in the Site classes directory, if it exists, and then in <code>HABARI_PATH/system/classes</code>. By using the <code>__autoload()</code> function, '''Habari''' is able to dynamically load class files as they are needed, without requiring the '''Habari''' developers to pre-define every single class file and its location.
+The next portion of the <code>index.php</code> defines a function, <code>__autoload()</code>, that represents one of the fundamental building blocks of Habari. Although it is defined here in <code>index.php</code>, it is not executed at this time. The <code>[http://www.php.net/autoload __autoload()]</code> function automatically locates and loads any PHP class files that are referenced for use within Habari. This function looks for class files first in the Site classes directory, if it exists, and then in <code>HABARI_PATH/system/classes</code>. By using the <code>__autoload()</code> function, Habari is able to dynamically load class files as they are needed, without requiring the Habari developers to pre-define every single class file and its location.
===Error Reporting===
-With the <code>__autoload()</code> function defined, '''Habari''' now sets PHP error reporting to "All". This step is primarily to aid server administrators by ensuring that sufficient diagnostic information is recorded in the web server error logs if something goes wrong. Without this, it is often difficult to know exactly where a problem has occurred, or why.
+With the <code>__autoload()</code> function defined, Habari now sets PHP error reporting to "All". This step is primarily to aid server administrators by ensuring that sufficient diagnostic information is recorded in the web server error logs if something goes wrong. Without this, it is often difficult to know exactly where a problem has occurred, or why.
===revert_magic_quotes_gpc()===
-Next '''Habari''' invokes a function called <code>revert_magic_quotes_gpc()</code> inside the <code>Utils</code> class. Because the <code>Utils</code> class is not yet defined, the <code>__autoload()</code> function is triggered. <code>__autoload()</code> searches for a file named <code>utils.php</code> in one of several directories. Unless you have created your own <code>utils.php</code> file, '''Habari''' will load <code>HABARI_PATH/system/classes/utils.php</code> and execute the <code>revert_magic_quotes_gpc()</code> function therein. This function undoes "[http://www.php.net/magic_quotes magic quotes]". '''Habari''' does not rely on magic quotes in the same way that many other tools do.
+Next Habari invokes a function called <code>revert_magic_quotes_gpc()</code> inside the <code>Utils</code> class. Because the <code>Utils</code> class is not yet defined, the <code>__autoload()</code> function is triggered. <code>__autoload()</code> searches for a file named <code>utils.php</code> in one of several directories. Unless you have created your own <code>utils.php</code> file, Habari will load <code>HABARI_PATH/system/classes/utils.php</code> and execute the <code>revert_magic_quotes_gpc()</code> function therein. This function undoes "[http://www.php.net/magic_quotes magic quotes]". Habari does not rely on magic quotes in the same way that many other tools do.
===config.php===
-With all of that set, '''Habari''' is finally ready to load the <code>config.php</code> file that specifies how to connect to the database. A single installation of the '''Habari''' source code can power many sites, so there are a number of places in which the <code>config.php</code> file might be found. The <code>get_config_path()</code> function in the <code>Site</code> class determines where the correct <code>config.php</code> file is for this invocation of '''Habari'''. Remember, the <code>Site</code> class will be automatically loaded by the <code>__autoload()</code> function!
+With all of that set, Habari is finally ready to load the <code>config.php</code> file that specifies how to connect to the database. A single installation of the Habari source code can power many sites, so there are a number of places in which the <code>config.php</code> file might be found. The <code>get_config_path()</code> function in the <code>Site</code> class determines where the correct <code>config.php</code> file is for this invocation of Habari. Remember, the <code>Site</code> class will be automatically loaded by the <code>__autoload()</code> function!
-If '''Habari''' is only being used for a single site -- say a personal blog -- then the <code>config.php</code> file should reside inside the <code>HABARI_PATH</code> directory. However, '''Habari''' has no immediate way of determining whether it is being used for one site or one hundred sites. <code>get_config_path()</code> does the following:
+If Habari is only being used for a single site -- say a personal blog -- then the <code>config.php</code> file should reside inside the <code>HABARI_PATH</code> directory. However, Habari has no immediate way of determining whether it is being used for one site or one hundred sites. <code>get_config_path()</code> does the following:
* defines the path to the <code>config.php</code> as <code>HABARI_PATH</code>, by default
* looks for the existence of any <code>config.php</code> files inside any sub-directories of <code>HABARI_PATH/user/sites</code>
** if none are found, return the default path of <code>HABARI_PATH</code>
-* Compare the URL used to access '''Habari''' for this request with the directories in <code>HABARI_PATH/user/sites</code>, using the following formula:
+* Compare the URL used to access Habari for this request with the directories in <code>HABARI_PATH/user/sites</code>, using the following formula:
** strip off the protocol used to access the site. <code><nowiki>http://habariproject.org/en/</nowiki></code> becomes <code>//habariproject.org/en/</code>
** replace all slashes with periods. So <code>habariproject.org/en</code> becomes <code>habariproject.org.en</code>.
** place any non-standard HTTP port at the beginning of the directory. So <code>habariproject.org/en:8080</code> becomes <code>8080.habariproject.org.en</code>
** if a match exists between the URL used for this request and a directory, return that directory. For example, <code><nowiki>http://habariproject.org/en/</nowiki></code> matches <code>HABARI_PATH/user/sites/habariproject.org.en</code>
===Install?===
-If there is no <code>config.php</code>, or if it is incomplete, the '''Habari''' installation process will be invoked. If there is a valid <code>config.php</code>, '''Habari''' will attempt to connect to the database. If that fails, the installation process will be invoked.
+If there is no <code>config.php</code>, or if it is incomplete, the Habari installation process will be invoked. If there is a valid <code>config.php</code>, Habari will attempt to connect to the database. If that fails, the installation process will be invoked.
===Content Type===
-'''Habari''' next forcibly sets the content type to <code>text/html;charset=utf-8</code>.
+Habari next forcibly sets the content type to <code>text/html;charset=utf-8</code>.
===Locale===
-'''Habari''' sets the locale, which governs the language used to display '''Habari'''-generated messages. The default locale is U.S. English.
+Habari sets the locale, which governs the language used to display Habari-generated messages. The default locale is U.S. English.
===Plugins===
-Plugins are loaded next, and the very first plugin hook is triggered. Any plugins registered against the <code>plugins_loaded</code> hook will be executed.
+Plugins are loaded next, and the very first plugin hook is triggered. Any plugins registered against the <code>plugins_loaded</code> hook will be executed. See [[Plugins]] for more information.
===Controller===
-The controller ( '''C''' in MVC ([http://en.wikipedia.org/wiki/Model-view-controller model-view-controller]) "[p]rocesses and responds to events, typically user actions, and may invoke changes on the model." The controller first examines the request (<code>Controller::parse_request();</code>). This compares the requested URL against the list of registered actions in the <code>rewrite_rules</code> database table. If a match is found, the action specified in the rule is invoked against the handler specified in the rule. The controller contains an array of <code>handler_vars</code>, which are set by HTTP POST and GET values passed to this request, as well as any values set by plugins.
+The controller ( '''C''' in MVC ([http://en.wikipedia.org/wiki/Model-view-controller model-view-controller]) "[p]rocesses and responds to events, typically user actions, and may invoke changes on the model." The controller first examines the request (<code>Controller::parse_request();</code>). This compares the requested URL against the list of registered actions in the <code>rewrite_rules</code> database table. If a match is found, the action specified in the rule is invoked against the handler specified in the rule. For more information on rewrite rules, see the [[Rewrite Tutorial]]. The controller contains an array of <code>handler_vars</code>, which are set by HTTP POST and GET values passed to this request, as well as any values set by plugins. Execution from this point is different, depending on which handler is invoked according to the rewrite rule ma!
tched. The following sections describe in the workflow for different handlers.
-For the normal case of a user viewing the site, the handler will be UserThemeHandler. UserThemeHandler evaluates the request (home page, single post view, date-based archive view, etc) and loads the proper theme template files. The handler will place the <code>handler_vars</code> into the theme's global variable space. The template files are then delivered to the viewer.
+==End User Workflow==
+In the event that the requested URL is simply to a public page of the blog, that is for the normal case of a user viewing the site, the handler will be UserThemeHandler. UserThemeHandler evaluates the request (home page, single post view, date-based archive view, etc) and loads the proper theme template files. For information on how Habari chooses which template file to use, see [[Template File Hierarchy]]. The handler will place the <code>handler_vars</code> into the theme's global variable space. The template files are then delivered to the viewer.
-===Flush Output===
+==Administrative Workflow==
+For requests to the administration section of Habari, those whose path begins with <code>/admin</code> the AdminHandler will be invoked.
+
+===Authentication and Authorisation===
+Only users with administration privileges can access pages under <code>/admin</code>, so the first thing that AdminHandler does is check if the user is logged in, and if not redirects them to the login page. The user's privileges are then checked, and if they do not have administrative access an error message is displayed.
+
+===Routing the request===
+Once the user is authenticated and authorised, control is passed to <code>AdminHandler->act_admin()</code> which decides where the request should be routed based on the HTTP method used (GET or POST) and the page requested (the portion of the URL following <code>/admin</code>) to the appropriate function in <code>AdminHandler</code>. For example, a GET request to <code>/admin/publish</code> will be sent to <code>AdminHandler->get_publish()</code>, and the handler will prepare the publish page for display.
+
+===Administration Output===
+The administration section has its own theme, located in <code>HABARI_PATH/system/admin</code>. Each of the functions in <code>AdminHandler</code> specify which template should be used as their output, which is then output in the same way as any other theme.
+
+==Flush Output==
The very last thing that <code>index.php</code> does is to flush the output buffer. Any output that has been prepared is finally sent to the browser.
-==Administrative Workflow==
-</pre>
+{{developer}}
+
+[[Category:Manual]]</pre>
</div>
-<div title="Importing Content" modifier="YourName" created="200711050104" tags="MediaWikiFormat" changecount="1">
-<pre>Habari currently ships with a plugin to import posts, comments, tags (including Ultimate Tag Warrior Tags) and users from WordPress (current version confirmed to work with 2.3.1, millage will vary with older versions). Other importers are planned.
+<div title="Importing Content" modifier="Massimiliano" modified="200802022133" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1210">
+<pre>Need help [[Restoring a WordPress SQL file]]? This page is about importing directly from a WordPress database.
-You must fist activate the plugin before navigating to the admin/import page. After activating the plugin, you will get a select box to choose what type of content you are importing (as mentioned, WordPress is the only importer currently available).
+Habari currently ships with a plugin to import posts, comments, tags (including Ultimate Tag Warrior Tags) and users from WordPress (current version confirmed to work with 2.3.1, mileage will vary with older versions). Other importers are planned.
+You must first activate the plugin before navigating to the admin/import page. After activating the plugin, you will get a select box to choose what type of content you are importing (as mentioned, WordPress is the only importer currently available).
+
+One note about importing, due to the feature of importing users, you can not have the same user name in your Habari install at the time of import (this can easily be changed under admin/users/ ->edit, and change the name. You can change back after importing. Example, if your Habari install uses admin and your WordPress install uses admin, change your Habari name to admin2 for the import, and change it back after importing). '''For the upcoming .4 release, and as of revision 1319 this issue has been resolved.'''
+
You will then be prompted to fill in your WordPress database information, and choose your options for tag importation.
-It is suggested you set up a separate database for your Habari install from that of your WordPress installation, the import process will be much faster and less room for error. WordPress pages *should* import as Habari pages, and everything else either an entry or draft.
+It is suggested you set up a separate database for your Habari install from that of your WordPress installation. The import process will be much faster and less room for error. WordPress pages should import as Habari pages, and everything else either an entry or draft.
Approved and unapproved comments should also be imported.
-Note that WP permalinks and paths will be lost, and you should explore options with .htaccess if you are concerned with maintaining your previous links. Andrew da Silva's [http://andrewdasilva.com/files/plugins/route301.zip Route 301] plugin may help in some cases.
+Note that WordPress permalinks and paths will be lost, and you should explore options with .htaccess if you are concerned with maintaining your previous links. Andrew da Silva's [http://www.habariproject.org/dist/plugins/route301.zip Route 301] plugin may help in some cases. Alternatively, you can set up a custom permalink scheme by adding a rewrite rule to your Habari database. Feel free to post to [http://groups.google.com/group/habari-users Habari users] if you have any questions or problems with your migration.
-Feel free to post to [http://groups.google.com/group/habari-users Habari users] if you have any questions or problems with your migration.
-</pre>
+[[Category:Manual]]</pre>
</div>
-<div title="Installation" modifier="habari" modified="200710161721" created="200707290741" tags="MediaWikiFormat" server.type="file" server.host="file:///Users/blogworks/Sites/MyHabari/Docs/Habari_Manual.20070916.0135310976.html" server.page.revision="200708031903" changecount="6">
+<div title="Installation" modifier="andycowl" modified="200803031353" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1363">
<pre>==Before You Install==
=== Server Requirements ===
-* Supported Web Server
-** [http://httpd.apache.org/ Apache (1.3.x or higher, 2.x or higher recommended)] with [http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html mod_rewrite] enabled
-** [http://www.lighttpd.net/ Lighttpd]
-** [http://www.nginx.net/ Nginx]
-* Supported Database
-** MySQL 4.1.x or greater
-** SQLite
-* PHP version 5.2 or above
-** PHP Data Objects (PDO) enabled
-** SimpleXML enabled
+*Supported Web Server
+**[http://httpd.apache.org/ Apache (1.3.x or higher, 2.x or higher recommended)] with [http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html mod_rewrite] enabled
+**[http://www.lighttpd.net/ Lighttpd]
+**[http://www.nginx.net/ Nginx]
+*Supported Database
+**MySQL 4.1.x or greater
+**SQLite
+*PHP version 5.2 or above
+**PHP Data Objects (PDO) enabled
+**SimpleXML enabled
''Support for PostgreSQL is planned.''
@@ -1132,21 +1343,37 @@
[http://wiki.habariproject.org/en/Installation:Dreamhost faq here.]
=== Change Permissions ===
+In order to enjoy the most convenient installation process, it is required to make writable the folder where Habari will be installed. The Habari installation process will create a <tt>config.php</tt> file and <tt>.htaccess</tt> file for you automatically.
-It is required to make writable the folder where Habari will be installed, the installer will create a <tt>config.php</tt> file.
+If you are using a GNU/Linux (or other UNIX-like) host, you may apply the following chmod to the root folder of your Habari installation:
+<pre>
+chmod o+w .
+</pre>
+That allows everyone to write to the Habari directory. Specifically, the web server will use this to create the files necessary for Habari's execution.
-We recommend you allow modifications on the <tt>.htaccess</tt> file that may already exist, Habari will need to add several lines to it.
+When the installation process completes, you may remove the "everyone" write permission with this:
+<pre>
+chmod o-w .
+</pre>
-<em>Apply the following chmod to the root folder of your Habari installation.</em>
+==== Instructions for the paranoid ====
+If the idea of giving everyone write access to your Habari directory gives you the willies, you can instead perform the following steps:
<pre>
-chmod g+ w .
+touch .htaccess
+touch config.php
+chmod o+w .htaccess
+chmod o+w config.php
</pre>
+This creates empty <tt>.htaccess</tt> and <tt>config.php</tt> files, and makes only these files world-writable. Habari will add the necessary bits to these files.
-<em>Apply the following chmod to the <tt>.htaccess</tt> file in the root folder of your Habari installation.</em>
+Upon completion, you may remove the world-writable permission with these commands:
<pre>
-chmod g+ w .htaccess
+chmod o-w .htaccess
+chmod o-w config.php
</pre>
+The Habari installation process will do its best not to clobber any existing <tt>.htaccess</tt> file that might exist.
+
=== Activate PHP5 ===
Some hosts may offer both PHP4 and PHP5, but execute files with the <tt>.php</tt> extension using the PHP4 by default. You can often change this behavior by adding the following single line in the <tt>.htaccess</tt> file found in the root folder of your Habari installation:
@@ -1162,7 +1389,7 @@
<em>As Habari is still in development, no guarantees are made that these are fully stable versions, or that updating won't break the current database structure.</em>
==== Developer Release ====
-* Habari is still in development, however there is a developer release [http://code.google.com/p/habari/downloads/list available for download].
+* Habari is still in development, however there is a developer release [http://habariproject.org/dist/ available for download].
==== SVN Checkout ====
<em>In order to use SVN you will need SSH access to your server. Some hosts have it enabled by default, but others may only enable it upon request.</em>
@@ -1176,11 +1403,11 @@
<pre>cd ~/public_html/habari/</pre>
* Checkout the source code.
-<pre>svn checkout http://svn.habariproject.org/svn/trunk/htdocs .</pre>
+<pre>svn checkout http://svn.habariproject.org/habari/trunk/htdocs .</pre>
* If you are not in the Habari directory, use the following command to <em>checkout</em> in a new directory called <tt>habari</tt>.
-<pre>svn checkout http://svn.habariproject.org/svn/trunk/ habari</pre>
+<pre>svn checkout http://svn.habariproject.org/habari/trunk/htdocs habari</pre>
<em>Reference: [[Subversion and applying patchs]]</em>
@@ -1252,8 +1479,319 @@
This will allow a fully automated installation, without any prompts being displayed to the user (assuming the $db_connection array is properly constructed, too).
At the moment, it's a convenience for those who are constantly re-installing Habari and who don't want to waste a bunch of time keying in the same values over and over. It's also the basis of an automagic deployment tool for hosting providers.
-</pre>
+
+==[[Troubleshooting]]==
+
+See [[Troubleshooting|troubleshooting]] page for more details...
+
+==[[Installation/Special_Instructions|Special Instructions]]==
+===Software Bundles===
+*[[Installation/Special_Instructions/LAMP|LAMP]]
+*[[Installation/Special_Instructions/MAMP|MAMP]]
+*[[Installation/Special_Instructions/WAMP|WAMP]]
+*[[Installation/Special_Instructions/Nginx|Nginx]]
+*[[Installation/Special_Instructions/LiteSpeed|LiteSpeed]]
+
+===Hosting Solutions===
+*[[Installation/Special_Instructions/Dreamhost|Dreamhost]]
+*[[Installation/Special_Instructions/Bluehost|Bluehost]]
+
+[[Category:Manual]]</pre>
</div>
+<div title="Installation/Special Instructions" modifier="andycowl" modified="200803110808" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1461">
+<pre>==Software Bundles==
+*[[Installation/Special_Instructions/LAMP|LAMP]]
+*[[Installation/Special_Instructions/MAMP|MAMP]]
+*[[Installation/Special_Instructions/WAMP|WAMP]]
+*[[Installation/Special_Instructions/Nginx|Nginx]]
+
+==Hosting Solutions==
+*[[Installation/Special_Instructions/A Small Orange|A Small Orange]]
+*[[Installation/Special_Instructions/Dreamhost|Dreamhost]]
+*[[Installation/Special_Instructions/Bluehost|Bluehost]]</pre>
+</div>
+<div title="Installation/Special Instructions/A Small Orange" modifier="andycowl" modified="200803110809" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1462">
+<pre>A Small Orange does support PHP5, however, by default they use 4.x. To enable PHP5, you need to add a single line to your .htaccess file for the directory in which you want to use PHP5.
+
+<pre>AddHandler application/x-httpd-php5 .php</pre>
+This should be added just above the Habari rules.
+Also note, that ASO doesn't provide users with shell access by default. You must request this feature via their excellent support team.</pre>
+</div>
+<div title="Installation/Special Instructions/Bluehost" modifier="andycowl" modified="200803031431" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1373">
+<pre>Early in 2008, [http://www.bluehost.com Bluehost] upgraded all servers to PHP 5.2.x which allows Habari to be installed and configured on a Bluehost server.
+
+The other main pre-requisite for using Habari is the installation of the [http://uk.php.net/pdo PDO] (PHP Data Objects) extensions; specifically PDO drivers for the MySQL database.
+
+To check the version of PHP running on a Bluehost server and to determine whether your server has the necessary software installed, simply create a text file named 'phpinfo.php' in the root directory of the Web server containing the following lines:
+
+<pre>
+<?php
+phpinfo();
+?>
+</pre>
+
+Then, visit the URL in a Web browser - <nowiki>http://www.mysite.com/phpinfo.php</nowiki> and examine the output.
+
+The summary section includes the operating system of the host server, the exact version of the PHP interpreter and the options used to configure PHP.
+
+[[Image:Bluehost-php-summary.png]]
+
+
+* Check the version of PHP - Habari needs 5.2 (or higher)
+* Check PDO and the required drivers for the MySQL database are installed. The Web page will be long so searching for 'PDO' may quickly locate the necessary section. If PDO and the drivers are present, you should see a section similar to the following:
+
+[[Image:Bluehost-pdo.png]]
+
+If the PDO extensions and the support for MySQL are present, proceed with the installation of Habari.
+
+Otherwise, raise a ticket with Bluehost Technical Support asking for PDO and/or the drivers for MySQL to be installed on your server.</pre>
+</div>
+<div title="Installation/Special Instructions/Dreamhost" modifier="freakerz" modified="200711022015" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="849">
+<pre>= How to install Habari on Dreamhost. =
+
+== php5 ==
+
+Log into your dreamhost.com account by going to [https://panel.dreamhost.com panel.dreamhost.com]. Find the ''Manage Domain'' setting and make a fully hosted domain with PHP version 5.2.2.
+
+[[Image:s1.JPG]]
+
+== MySQL ==
+
+You then need to go to ''Goodies'' > ''Manage MySQL''. Scroll to the bottom of that page and find the bit that says ''Create a new MySQL database''.
+
+Make sure you create a new user and that you also change the ''hostname'' to the correct site.
+
+'''Example:'''
+''Database name:'' Habari
+''Hostname:'' habari.example.com
+''User:'' habari2
+''Password:'' habari12345
+
+[[Image:s2.JPG]]
+
+If you like you can put a comment on the database so you know what is in there.
+
+Then follow the [[Installation|Install guides]] as normal.</pre>
+</div>
+<div title="Installation/Special Instructions/LiteSpeed" modifier="SoreGums" modified="200802292018" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1336">
+<pre>== LiteSpeed ==
+
+=== Configure PHP ===
+
+==== Compile PDO Extensions ====
+Using LiteSpeed's inbuilt compiler these options work for MySQL.
+For sqlite you'll need to ensure you have sqlite installed on the system and use appropriate configure options.
+<pre>
+--with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-zlib --with-gd --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem
+--enable-sysvshm --enable-magic-quotes --enable-mbstring --enable-pdo=shared --with-pdo-sqlite=shared --with-sqlite=shared --with-pdo-mysql=shared
+--with-config-file-path=../php
+</pre>
+
+==== Load PDO Extensions ====
+As we specified the location of the php config file in the configure line above to be ../php, this should map to /opt/lsws/php/php.ini.
+Open that file and make sure the following is present
+<pre>
+;extension_dir = ./
+extension=pdo.so
+extension=pdo_mysql.so
+</pre>
+PHP will then use the extension_dir that is compiled into it.
+
+To verify all is well create a new file info.php and inside put
+<pre>
+<?php phpinfo() ?>
+</pre>
+When you view this you should see the PDO extension and drivers enabled.
+
+=== Configure Virtual Host ===
+
+It's a lot simpler to deal with LiteSpeed as LiteSpeed rather using all your Apache knowledge and treat LSWS like Apache.
+So don't use .htaccess just setup rewrite rules in the Virtual Host config.
+
+Do everything you normally do for a php webapp. The part you need to take note of is the Rewrite tab.
+Ensure Rewrite is enabled and that these rules are present.
+<pre>
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteBase /
+RewriteRule . index.php [PT]
+</pre>
+Update RewriteBase to where you have Habri installed. I've setup on the root dir.
+
+Restart LiteSpeed and you should be good to install.</pre>
+</div>
+<div title="Installation/Special Instructions/Nginx" modifier="tinster" modified="200802041550" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1219">
+<pre>==Installing Habari to Run on Nginx [engine x]==
+
+There are a few special considerations to get Habari up and running on [http://www.nginx.net/ Nginx]. The first being that Nginx does not provide FastCGI for you, so you've got to have a way to spawn your own FastCGI processes...
+
+===Spawning FastCGI Processes===
+
+I prefer to use the <code>spawn-fcgi</code> program provided with the [http://www.lighttpd.net/ lighttpd] web server. You can use PHP's built-in FastCGI manager <code>php-cgi</code> to [http://blog.kovyrin.net/2006/05/30/nginx-php-fastcgi-howto/ do the same thing], but it's a bit more work and not as straight-forward. Plus, if you learn how to use spawn-fcgi, you can use it for other FastCGI applications aside from ones that are PHP-based.
+
+====Install spawn-fcgi====
+
+To download and install <code>spawn-fcgi</code> to your machine, run the following commands. Feel free to adjust the path where you want the binary and don't worry, all of the building happens in your current directory...nothing else will be installed on your machine.
+
+<pre>$ wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2
+$ tar -xvjf lighttpd-1.4.18.tar.bz2
+$ cd lighttpd-1.4.18/
+$ ./configure
+$ make
+$ sudo cp src/spawn-fcgi /usr/bin/spawn-fcgi</pre>
+
+''NOTE: You will need to be root in order to copy the binary to its final location, everything else should work fine as a normal user. To gain root privileges, the program <code>sudo</code> was used in the example above, you may or may not have access to sudo on your machine.''
+
+After <code>spawn-fcgi</code> has been copied to the desired location, you can safely remove the build directory and original source file:
+
+<pre>$ cd ..
+$ rm -rf lighttpd-1.4.18/
+$ rm lighttpd-1.4.18.tar.bz2</pre>
+
+====Run spawn-fcgi====
+
+This part will be fairly distribution-specific, but I'll provide the basic command that you'll need. What you'll want to do is find a way to run this command as part of your init scripts so the processes will be spawned automatically when you reboot your server.
+
+<pre>/usr/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 53217 -P /var/run/habari.pid</pre>
+
+* <code>-f</code> -> the filename of the fcgi-application; in our case we want php-cgi, which is provided by your distribution's php package. If you don't know where to find it, try running <code>which php-cgi</code> on the command line.
+* <code>-a</code> -> the address to bind the processes to; in our case we want the localhost
+* <code>-p</code> -> the port number to bind the processes to; pick whatever you want (technically it would be best to pick one between 49152 and 65535), just make sure to remember the number and use that same one for your Nginx configuration file
+* <code>-P</code> -> the location where to save the process id file; you can use this file to easily [[Installation/Special_Instructions/Nginx#How to Properly Kill spawn-fcgi Processes|kill the processes]] later
+
+For better security, you can also set the user/group that the spawned processes will run as to a non-privileged user. To do this, you use the <code>-u</code> and <code>-g</code> flags respectively. For more information on all the available options, run <code>spawn-fcgi -h</code> on the command line.
+
+===Configure Nginx===
+
+The key part here is that Habari uses the FrontController design pattern, and thus requires any unrecognized URL request (meaning a request for a file that does not exist on the server) to be forwarded to and handled by the main index.php file. The file you need to edit is called <code>nginx.conf</code> and is installed in different places depending on your Linux distribution. For me, it was located here: <code>/etc/nginx/conf/nginx.conf</code> (installed from source, the default location is <code>/usr/local/nginx/conf/nginx.conf</code>)
+
+<pre>server {
+ listen 12.345.678.90:80; # YOUR PUBLIC IP ADDRESS (just use listen 80 to bind to all interfaces)
+ server_name domain.com; # YOUR DOMAIN NAME (subdomains [blog.yourdomain.com] will also work here)
+
+ root /srv/www/nginx/domain.com/habari; # ABSOLUTE PATH TO YOUR HABARI INSTALLATION
+
+ location / {
+ index index.php index.html index.htm;
+
+ # serve static files that exist without running other rewrite tests
+ if (-f $request_filename) {
+ expires 30d;
+ break;
+ }
+
+ # send all non-existing file or directory requests to index.php
+ # GOTCHA: Make sure your rewrite rules are inside the location block.
+ if (!-e $request_filename) {
+ rewrite ^ /index.php last;
+ }
+ }
+
+ location ~ \.php$ {
+ fastcgi_pass localhost:53217; # PORT NUMBER WHERE YOU SPAWNED YOUR FCGI PROCESSES
+ fastcgi_index index.php;
+
+ fastcgi_param SERVER_SOFTWARE nginx;
+ fastcgi_param QUERY_STRING $query_string;
+ fastcgi_param REQUEST_METHOD $request_method;
+ fastcgi_param CONTENT_TYPE $content_type;
+ fastcgi_param CONTENT_LENGTH $content_length;
+ fastcgi_param SCRIPT_NAME $fastcgi_script_name;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # SAME PATH AS ABOVE
+ fastcgi_param REQUEST_URI $request_uri;
+ fastcgi_param REDIRECT_STATUS 200;
+ }
+}</pre>
+
+After you've added these settings to your configuration, restart the <code>nginx</code> daemon and your settings should take effect.
+
+===How to Properly Kill spawn-fcgi Processes===
+
+If you need to kill the FastCGI processes that you spawned (for instance, when stopping an init script), then you can run the following command since we saved the process id to a file:
+
+<pre>kill $(cat /var/run/habari.pid) &>/dev/null</pre></pre>
+</div>
+<div title="Installation/Special Instructions/WAMP" modifier="andycowl" modified="200803031041" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1354">
+<pre>[http://www.wampserver.com/en/ WampServer] is a Windows software package containing Apache, PHP and mySQL that enables users to easily install Habari on Windows.
+
+== Install WampServer ==
+
+Download and install the WampServer package. Check the basic operation of the WAMP package by starting all WAMP Services and accessing the Web site.
+
+<nowiki>http://localhost/</nowiki>
+
+The default WampServer page displaying the Apache and PHP version should be displayed.
+
+[[Image:WampServer.PNG]]
+
+== Create a mySQL database ==
+
+Create a mySQL database with an associated database account for use with Habari. Use the phpMyAdmin utility. Select 'Privileges' to create a new user e.g. 'habari'.
+
+Check the option
+
+'Create database with same name and grant all privileges'
+
+Make a note of the username and password credentials.
+
+== Configure Apache ==
+
+The default settings for the Apache Web Server bundled with WampServer result in a '500 Internal Server error' when trying to install Habari.
+
+''Internal Server Error
+
+''The server encountered an internal error or misconfiguration and was unable to complete your request.''
+
+''Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.''
+
+''More information about this error may be available in the server error log.
+
+When the Apache error log (Apache-Apache error log) is examined, the following Apache error is recorded
+
+''D:/wamp/www/habari-0.4/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration''
+
+To fix this problem, simply enable the Apache Rewrite module from the WAMP menu (Apache-Apache Modules). Scroll down the list and ensure 'rewrite_module' is checked.
+
+After this configuration change, all Wamp services should be stopped and restarted (Restart All Services). Installation of Habari should now complete successfully.
+
+== Install Habari ==
+
+Download the Habari [http://habariproject.org/en/download distribution] and extract the files to the Web Server root directory (D:\wamp\www\habari).
+
+Bring up the Habari installation page in a Web browser - <nowiki>http://localhost/habari/</nowiki> - and simply follow the standard Habari installation process.</pre>
+</div>
+<div title="Installation/Special_Instructions/Bluehost" modifier="andycowl" modified="200803031431" created="200803130447" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1373">
+<pre>Early in 2008, [http://www.bluehost.com Bluehost] upgraded all servers to PHP 5.2.x which allows Habari to be installed and configured on a Bluehost server.
+
+The other main pre-requisite for using Habari is the installation of the [http://uk.php.net/pdo PDO] (PHP Data Objects) extensions; specifically PDO drivers for the MySQL database.
+
+To check the version of PHP running on a Bluehost server and to determine whether your server has the necessary software installed, simply create a text file named 'phpinfo.php' in the root directory of the Web server containing the following lines:
+
+<pre>
+<?php
+phpinfo();
+?>
+</pre>
+
+Then, visit the URL in a Web browser - <nowiki>http://www.mysite.com/phpinfo.php</nowiki> and examine the output.
+
+The summary section includes the operating system of the host server, the exact version of the PHP interpreter and the options used to configure PHP.
+
+[[Image:Bluehost-php-summary.png]]
+
+
+* Check the version of PHP - Habari needs 5.2 (or higher)
+* Check PDO and the required drivers for the MySQL database are installed. The Web page will be long so searching for 'PDO' may quickly locate the necessary section. If PDO and the drivers are present, you should see a section similar to the following:
+
+[[Image:Bluehost-pdo.png]]
+
+If the PDO extensions and the support for MySQL are present, proceed with the installation of Habari.
+
+Otherwise, raise a ticket with Bluehost Technical Support asking for PDO and/or the drivers for MySQL to be installed on your server.</pre>
+</div>
+<div title="Installation:Dreamhost" modifier="freakerz" modified="200711022016" created="200803130446" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="850">
+<pre></pre>
+</div>
<div title="Introduction" modifier="habari" modified="200710161719" created="200707302035" tags="MediaWikiFormat" server.type="file" server.host="file:///Users/blogworks/Sites/MyHabari/Docs/Habari_Manual.20070916.0135310976.html" server.page.revision="200708032058" changecount="11">
<pre>These documents are intended for basic information on installing, upgrading and base use. As development continues, additional information will be added. For more
comprehensive documentation, visit the [http://wiki.habariproject.org/en/Main_Page main Habari wiki].
@@ -2920,55 +3458,99 @@
</div>
<!--}}}--></pre>
</div>
-<div title="Pingbacks" modifier="habari" modified="200710161731" created="200710131847" tags="MediaWikiFormat" changecount="2">
-<pre>As of revision 756 Habari now supports the sending and recieving of Pingbacks. That is all well and good, but how do we display them on our sites?
+<div title="Pingbacks" modifier="Pivwan" modified="200802271815" created="200803130446" tags="Category:Manual" wikiformat="mediawiki" server.host="wiki.habariproject.org/w" server.page.revision="1316">
+<pre>As of revision 756 Habari now supports the sending and recieving of Pingbacks. Displaying them on your site is simple. Let's go over the code you will need to add to your comments template.
<