Source for file install.php
Documentation is available at install.php
* Tera_WURFL - PHP MySQL driven WURFL
* Tera-WURFL was written by Steve Kamerman, and is based on the
* Java WURFL Evolution package by Luca Passani and WURFL PHP Tools by Andrea Trassati.
* This version uses a MySQL database to store the entire WURFL file, multiple patch
* files, and a persistent caching mechanism to provide extreme performance increases.
* @package TeraWurflAdmin
* @author Steve Kamerman <stevekamerman AT gmail.com>
* @version Stable 2.1.3 $Date: 2010/09/18 15:43:21
* @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
require_once realpath(dirname(__FILE__ ). '/../TeraWurfl.php');
$logfile = TeraWurflConfig::$LOG_FILE;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tera-WURFL Installation</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<div align="center" class="titlediv">
<p> Tera-WURFL <?php echo $tw->release_version; ?> Administration<br />
<table width="800" border="0" cellspacing="0" cellpadding="0">
<th colspan="2" scope="col">Checking Installation </th>
<td colspan="2" valign="bottom" class="darkrow"><p><strong><u>PHP Configuration</u></strong>
<td width="17" class="lightrow"><img src="triangle.gif" width="10" height="11" /></td>
<td width="783" class="lightrow"><strong>PHP Version</strong>:
echo PHP_VERSION. "... OK";
echo "<span class=\"error\">ERROR:</span> PHP ". TeraWurfl::$required_php_version. " is required but you have ". PHP_VERSION;
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>ZipArchive Support</strong> <?php
echo "... <span class=\"error\">WARNING</span><br/> In order to update the WURFL File from the Internet, you must have support for the <strong>ZipArchive module</strong>.
This module is included with PHP since 5.2.0. You can get the ZipArchive class from the <a href=\"http://pecl.php.net/package/zip\" target=\"_blank\">PECL Zip package</a>.
Note: you can still use Tera-WURFL without ZipArchive, Tera-WURFL will attempt to call the gunzip program from your system to unzip the compressed WURFL archive.
If this fails, you must download the archive manually and extract wurfl.xml to your data/ directory.";
<td class="lightrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="lightrow"><strong>MySQLi Support</strong> <?php
if(class_exists("MySQLi")){ // SQL Driver for PHP: function_exists("sqlsrv_connect")
echo "... <span class=\"error\">WARNING</span><br/>Since version 2.0, Tera-WURFL requires the <strong>MySQLi</strong> module to use MySQL. More information about obtaining MySQLi is available at <a href=\"http://www.php.net/manual/en/book.mysqli.php\" target=\"_blank\">www.php.net</a>.<br/><br/>
If you are using the <i>EXPERIMENTAL</i> Microsoft SQL Server DatabaseConnector you can ignore this error message, however, you will need the <a href=\"http://msdn.microsoft.com/en-us/library/ms131321.aspx\" target=\"_blank\">SQL Server Native Client</a> and <a href=\"http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9\" target=\"_blank\">SQL Server Driver for PHP 1.1</a> installed.";
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>PHP Memory Limit</strong>:
echo TeraWurflConfig::$MEMORY_LIMIT. " (via TeraWurflConfig::\$MEMORY_LIMIT)";
echo ini_get("memory_limit"). " (via php.ini)";
?><br/><strong>When you update the WURFL, PHP may consume over 200MB of RAM while parsing, sorting and indexing the data.</strong></td>
<td colspan="2" valign="bottom" class="darkrow"><p><strong><u>File Permissions</u></strong>
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>WURFL File</strong>: <?php echo $dir. TeraWurflConfig::$WURFL_FILE?>...
echo "<span class=\"error\">WARNING:</span> File doesn't exist or isn't readable. You can continue like this, you just can't update the database from your local wurfl.xml.";
<td class="lightrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="lightrow"><strong>PATCH Files</strong>:<br/>
foreach($files as $thisfile){
if(is_file($dir. $thisfile) && is_readable($dir. $thisfile))
echo "<span class=\"error\">WARNING:</span> File doesn't exist or isn't readable. You may ignore this error if patching is disabled.<br/>";
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>DATA Directory</strong>: <?php echo $dir?>...
echo "<span class=\"error\">ERROR:</span> Directory doesn't exist or isn't writeable. This directory should be owned by the webserver user or chmoded to 777 for the log file and the online updates to work. </br>Here's the best way to do it in Ubuntu:<br/><pre>sudo chgrp -R www-data data/
sudo chmod -R g+rw data/</pre>";
<td colspan="2" valign="bottom" class="darkrow"><p><strong><u>Database Settings</u></strong></p></td>
<td class="lightrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="lightrow"><strong>Host</strong>: <?php echo TeraWurflConfig::$DB_HOST?></td>
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>Username</strong>: <?php echo TeraWurflConfig::$DB_USER?></td>
<td class="lightrow"><span class="lightrow"><img src="triangle.gif" width="10" height="11" /></span></td>
<td class="lightrow"><strong>Connecting to DB server</strong>...
if(!class_exists('MySQLi')){
echo "<span class=\"error\">ERROR:</span> MySQLi is not installed or enabled, see errors above.";
$errors = $tw->db->verifyConfig();
foreach($errors as $error){
echo "<br/><span class=\"error\">ERROR:</span> $error";
<td class="darkrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="darkrow"><strong>DB Server Version</strong>:
echo "<span class=\"error\">ERROR:</span> The version number cannot be determined because you are not connected.";
$mysql_raw_version = $tw->db->getServerVersion();
if($mysql_raw_version !== false){
$mysql_version = (int) $mysql_raw_version[0];
echo $mysql_raw_version. "<br/>";
echo "<span class=\"error\">NOTICE:</span> You are using the MySQL4 connector with MySQL5. Although this will work, the MySQL5 connector provides much better performance.
Since the MySQL4 connector does not use Stored Procedures, you can also use it if you want to use MySQL5 without Stored Procedures.";
}elseif(TeraWurflConfig::$DB_CONNECTOR == "MySQL5" && $mysql_version < 5){
echo "<span class=\"error\">ERROR:</span> You are using the MySQL5 connector with MySQL4. Please change the DatabaseConnector to MySQL4.";
<td class="lightrow"><img src="triangle.gif" width="10" height="11" /></td>
<td class="lightrow"><strong>DB Name</strong> (schema): <?php echo TeraWurflConfig::$DB_SCHEMA?></td>
<td><div align="left" style="padding-left:15px;"><br />
If everything looks ok, <strong>delete <?php echo $tw->rootdir; ?>admin/install.php</strong>, then update your database from one of the following sources:
<ul><li><a href="updatedb.php?source=local">Your local WURFL file</a> ( <?php echo TeraWurflConfig::$WURFL_FILE?>)</li>
<li><a href="updatedb.php?source=remote">The current released WURFL</a> ( <?php echo TeraWurflConfig::$WURFL_DL_URL?>)</li>
<!-- <li><a href="updatedb.php?source=remote_cvs">The current CVS WURFL</a> ( <?php echo TeraWurflConfig::$WURFL_CVS_URL?>)</li> -->
|