Source for file bbWP2UTF8.php

Documentation is available at bbWP2UTF8.php

  1. <?php
  2. /*
  3. Plugin Name: bbWP2UTF8
  4. Plugin URI: http://www.burobjorn.nl
  5. Description: This plugin will attempt to convert a wordpress or wordpress mu database with content in whatever character set to utf8
  6. Version: $Id$
  7. Author: Bjorn Wijers <burobjorn [at] burobjorn [dot] nl>
  8. Author URI: http://www.burobjorn.nl
  9. */
  10.  
  11. /*
  12. * Copyright 2008 Bjorn Wijers
  13. * This file is part of bbWP2UTF8.
  14. * bbWP2UTF8 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  15. * bbWP2UTF8 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  16. * You should have received a copy of the GNU General Public License along with bbWP2UTF8; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  17. * The latest source code is available at http://www.burobjorn.nl
  18. * Contact: Bjorn Wijers <burobjorn [AT] burobjorn [DOT] nl>
  19. * Description: This plugin will attempt to convert a wordpress or wordpress mu database with content in whatever character set to utf8 
  20. */
  21.  
  22. // TODO: Mon Jun 30 18:10:47 CEST 2008 BJORNW Need to create functions that check if steps were succesful. Maw kijken of er geen errors zijn en checken of de query effect heeft gehad.
  23.  
  24.  
  25.  
  26. /**
  27.  * bbWP2UTF8 is a class/plugin which strives to convert wordpress / wordpress mu database content in whatever character set to utf8
  28.  * @package bbWP2UTF8
  29.  * @author Bjorn Wijers
  30.  * @copyright Bjorn Wijers / VPRO Digitaal
  31.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  32.  * @version $Id$
  33.  ***/
  34. class bbWP2UTF8 {
  35.  
  36.   /**
  37.    * reference to the wordpress wpdb database object
  38.    * @var object reference to wpdb
  39.    * @access private
  40.   ***/
  41.   var $_wpdb;
  42.   
  43.   
  44.   
  45.   
  46.   /**
  47.    * Constructor (backwards compatible with php4..)
  48.    * Calls the _setClassVars function to set the class variables
  49.    * and calls the _setWPHooks in order to set the appropriate hooks.
  50.    * @access public
  51.    ***/
  52.   function bbWP2UTF8(
  53.   {
  54.     
  55.     $this->_setupClassVars();
  56.     $this->_setWPHooks();
  57.   }  
  58.   
  59.   
  60.   /**
  61.    * Set the defaults for the class variables
  62.    * @access private
  63.   ***/
  64.   function _setupClassVars(
  65.   {
  66.     global $wpdb;
  67.     $this->_wpdb =$wpdb;  // reference to the wordpress database object
  68.   }
  69.   
  70.   
  71.   /**
  72.    * Set the Wordpress specific filter and action hooks
  73.    * @access private
  74.   ***/
  75.   function _setWPHooks()
  76.   {
  77.     // Insert the addToMenu sink into the plugin hook list for 'admin_menu'
  78.     add_action('admin_menu'array(&$this'_addToMenu'));
  79.   }
  80.   
  81.   /**
  82.    * Sink function for the 'admin_menu' hook
  83.    * Makes it easy to add optional pages as a sub-option of the top level menu items
  84.    * @access private
  85.    ***/
  86.   function _addToMenu(
  87.   {
  88.     if$this->isWPMU() ) {
  89.       add_submenu_page('wpmu-admin.php'__('bbWP2UTF8')__('bbWP2UTF8')'edit_plugins'basename(__FILE__)array(&$this'showInterface') );
  90.     else {
  91.       add_submenu_page('plugins.php'__('bbWP2UTF8')__('bbWP2UTF8')'edit_plugins'basename(__FILE__)array(&$this'showInterface') );  
  92.     }
  93.   }
  94.   
  95.   /**
  96.    * Builds the interface and handles the different steps of the conversion.
  97.    * Basically the core of this plugin
  98.    * Called by the add_submenu_page hook.
  99.    * @access public
  100.    ***/
  101.   function showInterface(
  102.   {
  103.     $html  "<div class='wrap'>\n";
  104.     $html  .= "<h2>bbWP2UTF8</h2>\n";
  105.     $queries ='';
  106.     // step 1: binarize all necessary columns
  107.     ifisset($_POST['step1']) ) {
  108.       ifisset($_POST['tables']&& is_array($_POST['tables']) ){
  109.         $_SESSION['selected_tables'$_POST['tables']// keep track of the chosen tables
  110.         foreach($_POST['tables'as $table_index => $table_name{
  111.           ifis_string($table_name) ) {
  112.             $columns $this->_getTableColumns($table_name);
  113.             ifis_array($columns&& sizeof($columns{
  114.               foreach($columns as $col{
  115.                 ifis_object($col) ) {
  116.                   $queries .= $this->_binarizeTableColumn($table_name$col);
  117.                 }
  118.               }
  119.             }
  120.           }
  121.         }
  122.       }
  123.       $html .= '<h3>' __('Processed step 1. Proceed with step 2'"</h3>\n";
  124.       $html .= '<strong>Queries log</strong><br />';
  125.       $html .= $queries;
  126.       $html .= "<form name='tables_overview' method='post'>\n";
  127.       $html  .= __("<p>Converted all columns to their binary counterparts using the queries above. Next step will change all chosen tables' characterset to UTF8.</p>\n");
  128.       $html .= "<input type='submit' name='step2' value='Step 2: Convert tables to UTF8 character set' />\n";
  129.       $html .= "</form>\n";
  130.       echo $html;
  131.     else ifisset($_POST['step2']) ) {
  132.         // step 2: convert chosen tables to UTf8 character set
  133.         $selected_tables $_SESSION['selected_tables'];
  134.         foreach($selected_tables as $table_index => $table_name{
  135.           $performed_query $this->convertTable2UTF8($table_name$collation 'utf8_general_ci');
  136.           $queries .= $performed_query;
  137.         }
  138.         $html .= '<h3>' __('Processed step 2. Proceed with step 3'"</h3>\n";
  139.         $html .= '<strong>Queries log</strong><br />';
  140.         $html .= $queries;
  141.         $html .= "<form name='tables_overview' method='post'>\n";
  142.         $html  .= __("<p>Converted all tables to UTF8 using the queries above. Next step will change the database's characterset to UTF8.</p>\n");
  143.         $html .= "<input type='submit' name='step3' value='Step 3: Convert database default character set to UTF8' />\n";
  144.         $html .= "</form>\n";
  145.         echo $html;
  146.     else if isset($_POST['step3']) ) {
  147.         // step 3: convert database default character set to UTF8
  148.         $queries .= $this->convertDatabase2UTF8($database_name DB_NAME$collation 'utf8_general_ci');
  149.         $html .= '<h3>' __('Processed step 3. Proceed with step 4'"</h3>\n";
  150.         $html .= '<strong>Queries log</strong><br />';
  151.         $html .= $queries;
  152.         $html .= "<form name='tables_overview' method='post'>\n";
  153.         $html  .= __("<p>Converted database to UTF8 using the query above. Next step will change the columns back to their original types.</p>\n");
  154.         $html .= "<input type='submit' name='step4' value='Step 4: Convert columns back from binary to original types' />\n";
  155.         $html .= "</form>\n";
  156.         echo $html;
  157.     else if isset($_POST['step4']) ) {
  158.       // step 4: set all columns back to their original type
  159.         $selected_tables $_SESSION['selected_tables'];
  160.         foreach($selected_tables as $table_index => $table_name{
  161.           ifis_string($table_name) ) {
  162.             $columns $this->_getTableColumns($table_name);
  163.             ifis_array($columns&& sizeof($columns{
  164.               foreach($columns as $col{
  165.                 ifis_object($col) ) {
  166.                   $performed_query $this->_deBinarizeTableColumn($table_name$col);
  167.                   $queries .= $performed_query;
  168.                 }
  169.               }
  170.             }
  171.           }
  172.         }
  173.         $available_tables $this->_getAllTables();
  174.         $tables_list      $this->_createTablesList($available_tablesFALSE);
  175.         $database_char_set $this->showCurrentDatabaseCharacterSet()
  176.         $db_char_set_info  ($database_char_set__('<strong>Current database character set: '$database_char_set->Value '</strong>' '';
  177.         $html .= '<h3>' __('Finished!'"</h3>\n";
  178.         $html .= __("<p>Converted columns back to their original types. The database should now be converted to UTF8, see the list below for the
  179.                      current database character set and its tables collation. Don't forgot to de-activate this plugin and preferably remove it, 
  180.                      because it has no use anymore after converting the database.</p>\n");
  181.         $html .= '<strong>Queries log</strong><br />';
  182.         $html .= $queries;
  183.         $html .= $db_char_set_info;
  184.         $html .= $tables_list;
  185.         echo $html;
  186.     else {
  187.       // step 0: Display available tables for conversion
  188.         $available_tables  $this->_getAllTables();
  189.         $tables_list       $this->_createTablesList($available_tables);
  190.         $database_char_set $this->showCurrentDatabaseCharacterSet()
  191.         $db_char_set_info  ($database_char_set__('<strong>Current database character set: '$database_char_set->Value '</strong>' '';
  192.         if(is_string($tables_list) ) {
  193.           $html  .= __("<p>Before doing anything else, <strong>backup your database</strong> and <strong>make sure that your backup works</strong>. 
  194.                    If anything goes wrong you will need it to restore your Wordpress install!</p>
  195.                    <p>The list below shows the database's character set and the available tables including their current collation between brackets.</p>\n");
  196.           $html .= '<h3>' __('Select the tables to convert'"</h3>\n";
  197.           $html .= $db_char_set_info
  198.           $html .= "<form name='tables_overview' method='post'>\n";
  199.           $html .= $tables_list;
  200.           $html .= "<input type='submit' name='step1' value='Step 1: Convert columns to binary counterparts for checked tables' />\n";
  201.           $html .= "</form>\n";
  202.           echo $html;
  203.         }
  204.     }
  205.   }
  206.  
  207.   
  208.   /**
  209.    * Creates a list with all available tables
  210.    * @param array tables
  211.    * @param boolean useCheckboxes default TRUE; switches checkboxes on/off
  212.    * @todo should remove collation function from this function and make part of _getAllTables
  213.    * @return string html
  214.    * @access private
  215.    ***/
  216.   function _createTablesList($tables$useCheckboxes TRUE
  217.   {
  218.     ifis_array($tables) ) return -1}    
  219.     if(sizeof($tables0return null}
  220.     
  221.     $html "<ol>\n";
  222.     foreach($tables as $element{
  223.       $collation $this->_getTableCollation($element[0])
  224.       if($useCheckboxes
  225.         $html .= sprintf("<li><input type='checkbox' checked='checked' name='tables[]' value='%s'>%s (%s)</li>\n"$element[0]$element[0]$collation);
  226.       }else 
  227.         $html .= sprintf("<li>%s (%s)</li>\n"$element[0]$collation);
  228.       }
  229.     }
  230.     $html .= "</ol>\n";
  231.     return $html;
  232.   }
  233.   
  234.   
  235.   
  236.   /**
  237.    * Retrieves all tables from database defined by DB_NAME in wp-config.php
  238.    * @return mixed either an array with tables or a boolean FALSE
  239.    * @access private
  240.    ***/
  241.   function _getAllTables(
  242.   {
  243.     $wpdb $this->_wpdb;
  244.     $query sprintf("SHOW TABLES");
  245.     $result $wpdb->get_results($query$output ARRAY_N)// note that we grab the results as an indexed array and not as an object.. 
  246.     $return is_array($result$result FALSE;
  247.     return $return;
  248.   }
  249.   
  250.   
  251.   /**
  252.    * Retrieves all columns from a given table
  253.    * @return mixed either an array with columns or a boolean FALSE
  254.    * @access private
  255.    ***/
  256.   function _getTableColumns($table_name
  257.   {
  258.     $wpdb $this->_wpdb;
  259.     $query sprintf("DESCRIBE %s"$table_name);
  260.     $result $wpdb->get_results($query);
  261.     $return is_array($result$result FALSE;
  262.     return $return;
  263.   }
  264.   
  265.   /**
  266.    * Converts a given column's type of a given table to its binary counterpart according to
  267.    * the list below:
  268.    *
  269.    *  CHAR -> BINARY
  270.    *  VARCHAR -> VARBINARY
  271.    *  TINYTEXT -> TINYBLOB
  272.    *  TEXT -> BLOB
  273.    *  MEDIUMTEXT -> MEDIUMBLOB
  274.    *  LONGTEXT -> LONGBLOB
  275.    *
  276.    * Columns with the type ENUM and SET will be set to character set binary
  277.    * @return string performed query
  278.    * @access private
  279.    ***/
  280.   function _binarizeTableColumn($table_name$column
  281.   {
  282.     ifis_string($table_name|| is_object($column) ) return -1// make sure we get the right types to work with
  283.       $wpdb $this->_wpdb;
  284.       // text columns do not need any other processing...so we'll switch them to their binary counterparts directly
  285.       switch ($column->Type{
  286.         case 'tinytext':
  287.           $query sprintf("ALTER TABLE %s CHANGE %s %s TINYBLOB NOT NULL"$table_name$column->Field$column->Field);
  288.         break;
  289.         
  290.         case 'text':
  291.           $query sprintf("ALTER TABLE %s CHANGE %s %s BLOB NOT NULL"$table_name$column->Field$column->Field);
  292.         break;
  293.       
  294.         case 'mediumtext':
  295.           $query sprintf("ALTER TABLE %s CHANGE %s %s MEDIUMBLOB NOT NULL"$table_name$column->Field$column->Field);
  296.         break;
  297.         
  298.         case 'longtext':
  299.           $query sprintf("ALTER TABLE %s CHANGE %s %s LONGBLOB NOT NULL"$table_name$column->Field$column->Field);
  300.         break;
  301.         
  302.         // some other column types we're interested in need some additional processing 
  303.         default:
  304.           $col_type_info $this->_processColumnInfo($column);
  305.           ifis_array($col_type_info) ) {
  306.             switch($col_type_info[0]{
  307.             
  308.               case 'char':
  309.                 $query sprintf("ALTER TABLE %s CHANGE %s %s BINARY ( %d ) NOT NULL"$table_name$column->Field$column->Field$col_type_info[1]);
  310.               break;
  311.                 
  312.               case 'varchar':
  313.                 $query sprintf("ALTER TABLE %s CHANGE %s %s VARBINARY ( %d ) NOT NULL"$table_name$column->Field$column->Field$col_type_info[1]);
  314.               break;
  315.               
  316.               case 'enum':
  317.                 if$this->isColumnCharSetBinary($table_name$column->Field) ) {
  318.                   $query null;
  319.                 else {
  320.                   $query sprintf("ALTER TABLE %s CHANGE %s %s %s( %s ) CHARACTER SET binary NOT NULL"$table_name$column->Field$column->Field$col_type_info[0]$col_type_info[1]);
  321.                 }
  322.               break;
  323.                 
  324.               case 'set':
  325.                 if$this->isColumnCharSetBinary($table_name$column->Field) ) {
  326.                   $query null;
  327.                 else {
  328.                   $query sprintf("ALTER TABLE %s CHANGE %s %s %s( %s ) CHARACTER SET binary NOT NULL"$table_name$column->Field$column->Field$col_type_info[0]$col_type_info[1]);
  329.                 }
  330.               break;
  331.             }
  332.           }
  333.         break;
  334.       }
  335.       
  336.       ifis_null($query) ) {
  337.         $result $wpdb->query($query);
  338.         return "<span style='font-size: 50%';>Performed query: $query</span><br />\n";
  339.       }
  340.   }
  341.   
  342.   
  343.   
  344.   /**
  345.    * Converts a given column's binary type of a given table to its previous non-binary type according to
  346.    * the list below:
  347.    *
  348.    *  BINARY -> CHAR
  349.    *  VARBINARY -> VARCHAR
  350.    *  TINYBLOB -> TINYTEXT
  351.    *  BLOB -> TEXT
  352.    *  MEDIUMBLOB -> MEDIUMTEXT
  353.    *  LONGBLOB -> LONGTEXT
  354.    *
  355.    * Columns with the type ENUM and SET will be set to character set utf8
  356.    * @return string performed query
  357.    * @access private
  358.    ***/
  359.   function _deBinarizeTableColumn($table_name$column
  360.   {
  361.     ifis_string($table_name|| is_object($column) ) return -1// make sure we get the right types to work with
  362.       $wpdb $this->_wpdb;
  363.       // these columns do not need any other processing...so we'll switch them to their original type directly
  364.       switch ($column->Type{
  365.         case 'tinyblob':
  366.           $query sprintf("ALTER TABLE %s CHANGE %s %s TINYTEXT NOT NULL"$table_name$column->Field$column->Field);
  367.         break;
  368.         
  369.         case 'blob':
  370.           $query sprintf("ALTER TABLE %s CHANGE %s %s TEXT NOT NULL"$table_name$column->Field$column->Field);
  371.         break;
  372.       
  373.         case 'mediumblob':
  374.           $query sprintf("ALTER TABLE %s CHANGE %s %s MEDIUMTEXT NOT NULL"$table_name$column->Field$column->Field);
  375.         break;
  376.         
  377.         case 'longblob':
  378.           $query sprintf("ALTER TABLE %s CHANGE %s %s LONGTEXT NOT NULL"$table_name$column->Field$column->Field);
  379.         break;
  380.         
  381.         // some other column types we're interested in need some additional processing 
  382.         default:
  383.           $col_type_info $this->_processColumnInfo($column);
  384.           ifis_array($col_type_info) ) {
  385.             switch($col_type_info[0]{
  386.             
  387.               case 'binary':
  388.                 $query sprintf("ALTER TABLE %s CHANGE %s %s CHAR ( %d ) NOT NULL"$table_name$column->Field$column->Field$col_type_info[1]);
  389.               break;
  390.                 
  391.               case 'varbinary':
  392.                 $query sprintf("ALTER TABLE %s CHANGE %s %s VARCHAR ( %d ) NOT NULL"$table_name$column->Field$column->Field$col_type_info[1]);
  393.               break;
  394.               
  395.               case 'enum':
  396.                 if$this->isColumnCharSetBinary($table_name$column->Field) ) {
  397.                   $query sprintf("ALTER TABLE %s CHANGE %s %s %s( %s ) CHARACTER SET utf8 NOT NULL"$table_name$column->Field$column->Field$col_type_info[0]$col_type_info[1]);
  398.                 else {
  399.                   $query null;
  400.                 }
  401.               break;
  402.                 
  403.               case 'set':
  404.                 if$this->isColumnCharSetBinary($table_name$column->Field) ) {
  405.                   $query sprintf("ALTER TABLE %s CHANGE %s %s %s( %s ) CHARACTER SET utf8 NOT NULL"$table_name$column->Field$column->Field$col_type_info[0]$col_type_info[1]);
  406.                 else {
  407.                   $query null;                  
  408.                 }
  409.               break;
  410.             }
  411.           }
  412.         break;
  413.       }
  414.       
  415.       ifis_null($query) ) {
  416.         $result $wpdb->query($query);
  417.         return "<span style='font-size: 50%';>Performed query: $query</span><br />\n";
  418.       }
  419.   
  420.   
  421.   /**
  422.    * Expects a column object and returns the column type and extra info in an array
  423.    * @param object column 
  424.    * @return mixed int -1 when not using the appropriate parameter or an array with column data: $array[0] = column type such as vaechar,
  425.    *  $array[1] = type size info such as 255 or a boolean FALSE when no info could be retrieved
  426.    * @access private
  427.    ***/
  428.   function _processColumnInfo($column
  429.   {
  430.     ifis_object($column) ) return -1// make sure we get an object
  431.     $col_type_info explode('('$column->Type);
  432.     ifis_array($col_type_info&& sizeof($col_type_info== 2{
  433.       $col_type_info[1trim($col_type_info[1]")");
  434.       $col_type_info[1trim($col_type_info[1]") unsigned");
  435.       $col_type_info[1trim($col_type_info[1]") signed");
  436.       return $col_type_info
  437.     }
  438.     // fall thru
  439.     return FALSE;
  440.   
  441.   
  442.   
  443.   /**
  444.    * Retrieves a column's character set
  445.    * @param string table name
  446.    * @param string column name
  447.    * @param string database name; Optional, defaults to DB_NAME set in wp-config.php
  448.    * @return mixed string character set or a boolean FALSE when no info could be retrieved
  449.    * @access private
  450.    ***/
  451.   function _getColumnCharacterSet($table_name$column_name$database_name DB_NAME
  452.   {
  453.     $wpdb $this->_wpdb;
  454.     $query sprintf("SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '%s' AND table_schema = '%s' AND column_name = '%s'"$table_name$database_name$column_name);
  455.     $result $wpdb->get_var($query);
  456.     $return is_null($resultFALSE $result;
  457.     return $return
  458.   
  459.   
  460.   
  461.   /**
  462.    * Retrieves a table's collation
  463.    * @param string table name
  464.    * @param string database name; Optional, defaults to DB_NAME set in wp-config.php
  465.    * @return mixed string collation type or a boolean FALSE when no info could be retrieved
  466.    * @access private
  467.    ***/
  468.   function _getTableCollation($table_name$database_name DB_NAME
  469.   {
  470.     $wpdb $this->_wpdb;
  471.     $query sprintf("SELECT TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE table_name = '%s' AND table_schema = '%s'"$table_name$database_name);
  472.     $result $wpdb->get_var($query);
  473.     $return is_null($resultFALSE $result;
  474.     return $return;
  475.   }
  476.   
  477.   /**
  478.    * Check if a column's character set is binary or not (wraps _getColumnCharacterSet in it..)
  479.    * @param string table name
  480.    * @param string column name
  481.    * @param string database name; Optional, defaults to DB_NAME set in wp-config.php
  482.    * @return boolean FALSE when no info could be retrieved or character set is not binary. TRUE if character set is binary
  483.    * @access public
  484.    ***/
  485.   function isColumnCharSetBinary($table_name$column_name$database_name DB_NAME
  486.   {
  487.     $result $this->_getColumnCharacterSet($table_name$column_name$database_name DB_NAME);
  488.     ifis_string($result) ) {
  489.       ifstrtolower($result=== 'binary'{
  490.         return TRUE;
  491.       }
  492.     }
  493.     // fall thru..
  494.     return FALSE;
  495.   }
  496.   
  497.   /**
  498.    * Sets a table's character set to utf8
  499.    * @param string table name
  500.    * @param string collation; Optional defaults to utf8_general_ci
  501.    * @return string the performed query
  502.    * @access public
  503.    ***/
  504.    function convertTable2UTF8($table_name$collation 'utf8_general_ci'
  505.    {
  506.      $wpdb $this->_wpdb;
  507.      $query sprintf("ALTER TABLE `%s` DEFAULT CHARACTER SET utf8 COLLATE %s"$table_name$collation);
  508.      $result $wpdb->query($query);
  509.      return "<span style='font-size: 50%';>Performed query: $query</span><br />\n";
  510.    }
  511.  
  512.    
  513.    
  514.   /**
  515.    * Sets a database's character set to utf8
  516.    * @param string database name; Optional defaults to DB_NAME set in wp-config.php
  517.    * @param string collation; Optional defaults to utf8_general_ci
  518.    * @return string the performed query
  519.    * @access public
  520.    ***/
  521.    function convertDatabase2UTF8($database_name DB_NAME$collation 'utf8_general_ci'
  522.    {
  523.      $wpdb $this->_wpdb;
  524.      $query sprintf("ALTER DATABASE `%s` DEFAULT CHARACTER SET utf8 COLLATE %s"$database_name$collation);
  525.      $result $wpdb->query($query);
  526.      return "<span style='font-size: 50%';>Performed query: $query</span><br />\n";
  527.    }
  528.    
  529.    /**
  530.     * Retrieve the current database's character set
  531.     * @access public
  532.     * @return mixed object with character set or boolean FALSE
  533.    ***/
  534.    {
  535.      $wpdb $this->_wpdb;
  536.      $result $wpdb->get_row('SHOW VARIABLES LIKE "character_set_database"');
  537.      $return is_object($result$result FALSE;
  538.      return $return;
  539.    }
  540.    
  541.    
  542.    /**
  543.    * Checks if we're dealing with Wordpress MU or not by checking the existance of wpmu-settings.php
  544.    * @return boolean TRUE when its Wordpress MU or FALSE when not
  545.    * @access public
  546.    ***/
  547.    function isWPMU(return file_existsABSPATH '/wpmu-settings.php')}
  548. }
  549.  
  550. // initialize..
  551. $bbWP2UTF8 new bbWP2UTF8();
  552. ?>

Documentation generated on Tue, 01 Jul 2008 16:28:16 +0200 by phpDocumentor 1.4.2