Author: shanti
Date: Mon Mar 2 21:04:31 2009
New Revision: 749434
URL: http://svn.apache.org/viewvc?rev=749434&view=rev
Log:
Fix for OLIO-33 in the PHP web application. With these changes, the only
pending name changes from 'web20' to 'olio' is the name of the database and the
user/password to the database. These are being left unchanged for now so as not
to force users to recreate their database.
Modified:
incubator/olio/webapp/php/trunk/build.xml
incubator/olio/webapp/php/trunk/classes/CacheSystem.php
incubator/olio/webapp/php/trunk/classes/DBConnection.php
incubator/olio/webapp/php/trunk/classes/FileSystem.php
incubator/olio/webapp/php/trunk/classes/Geocoder.php
incubator/olio/webapp/php/trunk/classes/LocalFS.php
incubator/olio/webapp/php/trunk/classes/MemCached.php
incubator/olio/webapp/php/trunk/classes/MogileFS.php
incubator/olio/webapp/php/trunk/classes/ODBCConnection.php
incubator/olio/webapp/php/trunk/classes/PDOConnection.php
incubator/olio/webapp/php/trunk/etc/config.php
incubator/olio/webapp/php/trunk/public_html/addPersonResult.php
incubator/olio/webapp/php/trunk/public_html/fileService.php
incubator/olio/webapp/php/trunk/public_html/getAppConfig.php
incubator/olio/webapp/php/trunk/views/addEvent.php
incubator/olio/webapp/php/trunk/views/addPerson.php
incubator/olio/webapp/php/trunk/views/site.php
Modified: incubator/olio/webapp/php/trunk/build.xml
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/build.xml?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/build.xml (original)
+++ incubator/olio/webapp/php/trunk/build.xml Mon Mar 2 21:04:31 2009
@@ -4,10 +4,10 @@
*
* Use is subject to license terms.
-->
-<project name="Web20PHP" default="package">
+<project name="OlioPHP" default="package">
<target name="package">
- <zip destfile="web20php2.zip">
- <zipfileset dir="." prefix="web20php2">
+ <zip destfile="oliophp.zip">
+ <zipfileset dir="." prefix="oliophp">
<include name="classes/**"/>
<include name="controllers/**"/>
<include name="etc/**"/>
Modified: incubator/olio/webapp/php/trunk/classes/CacheSystem.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/CacheSystem.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/CacheSystem.php (original)
+++ incubator/olio/webapp/php/trunk/classes/CacheSystem.php Mon Mar 2 21:04:31
2009
@@ -20,13 +20,13 @@
abstract class CacheSystem {
static function getInstance() {
- $classname = Web20::$config['cacheSystem'];
+ $classname = Olio::$config['cacheSystem'];
return new $classname;
}
static function isCachingActive()
{
- return Web20::$config['cacheSystem'] != 'NoCache';
+ return Olio::$config['cacheSystem'] != 'NoCache';
}
abstract function flush();
Modified: incubator/olio/webapp/php/trunk/classes/DBConnection.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/DBConnection.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/DBConnection.php (original)
+++ incubator/olio/webapp/php/trunk/classes/DBConnection.php Mon Mar 2
21:04:31 2009
@@ -24,21 +24,21 @@
static function getInstance() {
- $classname = Web20::$config['dbDriver'] . 'Connection';
+ $classname = Olio::$config['dbDriver'] . 'Connection';
$instance = new $classname;
$instance->writeInstance = false;
return $instance;
}
static function getWriteInstance() {
- $classname = Web20::$config['dbDriver'] . 'Connection';
+ $classname = Olio::$config['dbDriver'] . 'Connection';
$instance = new $classname;
$instance->writeInstance = true;
return $instance;
}
function selectInstance() {
- $this->dbTarget = Web20::$config['dbTarget'];
+ $this->dbTarget = Olio::$config['dbTarget'];
if (is_array($this->dbTarget)) {
if ($this->writeInstance || count($this->dbTarget) == 1) {
$this->dbTarget = $this->dbTarget[0];
@@ -60,4 +60,4 @@
abstract function rollback();
}
-?>
\ No newline at end of file
+?>
Modified: incubator/olio/webapp/php/trunk/classes/FileSystem.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/FileSystem.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/FileSystem.php (original)
+++ incubator/olio/webapp/php/trunk/classes/FileSystem.php Mon Mar 2 21:04:31
2009
@@ -20,7 +20,7 @@
abstract class FileSystem {
static function getInstance() {
- $classname = Web20::$config['fileSystem'];
+ $classname = Olio::$config['fileSystem'];
return new $classname;
}
Modified: incubator/olio/webapp/php/trunk/classes/Geocoder.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/Geocoder.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/Geocoder.php (original)
+++ incubator/olio/webapp/php/trunk/classes/Geocoder.php Mon Mar 2 21:04:31
2009
@@ -27,7 +27,7 @@
$this->city = $city;
$this->state = $state;
$this->zip = $zip;
- $url = Web20::$config['geocoderURL'].'?appid=gsd5f&street='.
+ $url = Olio::$config['geocoderURL'].'?appid=gsd5f&street='.
$this->street.'&city='.$this->city.
'&state='.$this->state.'&zip='.$this0->zip;
$stream = $this->curl_string($url);
@@ -43,7 +43,7 @@
private function curl_string($url) {
$ch = curl_init();
- $geoProxy = trim(Web20::$config['proxy']);
+ $geoProxy = trim(Olio::$config['proxy']);
if (strlen($geoProxy) > 0) {
curl_setopt($ch, CURLOPT_PROXY, $geoProxy);
} else {
Modified: incubator/olio/webapp/php/trunk/classes/LocalFS.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/LocalFS.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/LocalFS.php (original)
+++ incubator/olio/webapp/php/trunk/classes/LocalFS.php Mon Mar 2 21:04:31 2009
@@ -26,7 +26,7 @@
class LocalFS extends FileSystem {
function __construct() {
- $this->localFSRoot = Web20::$config['localfsRoot'];
+ $this->localFSRoot = Olio::$config['localfsRoot'];
}
function getRootDir() {
Modified: incubator/olio/webapp/php/trunk/classes/MemCached.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/MemCached.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/MemCached.php (original)
+++ incubator/olio/webapp/php/trunk/classes/MemCached.php Mon Mar 2 21:04:31
2009
@@ -22,7 +22,7 @@
function __construct() {
// TODO: Support host:port arrays.
$this->memcache = new Memcache();
- foreach (Web20::$config['memcachedHosts'] as $host) {
+ foreach (Olio::$config['memcachedHosts'] as $host) {
list($ip,$port)=split(':',$host,2);
if ($port == null)
$port = 11211;
Modified: incubator/olio/webapp/php/trunk/classes/MogileFS.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/MogileFS.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/MogileFS.php (original)
+++ incubator/olio/webapp/php/trunk/classes/MogileFS.php Mon Mar 2 21:04:31
2009
@@ -32,9 +32,9 @@
* TODO
*/
function __construct() {
- $this->domain = Web20::$config['mogilefsDomain'];
- $this->hosts = Web20::$config['mogilefsHosts'];
- $this->root = Web20::$config['mogilefsRoot'];
+ $this->domain = Olio::$config['mogilefsDomain'];
+ $this->hosts = Olio::$config['mogilefsHosts'];
+ $this->root = Olio::$config['mogilefsRoot'];
$this->error = '';
}
Modified: incubator/olio/webapp/php/trunk/classes/ODBCConnection.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/ODBCConnection.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/ODBCConnection.php (original)
+++ incubator/olio/webapp/php/trunk/classes/ODBCConnection.php Mon Mar 2
21:04:31 2009
@@ -27,7 +27,7 @@
}
if (!isset($this->connection)) {
$this->connection = odbc_connect($this->dbTarget,
- Web20::$config['dbUser'], Web20::$config['dbPass']);
+ Olio::$config['dbUser'], Olio::$config['dbPass']);
if (is_resource($this->connection))
throw new Exception("Unable to connect ".$this->dbTarget."!");
}
Modified: incubator/olio/webapp/php/trunk/classes/PDOConnection.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/classes/PDOConnection.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/classes/PDOConnection.php (original)
+++ incubator/olio/webapp/php/trunk/classes/PDOConnection.php Mon Mar 2
21:04:31 2009
@@ -27,7 +27,7 @@
}
if (!isset($this->connection)) {
$this->connection = new PDO($this->dbTarget,
- Web20::$config['dbUser'], Web20::$config['dbPass'],
+ Olio::$config['dbUser'], Olio::$config['dbPass'],
array(PDO::ATTR_PERSISTENT => true));
$this->connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
$this->connection->setAttribute( // throw exception on error.
Modified: incubator/olio/webapp/php/trunk/etc/config.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/etc/config.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/etc/config.php (original)
+++ incubator/olio/webapp/php/trunk/etc/config.php Mon Mar 2 21:04:31 2009
@@ -17,43 +17,43 @@
* limitations under the License.
*/
-$web20config['includes'] = $_SERVER['DOCUMENT_ROOT'] . '/../includes/';
+$olioconfig['includes'] = $_SERVER['DOCUMENT_ROOT'] . '/../includes/';
-$web20config['dbDriver'] = 'PDO'; // Which DB driver to use.
-// $web20config['dbTarget'] = 'myodbc3'; // ODBC target in odbc.ini.
+$olioconfig['dbDriver'] = 'PDO'; // Which DB driver to use.
+// $olioconfig['dbTarget'] = 'myodbc3'; // ODBC target in odbc.ini.
-$web20config['dbTarget'] = 'mysql:host=localhost;dbname=web20load'; // PDO
target.
+$olioconfig['dbTarget'] = 'mysql:host=localhost;dbname=web20load'; // PDO
target.
// For master/slave clusters, specify dbTarget as an array, listing the master
first.
-// $web20config['dbTarget'] = array('mysql:host=master;dbname=web20load',
+// $olioconfig['dbTarget'] = array('mysql:host=master;dbname=web20load',
// 'mysql:host=slave1;dbname=web20load',
// 'mysql:host=slave2;dbname=web20load');
-$web20config['dbUser'] = 'web20'; // DB user name.
+$olioconfig['dbUser'] = 'web20'; // DB user name.
-$web20config['dbPass'] = 'web20'; // DB password.
+$olioconfig['dbPass'] = 'web20'; // DB password.
-$web20config['cacheSystem'] = 'MemCached';
+$olioconfig['cacheSystem'] = 'MemCached';
// Use below line for no cache - WARNING: db load will increase
-//$web20config['cacheSystem'] = 'NoCache';
+//$olioconfig['cacheSystem'] = 'NoCache';
-$web20config['cacheExpire'] = 7200; // Expiry time for memcache on set
function in seconds
+$olioconfig['cacheExpire'] = 7200; // Expiry time for memcache on set function
in seconds
-$web20config['fileSystem'] = 'LocalFS';
+$olioconfig['fileSystem'] = 'LocalFS';
-$web20config['localfsRoot'] = '/filestore';
+$olioconfig['localfsRoot'] = '/filestore';
-$web20config['memcachedHosts'] = array('MEMCACHED_HOST:11211'); // memcached
host ip
+$olioconfig['memcachedHosts'] = array('MEMCACHED_HOST:11211'); // memcached
host ip
// For multiple instances, use the below line
-// $web20config['memcachedHosts'] = array('MEMCACHED_HOST1:port',
'MEMCACHED_HOST2:port'); // memcached host ip
+// $olioconfig['memcachedHosts'] = array('MEMCACHED_HOST1:port',
'MEMCACHED_HOST2:port'); // memcached host ip
-$web20config['geocoderURL'] = 'http://GEOCODER_HOST:8080/geocoder/geocode';
//Geocoder URL
+$olioconfig['geocoderURL'] = 'http://GEOCODER_HOST:8080/geocoder/geocode';
//Geocoder URL
-class Web20 {
+class Olio {
public static $config;
}
// Make the config available through the static in the class.
-Web20::$config = $web20config;
+Olio::$config = $olioconfig;
function __autoload($class_name)
{
Modified: incubator/olio/webapp/php/trunk/public_html/addPersonResult.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/public_html/addPersonResult.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/public_html/addPersonResult.php (original)
+++ incubator/olio/webapp/php/trunk/public_html/addPersonResult.php Mon Mar 2
21:04:31 2009
@@ -65,8 +65,8 @@
unlink($user_image_location);
unlink($thumb_location);
} else {
- $modified_image_name = Web20::$config['includes'] .
"userphotomissing.gif";
- $imagethumb = Web20::$config['includes'] .
"userphotomissing.gif";
+ $modified_image_name = Olio::$config['includes'] .
"userphotomissing.gif";
+ $imagethumb = Olio::$config['includes'] .
"userphotomissing.gif";
}
$geocode = new Geocoder($street1, $city, $state, $zip);
Modified: incubator/olio/webapp/php/trunk/public_html/fileService.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/public_html/fileService.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/public_html/fileService.php (original)
+++ incubator/olio/webapp/php/trunk/public_html/fileService.php Mon Mar 2
21:04:31 2009
@@ -58,7 +58,7 @@
$fs = FileSystem::getInstance();
$paths = $fs->getPaths($fileName);
- //$cache->set($fileName, $paths, 0, Web20::$config['cacheExpire']);
+ //$cache->set($fileName, $paths, 0, Olio::$config['cacheExpire']);
$path_keys = array_keys($paths);
$pathkeycount = count($path_keys);
$i=0;
@@ -73,7 +73,7 @@
} else {
$contentType = $mimeTypes['gif'];
header('Content-Type: ' . $contentType);
- readfile(Web20::$config['includes'] . 'notavailable.gif');
+ readfile(Olio::$config['includes'] . 'notavailable.gif');
}
// }else{
// $path_keys = array_keys($memcachegetPaths);
@@ -90,7 +90,7 @@
// }
// if ($cacheFlag == "true"){
- // $cache->set($filename, file_get_contents($filename),
$web20config['cacheExpire']);
+ // $cache->set($filename, file_get_contents($filename),
$olioconfig['cacheExpire']);
// }
// } else {
// echo $content;
Modified: incubator/olio/webapp/php/trunk/public_html/getAppConfig.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/public_html/getAppConfig.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/public_html/getAppConfig.php (original)
+++ incubator/olio/webapp/php/trunk/public_html/getAppConfig.php Mon Mar 2
21:04:31 2009
@@ -21,19 +21,19 @@
echo "This is the configuration setup for the application........<br/>";
echo "<br/>";
-echo "<b>Installation base for apache package : </b>
".$web20config['apacheinstallBase']."<br/>";
-echo "<b>Installation base for php : </b>
".$web20config['phpinstallBase']."<br/>";
-echo "<b>Installation base for mysql : </b>
".$web20config['mysqlinstallBase']."<br/>";
-echo "<b>Installation base for memcached : </b>
".$web20config['memcachedinstallBase']."<br/>";
-echo "<b>Installation base for mogilefs : </b>
".$web20config['mogilefsinstallBase']."<br/>";
-echo "<b>The directory that directly corresponds to urlBase : </b>
".$web20config['siteBase']."<br/>";
-echo "<b>Base url for the site : </b>
".$web20config['urlBase']."<br/>";
-echo "<b>Expiry time for memcache on set function in seconds : </b>
".$web20config['cacheExpire']."<br/>";
-echo "<b>Mogilefs host ip & port number : </b>
".$web20config['mogilefsHost']."<br/>";
-echo "<b>Memcached host ip : </b>
".$web20config['memcachedHost']."<br/>";
-echo "<b>Gecoder Emulator host ip : </b>
".$web20config['geocoderHost']."<br/>";
-echo "<b>Flag set for 'onuseradd' tag : </b>
".$web20config['onuseradd']."<br/>";
-echo "<b>Flag set for 'personrequested' tag : </b>
".$web20config['personrequested']."<br/>";
-echo "<b>Flag set for 'top10events' tag : </b>
".$web20config['top10events']."<br/>";
-echo "<b>Flag set for 'tagcloud' tag : </b>
".$web20config['tagcloud']."<br/>";
+echo "<b>Installation base for apache package : </b>
".$olioconfig['apacheinstallBase']."<br/>";
+echo "<b>Installation base for php : </b>
".$olioconfig['phpinstallBase']."<br/>";
+echo "<b>Installation base for mysql : </b>
".$olioconfig['mysqlinstallBase']."<br/>";
+echo "<b>Installation base for memcached : </b>
".$olioconfig['memcachedinstallBase']."<br/>";
+echo "<b>Installation base for mogilefs : </b>
".$olioconfig['mogilefsinstallBase']."<br/>";
+echo "<b>The directory that directly corresponds to urlBase : </b>
".$olioconfig['siteBase']."<br/>";
+echo "<b>Base url for the site : </b>
".$olioconfig['urlBase']."<br/>";
+echo "<b>Expiry time for memcache on set function in seconds : </b>
".$olioconfig['cacheExpire']."<br/>";
+echo "<b>Mogilefs host ip & port number : </b>
".$olioconfig['mogilefsHost']."<br/>";
+echo "<b>Memcached host ip : </b>
".$olioconfig['memcachedHost']."<br/>";
+echo "<b>Gecoder Emulator host ip : </b>
".$olioconfig['geocoderHost']."<br/>";
+echo "<b>Flag set for 'onuseradd' tag : </b>
".$olioconfig['onuseradd']."<br/>";
+echo "<b>Flag set for 'personrequested' tag : </b>
".$olioconfig['personrequested']."<br/>";
+echo "<b>Flag set for 'top10events' tag : </b>
".$olioconfig['top10events']."<br/>";
+echo "<b>Flag set for 'tagcloud' tag : </b>
".$olioconfig['tagcloud']."<br/>";
?>
Modified: incubator/olio/webapp/php/trunk/views/addEvent.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/views/addEvent.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/views/addEvent.php (original)
+++ incubator/olio/webapp/php/trunk/views/addEvent.php Mon Mar 2 21:04:31 2009
@@ -57,28 +57,28 @@
<label for="event_timestamp">Event date and time</label><br/>
<select id="year" name="year">
<?
- require(Web20::$config['includes'] . "year.php");
+ require(Olio::$config['includes'] . "year.php");
?>
</select>
<select id="month" name="month">
<?
- require(Web20::$config['includes'] . "month.php");
+ require(Olio::$config['includes'] . "month.php");
?>
</select>
<select id="day" name="day">
<?
- require(Web20::$config['includes'] . "day.php");
+ require(Olio::$config['includes'] . "day.php");
?>
</select>
—<br/>
<select id="hour" name="hour">
<?
- require(Web20::$config['includes'] . "hour.php");
+ require(Olio::$config['includes'] . "hour.php");
?>
</select>
: <select id="minute" name="minute">
<?
- require(Web20::$config['includes'] . "minute.php");
+ require(Olio::$config['includes'] . "minute.php");
?>
</select>
</p>
@@ -130,7 +130,7 @@
<label for="country">Country</label>
<select id="country" name="country">
<?
- readfile(Web20::$config['includes'] . "countries.html");
+ readfile(Olio::$config['includes'] . "countries.html");
if(!is_null($se)){
echo '<option selected="selected"
value="'.$country.'">'.$country.'</option>';
}
Modified: incubator/olio/webapp/php/trunk/views/addPerson.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/views/addPerson.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/views/addPerson.php (original)
+++ incubator/olio/webapp/php/trunk/views/addPerson.php Mon Mar 2 21:04:31 2009
@@ -88,7 +88,7 @@
<label for="timezone">Timezone</label>
<select id="timezone" name="timezone">
<?
- readfile(Web20::$config['includes'] . "timezones.html");
+ readfile(Olio::$config['includes'] . "timezones.html");
if(!is_null($uname)){
echo '<option selected="selected" value="'.$tz.'">'.$tz.'</option>';
}
@@ -126,7 +126,7 @@
<label for="country">Country</label>
<select id="country" name="country">
<?
- readfile(Web20::$config['includes'] . "countries.html");
+ readfile(Olio::$config['includes'] . "countries.html");
if(!is_null($uname)){
echo '<option selected="selected"
value="'.$country.'">'.$country.'</option>';
}
Modified: incubator/olio/webapp/php/trunk/views/site.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/views/site.php?rev=749434&r1=749433&r2=749434&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/views/site.php (original)
+++ incubator/olio/webapp/php/trunk/views/site.php Mon Mar 2 21:04:31 2009
@@ -43,7 +43,7 @@
<? if(is_null($_SESSION["uname"])){ ?>
<div id="inline_login">
<a name="login"></a>
- <? readfile(Web20::$config['includes'] . "login.html"); ?>
+ <? readfile(Olio::$config['includes'] . "login.html"); ?>
</div>
<? } ?>
<ul id="main_nav">
@@ -123,7 +123,7 @@
</div>
<div id="footer">
- <? readfile(Web20::$config['includes'] . "footer.html"); ?>
+ <? readfile(Olio::$config['includes'] . "footer.html"); ?>
</div>
</div>