[pLog-svn] r6035 - plog/trunk
mark at devel.lifetype.net
mark at devel.lifetype.net
Thu Nov 15 08:13:47 EST 2007
Author: mark
Date: 2007-11-15 08:13:47 -0500 (Thu, 15 Nov 2007)
New Revision: 6035
Modified:
plog/trunk/.htaccess
plog/trunk/admin.php
plog/trunk/album
plog/trunk/archives
plog/trunk/blog
plog/trunk/blog.php
plog/trunk/category
plog/trunk/comment
plog/trunk/error.php
plog/trunk/get
plog/trunk/index.php
plog/trunk/page
plog/trunk/post
plog/trunk/register.php
plog/trunk/resource
plog/trunk/resserver.php
plog/trunk/rss
plog/trunk/rss.php
plog/trunk/runtests.php
plog/trunk/static
plog/trunk/summary.php
plog/trunk/trackback.php
plog/trunk/trackbacks
plog/trunk/user
plog/trunk/version.php
plog/trunk/wizard
plog/trunk/xmlrpc.php
Log:
It is really annoying. So, I decide to fix all these missing include first.
Modified: plog/trunk/.htaccess
===================================================================
--- plog/trunk/.htaccess 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/.htaccess 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,14 +1,16 @@
-<Files .htaccess>
-deny from all
-</Files>
+<Files .htaccess>
+deny from all
+</Files>
-<Files config.properties.php>
-deny from all
+<Files config.properties.php>
+deny from all
</Files>
Options -Indexes
Options +FollowSymLinks
+# mod rewrite settings for LifeType mod_rewrite url mode
+
<IfModule mod_rewrite.c>
RewriteEngine On
@@ -17,7 +19,7 @@
# Permalink to the blog entry (i.e. /1_userfoo/archive/3_title-foo-bar.html)
RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]+)_[^.]+\.html$ index.php?op=ViewArticle&blogId=$1&articleId=$2 [L,NC]
-# Monthly archive (i.e. /1_userfoo/archive/200401.html)
+# Monthly archive (i.e. /1_userfoo/archive/200401.html)
RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html$ index.php?blogId=$1&Date=$2 [L,NC]
# -- same as above but with paging included
RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html\.page\.([1-9]+)$ index.php?blogId=$1&Date=$2&page=$3 [L,NC]
@@ -68,8 +70,8 @@
</IfModule>
+# force type settings for LifeType pretty url mode
-
<Files post>
ForceType application/x-httpd-php
</Files>
@@ -122,6 +124,8 @@
ForceType application/x-httpd-php
</Files>
+# error documents settings for LifeType pretty url and custom url mode
+
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
-ErrorDocument 404 /error.php
+ErrorDocument 404 /error.php
\ No newline at end of file
Modified: plog/trunk/admin.php
===================================================================
--- plog/trunk/admin.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/admin.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -7,12 +7,6 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
-
ini_set("arg_seperator.output", "&");
ini_set("magic_quotes_runtime", 0 );
@@ -24,7 +18,6 @@
// a security check, or else people might forget to remove the wizard.php script
//
if( File::isReadable( "wizard.php")) {
-
Installation::check();
}
@@ -41,7 +34,7 @@
// give control to the, ehem, controller :)
$controller->process( HttpVars::getRequest());
-
+
// log statistics, only for debugging purposes
//Info::logMetrics();
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/album
===================================================================
--- plog/trunk/album 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/album 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,14 +4,10 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
@@ -19,9 +15,9 @@
$parser = new PrettyRequestParser( "album", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/archives
===================================================================
--- plog/trunk/archives 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/archives 2007-11-15 13:13:47 UTC (rev 6035)
@@ -3,16 +3,11 @@
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
- include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
+ include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
@@ -20,9 +15,9 @@
$parser = new PrettyRequestParser( "archives", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( PLOG_CLASS_PATH."index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/blog
===================================================================
--- plog/trunk/blog 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/blog 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,9 +1,8 @@
<?php
-
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
-
+
// and transfer execution to the main script
include( PLOG_CLASS_PATH."blog.php" );
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/blog.php
===================================================================
--- plog/trunk/blog.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/blog.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,41 +1,36 @@
<?php
-
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
-
+
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
+
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
-
+ lt_include( PLOG_CLASS_PATH."error.php" );
die();
}
-
+
$server = HttpVars::getServer();
$requestParser = new CustomUrlHandler();
- $requestParser->process( $server["REQUEST_URI"] );
+ $requestParser->process( $server["REQUEST_URI"] );
$vars = $requestParser->getVars();
$params = $requestParser->getParams();
$includeFile = $requestParser->getIncludeFile();
-
+
//
// fill in the request with the parameters we need
//
$vars["op"] = "op";
foreach( $vars as $key => $value ) {
- if( is_array( $params ) && array_key_exists( $key, $params ) && $params["$key"] != "" )
+ if( is_array( $params ) && array_key_exists( $key, $params ) && $params["$key"] != "" )
HttpVars::setRequestValue( $vars["$key"], $params["$key"] );
}
// and transfer execution to the main script
-
+ lt_include( PLOG_CLASS_PATH.$includeFile );
?>
Modified: plog/trunk/category
===================================================================
--- plog/trunk/category 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/category 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,24 +4,20 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "category", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/comment
===================================================================
--- plog/trunk/comment 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/comment 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,24 +4,20 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "comment", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/error.php
===================================================================
--- plog/trunk/error.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/error.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -5,12 +5,8 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
- /**
+ /**
* Implements an error handler for 401, 403 and 404 errors so that
* if the user types a user name after the url, and Apache complains,
* thanks to the ErrorDocument directive this handler will receive the
@@ -29,17 +25,17 @@
* If LifeType is running somewhere else other than /plog/, then that
* should be changed since an absolute URL is required.
*/
- $config =& Config::getConfig();
+ $config =& Config::getConfig();
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
-
+
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "default", $server["REQUEST_URI"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( PLOG_CLASS_PATH."index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/get
===================================================================
--- plog/trunk/get 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/get 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,15 +4,10 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
@@ -20,9 +15,9 @@
$parser = new PrettyRequestParser( "get", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "resserver.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/index.php
===================================================================
--- plog/trunk/index.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/index.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -6,10 +6,10 @@
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
- include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
+ include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
// start gathering statistics
- //Info::startMetrics();
+ //Info::startMetrics();
// just to make php use & as the separator when adding the PHPSESSID
// variable to our requests
@@ -19,7 +19,7 @@
//
// a security check, or else people might forget to remove the wizard.php script
//
- if( File::isReadable( "wizard.php")) {
+ if( File::isReadable( "wizard.php")) {
Installation::check();
}
@@ -33,10 +33,10 @@
// add new actions to the controller
$pluginManager =& PluginManager::getPluginManager();
$pluginManager->loadPlugins( "index" );
-
+
// give control to the, ehem, controller :)
- $controller->process( HttpVars::getRequest());
+ $controller->process( HttpVars::getRequest());
// log statistics, only for debugging purposes
Info::logMetrics();
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/page
===================================================================
--- plog/trunk/page 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/page 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,14 +4,10 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
@@ -19,9 +15,9 @@
$parser = new PrettyRequestParser( "page", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/post
===================================================================
--- plog/trunk/post 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/post 2007-11-15 13:13:47 UTC (rev 6035)
@@ -3,25 +3,21 @@
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
- include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
+ include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "post", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/register.php
===================================================================
--- plog/trunk/register.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/register.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,5 +1,4 @@
<?php
-
/**
* This script handles the registration process.
*/
@@ -9,14 +8,11 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
+
// initialiaze the session
- SessionManager::init();
+ SessionManager::init();
// and the registration/sequential controller
$r = new RegistrationController();
- $r->process( HttpVars::getRequest());
+ $r->process( HttpVars::getRequest());
?>
\ No newline at end of file
Modified: plog/trunk/resource
===================================================================
--- plog/trunk/resource 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/resource 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,15 +4,10 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
@@ -20,9 +15,9 @@
$parser = new PrettyRequestParser( "resource", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/resserver.php
===================================================================
--- plog/trunk/resserver.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/resserver.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,7 +1,4 @@
<?php
-
-
-
/**
* Implementation of a very simple resource server.
*
@@ -13,7 +10,6 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
// the functionality of the old ressever.php file have been moved
// to the action ResourceServerAction and ResourceServerView for better
@@ -21,9 +17,9 @@
// here for compatibility reasons and it is still referenced in all urls
// generated internally that point to resources so please DO NOT REMOVE IT!
$_REQUEST["op"] = "ResourceServer";
-
+
$config =& Config::getConfig();
$indexPage = $config->getValue( "script_name", "index.php" );
-
-
-?>
+
+ lt_include( PLOG_CLASS_PATH.$indexPage );
+?>
\ No newline at end of file
Modified: plog/trunk/rss
===================================================================
--- plog/trunk/rss 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/rss 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,16 +4,12 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
$server = HttpVars::getServer();
-
$path_info = $server["PATH_INFO"];
-
$parser = new PrettyRequestParser( "rss", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
-?>
+ lt_include( "rss.php" );
+?>
\ No newline at end of file
Modified: plog/trunk/rss.php
===================================================================
--- plog/trunk/rss.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/rss.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,25 +1,19 @@
<?php
-
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
// create our own action map
$actionMap = Array( "Default" => "RssAction" );
$controller = new Controller( $actionMap, "op" );
-
+
$request = HttpVars::getRequest();
if( isset($request["summary"])) {
$request["op"] = "rss";
HttpVars::setRequest( $request );
-
+ lt_include( PLOG_CLASS_PATH."summary.php" );
die();
}
@@ -32,13 +26,13 @@
$session["SessionInfo"] = new SessionInfo();
HttpVars::setSession( $session );
}
-
+
// load the plugins, this needs to be done *before* we call the
// Controller::process() method, as some of the plugins _might_
// add new actions to the controller
$pluginManager =& PluginManager::getPluginManager();
- $pluginManager->loadPlugins();
+ $pluginManager->loadPlugins();
// and call the controller
$controller->process( HttpVars::getRequest());
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/runtests.php
===================================================================
--- plog/trunk/runtests.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/runtests.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,7 +1,5 @@
<?php
-
define("ENABLE_TESTS", false);
-
define( "INCLUDE_PLUGIN_TESTS", true );
if(!ENABLE_TESTS){
@@ -14,35 +12,29 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// if plugins should also be included when testing, let's load them now
- $folders = Array( TEST_CLASS_FOLDER );
+ $folders = Array( TEST_CLASS_FOLDER );
if( INCLUDE_PLUGIN_TESTS ) {
-
-
$pm =& PluginManager::getPluginManager();
$plugins = $pm->getPluginListFromFolder();
-
+
foreach( $plugins as $plugin ) {
$folders[] = PLOG_CLASS_PATH."plugins/".$plugin."/class/tests";
}
}
-
+
// create a new TestRunner class, which will take care of loading all our
// tests cases, instantiate them and tell PHPUnit to run the tests specified
// in the request
- $r = new TestRunner( $folders );
+ $r = new TestRunner( $folders );
// check if we're running from the command line
$commandLine = isset( $argv );
if( $commandLine ) {
if( count( $argv ) < 2 ) {
- // if running from command line and we have no parameters, show the list of available suites
+ // if running from command line and we have no parameters, show the list of available suites
print("\nPlease specify the name of a test suite to run, or 'all' to run all tests in one batch\n\n" );
foreach( $r->getTestSuites() as $suite ) {
print( "* [".$suite->getSuiteName()."]: " );
@@ -59,8 +51,8 @@
// check the results when ready
$reporter = new ConsoleReporter( $result );
- print($reporter->generate());
- }
+ print($reporter->generate());
+ }
}
else {
?>
@@ -74,7 +66,7 @@
// get the suite name from the request or run all of them if no parameter specified
$request = HttpVars::getRequest();
$suiteName = isset( $request["suite"] ) ? strtolower($request["suite"]) : "";
-
+
if( $suiteName == "" ) {
// no suite name was specified, let's just show what we have
$suites = $r->getTestSuites();
@@ -104,7 +96,7 @@
}
else {
$result = $r->run( Array( $suiteName ));
-
+
// check the results when ready
$reporter = new HTMLReporter( $result );
print($reporter->generate());
@@ -112,4 +104,4 @@
?>
</body>
</html>
-<?php } ?>
+<?php } ?>
\ No newline at end of file
Modified: plog/trunk/static
===================================================================
--- plog/trunk/static 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/static 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,24 +4,20 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "static", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/summary.php
===================================================================
--- plog/trunk/summary.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/summary.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,41 +4,33 @@
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
- include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
-
-
-
+ include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
+ define( "SUMMARY_DEFAULT_BLOGS_PER_PAGE", 25 );
+
// start gathering statistics
Info::startMetrics();
- define( "SUMMARY_DEFAULT_BLOGS_PER_PAGE", 25 );
-
//
// a security check, or else people might forget to remove the wizard.php script
//
if( is_readable( "wizard.php")) {
-
Installation::check();
}
-
+
// check if the url is coming for a subdomain because if it is... we should
// redirect to index.php because it is not coming to us!
$config =& Config::getConfig();
if( $config->getValue( "subdomains_enabled") && Subdomains::isSubdomainUrl()) {
$indexPage = $config->getValue( "script_name", "index.php" );
-
+ lt_include( PLOG_CLASS_PATH.$indexPage );
die();
}
-
+
// initialiaze the session
- SessionManager::init();
-
+ SessionManager::init();
+
//// main part ////
$controller = new SummaryController();
$controller->process( HttpVars::getRequest());
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/trackback.php
===================================================================
--- plog/trunk/trackback.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/trackback.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,22 +1,19 @@
<?php
-
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
-
+
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
//
// set appender for the "trackback" logger to "file" in
// config/logging.properties.php if you'd like this code to log some debug
// messages to tmp/trackback.log.
//
-
+
$request = HttpVars::getRequest();
$request["op"] = "AddTrackback";
HttpVars::setRequest( $request );
-
-
+ lt_include( PLOG_CLASS_PATH."index.php" );
?>
Modified: plog/trunk/trackbacks
===================================================================
--- plog/trunk/trackbacks 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/trackbacks 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,24 +4,20 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "trackbacks", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/user
===================================================================
--- plog/trunk/user 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/user 2007-11-15 13:13:47 UTC (rev 6035)
@@ -4,24 +4,20 @@
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
-
-
// get the configuration data
$config =& Config::getConfig();
-
+
// in order to maintain compatilibity with previous version, and the alternative
// format of search-engine friendly urls
- if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
+ if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
$server = HttpVars::getServer();
$parser = new PrettyRequestParser( "user", $server["PATH_INFO"]);
$result = $parser->parse();
HttpVars::setRequest( $result );
-
+ lt_include( "index.php" );
}
else {
-
+ lt_include( PLOG_CLASS_PATH."blog.php" );
}
-?>
+?>
\ No newline at end of file
Modified: plog/trunk/version.php
===================================================================
--- plog/trunk/version.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/version.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,3 +1,3 @@
<?php
-$version = 'lifetype-dev';
+ $version = 'LifeType-2.0-Dev';
?>
Modified: plog/trunk/wizard
===================================================================
--- plog/trunk/wizard 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/wizard 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,5 +1,4 @@
-|<?php
-
+<?php
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
@@ -16,12 +15,12 @@
// many records) lower this figure
//
define( "WIZARD_MAX_RECORDS_PER_STEP", 75 );
-
+
//
// minimum php version required
//
define( "MIN_PHP_VERSION", "4.2.0" );
-
+
//
// whether data transformers should fail on error by default
// It might be convenient to set this to 'false' if we're running
@@ -44,7 +43,7 @@
lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/passwordvalidator.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
lt_include( PLOG_CLASS_PATH."class/misc/version.class.php" );
lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
@@ -64,14 +63,14 @@
lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/blogcategories.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/globalarticlecategories.class.php" );
- lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/permission.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/userpermission.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
lt_include( PLOG_CLASS_PATH."class/misc/integritychecker.class.php" );
-
+
// table schemas
include( PLOG_CLASS_PATH."install/dbschemas.properties.php" );
// default configuration values for 1.1
@@ -103,7 +102,7 @@
// open a connection to the database
//$db = NewADOConnection('mysql');
$db = PDb::getDriver('mysql');
-
+
if ( $selectDatabase ) {
$res = $db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ), $config->getValue( "db_database" ), $config->getValue( "db_character_set" ));
} else {
@@ -200,101 +199,101 @@
print $t->fetch( $templateFileName );
}
}
-
+
class WizardAction extends Action
{
function WizardAction( $actionInfo, $request )
{
$this->Action( $actionInfo, $request );
}
- }
-
+ }
+
class WizardValidator
{
var $_desc;
var $_critical;
var $_valid;
var $_solution;
-
+
function WizardValidator( $desc = "", $solution = "", $critical = true )
- {
+ {
$this->_desc = $desc;
$this->_critical = $critical;
$this->_valid = false;
$this->_solution = $solution;
}
-
+
function isCritical()
{
return( $this->_critical );
}
-
+
function getDesc()
{
return( $this->_desc );
}
-
+
function isValid()
{
return( $this->_valid );
}
-
+
function getSolution()
{
return( $this->_solution );
}
-
- function validate()
+
+ function validate()
{
return( $this->_valid );
- }
+ }
}
-
+
class WizardPhpVersionValidator extends WizardValidator
{
function WizardPhpVersionValidator( $minVersion = MIN_PHP_VERSION )
{
- $this->WizardValidator( "Checking if the installed <b>PHP</b> version is at least $minVersion",
+ $this->WizardValidator( "Checking if the installed <b>PHP</b> version is at least $minVersion",
"Please upgrade your version of PHP to $minVersion or newer",
true );
$this->_minVersion = $minVersion;
}
-
+
function validate()
{
$this->_valid = version_compare( phpversion(), $this->_minVersion ) >= 0;
return( parent::validate());
}
}
-
+
class WizardWritableFileValidator extends WizardValidator
{
var $_file;
-
+
function WizardWritableFileValidator( $file )
{
- $this->WizardValidator( "Checking if file/folder <b>$file</b> is writable",
+ $this->WizardValidator( "Checking if file/folder <b>$file</b> is writable",
"Please make sure that the file is writable by the web server",
true );
$this->_file = $file;
}
-
+
function validate()
{
$this->_valid = File::isWritable( $this->_file );
return( parent::validate());
}
}
-
+
class WizardSessionFunctionsAvailableValidator extends WizardValidator
{
function WizardSessionFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>session</b> functions are available",
+ $this->WizardValidator( "Checking if <b>session</b> functions are available",
"LifeType requires support for sessions to be part of your PHP installation",
true );
}
-
+
function validate()
{
$this->_valid = function_exists( "session_start" ) &&
@@ -303,7 +302,7 @@
function_exists( "session_name" ) &&
function_exists( "session_set_cookie_params" ) &&
function_exists( "session_save_path" );
- return( parent::validate());
+ return( parent::validate());
}
}
@@ -311,27 +310,27 @@
{
function WizardSessionSettingsValidator()
{
- $this->WizardValidator( "Checking if <b>session.auto_start</b> is disabled",
- "LifeType can only run when session.auto_start is disabled.",
+ $this->WizardValidator( "Checking if <b>session.auto_start</b> is disabled",
+ "LifeType can only run when session.auto_start is disabled.",
true );
- }
-
+ }
+
function validate()
{
$this->_valid = (ini_get( "session.auto_start" ) == "0");
- return( parent::validate());
+ return( parent::validate());
}
}
-
+
class WizardMySQLFunctionsAvailableValidator extends WizardValidator
{
function WizardMySQLFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>MySQL</b> functions are available",
+ $this->WizardValidator( "Checking if <b>MySQL</b> functions are available",
"LifeType requires support for MySQL to be part of your PHP installation",
true );
}
-
+
function validate()
{
$this->_valid = function_exists( "mysql_select_db" ) &&
@@ -340,19 +339,19 @@
function_exists( "mysql_fetch_assoc" ) &&
function_exists( "mysql_num_rows" ) &&
function_exists( "mysql_free_result" );
- return( parent::validate());
- }
+ return( parent::validate());
+ }
}
-
+
class WizardXmlFunctionsAvailableValidator extends WizardValidator
{
function WizardXmlFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>XML</b> functions are available",
+ $this->WizardValidator( "Checking if <b>XML</b> functions are available",
"LifeType requires support for XML to be part of your PHP installation",
true );
- }
-
+ }
+
function validate()
{
$this->_valid = function_exists( "xml_set_object" ) &&
@@ -361,23 +360,23 @@
function_exists( "xml_parser_set_option" ) &&
function_exists( "xml_parse" ) &&
function_exists( "xml_parser_free" );
- return( parent::validate());
- }
+ return( parent::validate());
+ }
}
-
+
class WizardSafeModeValidator extends WizardValidator
{
function WizardSafeModeValidator()
{
- $this->WizardValidator( "Checking if <b>safe mode</b> is disabled",
- "LifeType can run when PHP's safe mode is enabled, but it may cause some problems.",
+ $this->WizardValidator( "Checking if <b>safe mode</b> is disabled",
+ "LifeType can run when PHP's safe mode is enabled, but it may cause some problems.",
false );
- }
-
+ }
+
function validate()
{
$this->_valid = (ini_get( "safe_mode" ) == "");
- return( parent::validate());
+ return( parent::validate());
}
}
@@ -385,64 +384,64 @@
{
function WizardIconvFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>iconv</b> functions are available",
+ $this->WizardValidator( "Checking if <b>iconv</b> functions are available",
"LifeType requires support for some resource metadata conversion and some LifeType plugins requires support for multi-byte language encoding/decoding.",
false );
}
-
+
function validate()
{
$this->_valid = function_exists( "iconv" );
- return( parent::validate());
- }
+ return( parent::validate());
+ }
}
class WizardMbstringFunctionsAvailableValidator extends WizardValidator
{
function WizardMbstringFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>mbstring</b> functions are available",
+ $this->WizardValidator( "Checking if <b>mbstring</b> functions are available",
"Some LifeType plugins requires support for multi-byte language encoding/decoding.",
false );
}
-
+
function validate()
{
$this->_valid = function_exists( "mb_convert_encoding" );
- return( parent::validate());
- }
+ return( parent::validate());
+ }
}
class WizardGdFunctionsAvailableValidator extends WizardValidator
{
function WizardGdFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>gd</b> or <b>gd2</b> functions are available",
+ $this->WizardValidator( "Checking if <b>gd</b> or <b>gd2</b> functions are available",
"LifeType requires support for generating image thumbnail.",
false );
}
-
+
function validate()
{
$this->_valid = function_exists( "imagecopyresampled" ) &&
function_exists( "imagecopyresized" );
- return( parent::validate());
- }
+ return( parent::validate());
+ }
}
-
+
class WizardFileUploadsValidator extends WizardValidator
{
function WizardFileUploadsValidator()
{
- $this->WizardValidator( "Checking if <b>file_uploads</b> is enabled",
+ $this->WizardValidator( "Checking if <b>file_uploads</b> is enabled",
"LifeType requires support for uploading resources.",
true );
- }
-
+ }
+
function validate()
{
$this->_valid = (ini_get( "file_uploads" ) == 1);
- return( parent::validate());
+ return( parent::validate());
}
}
@@ -450,49 +449,49 @@
{
function WizardFileIntegrityValidator()
{
- $this->WizardValidator( "Checking that all files have been correctly uploaded",
+ $this->WizardValidator( "Checking that all files have been correctly uploaded",
"will be set later on...",
false );
- }
-
+ }
+
function validate()
{
include( PLOG_CLASS_PATH."install/files.properties.php");
-
- $result = IntegrityChecker::checkIntegrity(
+
+ $result = IntegrityChecker::checkIntegrity(
$data
- );
-
-
+ );
+
+
$this->_valid = ( count( $result ) == 0 );
if( !$this->_valid ) {
/* let's modify a private attribute... */
$fileList = implode( "<br/>", array_keys( $result ));
- $this->_solution = "The current version of the following is not the expected one. Installation can proceed but please make sure that all files were uploaded correctly:"."<br/>".$fileList;
+ $this->_solution = "The current version of the following is not the expected one. Installation can proceed but please make sure that all files were uploaded correctly:"."<br/>".$fileList;
}
return( parent::validate());
}
}
-
+
class WizardCtypeFunctionsAvailableValidator extends WizardValidator
{
function WizardCtypeFunctionsAvailableValidator()
{
- $this->WizardValidator( "Checking if <b>ctype</b> functions are available",
+ $this->WizardValidator( "Checking if <b>ctype</b> functions are available",
"Some LifeType plugins requires support for variable type validation.",
false );
}
-
+
function validate()
{
$this->_valid = function_exists( "ctype_digit" );
- return( parent::validate());
- }
- }
-
+ return( parent::validate());
+ }
+ }
+
class WizardChecks extends WizardAction
- {
+ {
function perform()
{
// build the array with checks
@@ -502,7 +501,7 @@
"writeGalleryFolder" => new WizardWritableFileValidator( "gallery" ),
"fileVersionCheck" => new WizardFileIntegrityValidator()
);
-
+
$checkGroups['PHP version checking'] = Array(
"php" => new WizardPhpVersionValidator()
);
@@ -512,7 +511,7 @@
"safemode" => new WizardSafeModeValidator(),
"fileUploads" => new WizardFileUploadsValidator()
);
-
+
$checkGroups['PHP functions availability checking'] = Array(
"sessions" => new WizardSessionFunctionsAvailableValidator(),
"mysql" => new WizardMySQLFunctionsAvailableValidator(),
@@ -521,8 +520,8 @@
"mbstring" => new WizardMbstringFunctionsAvailableValidator(),
"gd" => new WizardGdFunctionsAvailableValidator(),
"ctype" => new WizardCtypeFunctionsAvailableValidator()
- );
-
+ );
+
// run the checks
$ok = true;
foreach( $checkGroups as $checkGroup => $checks ) {
@@ -530,16 +529,16 @@
$valid = $checkGroups[$checkGroup][$id]->validate();
// if it doesn't validate but it's not critical, then we can proced too
if( !$checkGroups[$checkGroup][$id]->isCritical())
- $valid = true;
+ $valid = true;
$ok = ($ok && $valid);
}
}
-
+
// create the view and pass the results
$this->_view = new WizardView( "checks" );
$this->_view->setValue( "ok", $ok );
$this->_view->setValue( "checkGroups", $checkGroups );
-
+
if( WizardTools::isNewInstallation())
$this->_view->setValue( "mode", "install" );
else
@@ -548,34 +547,34 @@
return true;
}
}
-
+
class WizardPagedAction extends WizardAction
{
var $willRefresh;
-
- function WizardPagedAction( $actionInfo, $request )
+
+ function WizardPagedAction( $actionInfo, $request )
{
$this->WizardAction( $actionInfo, $request );
-
+
$this->willRefresh = false;
}
-
+
/**
* @private
*/
function getPageFromRequest()
{
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
// get the value from the request
$page = HttpVars::getRequestValue( "page" );
// but first of all, validate it
$val = new IntegerValidator();
if( !$val->validate( $page ))
- $page = 1;
-
- return $page;
+ $page = 1;
+
+ return $page;
}
-
+
/**
* @private
*/
@@ -745,7 +744,7 @@
$version = explode( '.', $serverVersion );
if ( $version[0] < 4 ) return false;
if ( ( $version[0] == 4 ) && ( $version[1] == 0 ) ) return false;
-
+
// check if utf8 support was compiled in
$result = mysql_query( "SHOW CHARACTER SET", $this->_connection );
if( $result )
@@ -762,13 +761,13 @@
}
return false;
}
-
+
function getDatabaseCharacterSet()
{
if( !@mysql_select_db( $this->_dbName, $this->_connection ) ) {
return false;
}
-
+
// We use a SHOW CREATE DATABASE command to show the original
// SQL character set when DB was created.
$result = mysql_query( "SHOW CREATE DATABASE `".$this->_dbName."`", $this->_connection );
@@ -786,7 +785,7 @@
}
return false;
}
-
+
function getServerCharacterSet(){
// We use a SHOW CREATE DATABASE command to show the original
// SQL character set when DB was created.
@@ -836,7 +835,7 @@
$this->_dbCharacterSet = $this->_request->getValue( "dbCharacterSet" );
$configFile = new ConfigFileStorage();
$configFileName = $configFile->getConfigFileName();
-
+
if( File::exists( $configFileName ) && !File::isWritable( $configFileName )) {
$this->_view = new WizardView( "step1" );
$message = "Please make sure that the file $configFileName can be written by this script during
@@ -856,7 +855,7 @@
return false;
}
-
+
$createDb = $this->_request->getValue( "createDatabase" );
$message = '';
@@ -904,7 +903,7 @@
$this->setDbConfigValues( $this->_view );
$this->_view->setErrorMessage( $message );
$this->setCommonData( true );
- return false;
+ return false;
}
if( !$this->_db->Execute( "CREATE DATABASE ".$this->_database )) {
$message = "Error creating the database: ".$this->_db->ErrorMsg();
@@ -921,17 +920,17 @@
// reconnect using the new database.
$config = new ConfigFileStorage();
- $this->_db->Connect( $config->getValue( "db_host" ),
- $config->getValue( "db_username" ),
- $config->getValue( "db_password" ),
+ $this->_db->Connect( $config->getValue( "db_host" ),
+ $config->getValue( "db_username" ),
+ $config->getValue( "db_password" ),
$config->getValue( "db_database" ));
-
+
// create a data dictionary to give us the right sql code needed to create the tables
$dict = NewPDbDataDictionary( $this->_db );
// create the tables
- $errors = false;
-
+ $errors = false;
+
foreach( $Tables as $name => $table ) {
$upperName = $dict->upperName;
$tableSchema = $table["schema"];
@@ -949,13 +948,13 @@
foreach( $sqlarray as $sql ) {
$ok = ( $ok && $this->_db->Execute( $sql ));
}
-
+
if( $ok )
$message .= "Table <strong>$name</strong> created successfully.<br/>";
else {
$message .= "Error creating table $name: ".$this->_db->ErrorMsg()."<br/>";
$errors = true;
- }
+ }
}
if( $errors ) {
@@ -1041,7 +1040,7 @@
include( PLOG_CLASS_PATH."install/corepermissions.properties.php" );
// process permissions
- $total = 0;
+ $total = 0;
foreach( $permissions as $perm ) {
// check if it already exists
$query = "SELECT * FROM ".Db::getPrefix()."permissions WHERE permission = '".$perm[0]."'";
@@ -1201,7 +1200,7 @@
$this->registerFieldValidator( "blogName", new StringValidator());
$this->registerFieldValidator( "ownerid", new IntegerValidator());
$this->registerFieldValidator( "blogTemplate", new StringValidator());
- $this->registerFieldValidator( "blogLocale", new StringValidator());
+ $this->registerFieldValidator( "blogLocale", new StringValidator());
$view = new WizardView( "step4" );
$view->setErrorMessage( "Some data is missing or incorrect" );
$view->setValue( "siteLocales", Locales::getLocales());
@@ -1223,7 +1222,7 @@
$globalArticleCategories = new GlobalArticleCategories();
$globalArticleCategory = new GlobalArticleCategory( "General", "General" );
$globalArticleCategoryId = $globalArticleCategories->addGlobalArticleCategory( $globalArticleCategory );
-
+
// retrieve the values from the view
$this->_blogName = $this->_request->getValue( "blogName" );
$this->_ownerId = $this->_request->getValue( "ownerid" );
@@ -1287,11 +1286,11 @@
true );
$albums = new GalleryAlbums();
$albums->addAlbum( $album );
-
+
// add a new default mylinkscategory
$linksCategory = new MyLinksCategory( "General", $newblogId );
$linksCategories = new MyLinksCategories();
- $linksCategories->addMyLinksCategory( $linksCategory );
+ $linksCategories->addMyLinksCategory( $linksCategory );
// save a few things in the default configuration
$config =& Config::getConfig();
@@ -1321,7 +1320,7 @@
$message = "Neither GD nor ImageMagick have been detected in this host so it will not be possible to generate thumbnails from images.";
}
}
-
+
// clean the data cache to avoid problems when we're done
lt_include( PLOG_CLASS_PATH."class/cache/cachemanager.class.php" );
$cache =& CacheManager::getCache();
@@ -1353,13 +1352,13 @@
lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
$config =& Config::getConfig();
$resourcesNamingRule = $config->getValue( "resources_naming_rule", "original_file_name" );
-
+
$this->_view = new WizardView( "update2" );
$this->_view->setValue( "resourcesNamingRule", $resourcesNamingRule );
$this->setCommonData();
}
}
-
+
/**
* Generic class that performs data updates on the database
*/
@@ -1377,11 +1376,11 @@
var $page;
var $itemsPerPage;
var $dbPrefix;
-
+
function DatabaseDataTransformer( $page = -1, $itemsPerPage = WIZARD_MAX_RECORDS_PER_STEP )
{
$this->Model();
-
+
$this->updatedRecords = 0;
$this->errorRecords = 0;
$this->notModifiedRecords = 0;
@@ -1389,25 +1388,25 @@
$this->deletedRecords = 0;
$this->failOnError = DATABASE_DATA_TRANSFORMER_FAIL_ON_ERROR_DEFAULT;
$this->message = "";
-
+
$this->page = $page;
$this->itemsPerPage = $itemsPerPage;
-
+
$this->dbPrefix = $this->getPrefix();
}
-
+
/**
* Rerforms the transformation. Returns true if the step was successful or false otherwise.
* Upon finalization, please check the $message string to get more information. Use the $updatedRecords,
- * $errorRecords, $notModifiedRecords, $addedRecords and $deletedRecords for some figures regarding the
+ * $errorRecords, $notModifiedRecords, $addedRecords and $deletedRecords for some figures regarding the
* previous step
*/
function perform()
{
// must be implemented by child classes
- return true;
+ return true;
}
-
+
/**
* Returns true if there is no more data for this transformer to upgrade, or false otherwise
*
@@ -1417,7 +1416,7 @@
{
return( $this->getNumSteps() <= $this->page );
}
-
+
/**
* returns the number of steps needed to process this data
*/
@@ -1427,16 +1426,16 @@
// classes to reimplement this method
if( $table ) {
$numItems = $this->getNumItems( $this->getPrefix().$table );
-
+
$numSteps = ceil( $numItems / $this->itemsPerPage );
}
else {
$numSteps = 0;
}
-
+
return( $numSteps );
}
-
+
/**
* returns the total number of records processed so far based on the current page and the
* number of items per page
@@ -1445,7 +1444,7 @@
{
return( $this->page * $this->itemsPerPage );
}
-
+
/**
* returns an approximate percentage of records processed so far
*/
@@ -1461,20 +1460,20 @@
* table at a time.
*/
class DatabaseSchemaDataTransformer extends DatabaseDataTransformer
- {
+ {
function getNumSteps()
{
- global $Tables;
+ global $Tables;
return( count( $Tables ) - 1);
}
-
+
function perform()
{
global $Tables;
-
+
$tablesArray = array_keys( $Tables );
$curTable = $tablesArray[$this->page-1];
-
+
$db =& Db::getDb();
$dict = NewPDbDataDictionary( $db );
$errors = false;
@@ -1488,7 +1487,7 @@
if ( isset( $Tables[$curTable]["options"] )) {
$tableOptions = $Tables[$curTable]["options"];
$options = array ( $upperName => $tableOptions );
- }
+ }
else {
$options = array ();
}
@@ -1515,56 +1514,56 @@
$result = false;
}
- return( $result );
+ return( $result );
}
}
-
+
/**
* Processes all users and grants the appropriate permissions
*/
class UserPermissionsDataTransformer extends DatabaseDataTransformer
- {
+ {
function getNumSteps()
{
return( parent::getNumSteps( "tmp_users_permissions" ));
}
-
+
function perform()
{
- $this->message = "Updating user permissions (step %s of %s)<br/>";
-
+ $this->message = "Updating user permissions (step %s of %s)<br/>";
+
$query3 = "SELECT * FROM ".Db::getPrefix()."tmp_users_permissions";
$res3 = $this->Execute( $query3, $this->page, $this->itemsPerPage );
if( $res3->RecordCount() == 0 ) {
$this->message .= "No more records to process";
return( true );
}
-
+
$permissions = new Permissions();
$userPermissions = new UserPermissions();
$allPerms = $permissions->getAllPermissions();
- $blogOwnerOnlyPerms = Array( "update_blog",
- "add_blog_user",
- "update_blog_user",
- "view_blog_users",
- "view_blog_stats",
+ $blogOwnerOnlyPerms = Array( "update_blog",
+ "add_blog_user",
+ "update_blog_user",
+ "view_blog_users",
+ "view_blog_stats",
"add_blog_template",
"view_blog_templates",
"view_blog_stats" );
-
+
while( $row = $res3->FetchRow()) {
// grant all the non-admin permissions so that users can still access the blogs to where they still had permissions
if( $row["permission_id"] != 3) {
foreach( $allPerms as $perm ) {
if( !$perm->isAdminOnlyPermission() && !in_array( $perm->getName(), $blogOwnerOnlyPerms )) {
- //print( "granting perm: ".$perm->getName()." - user: ".$row["user_id"]." - blog id: ".$row["blog_id"]."<br/>");
+ //print( "granting perm: ".$perm->getName()." - user: ".$row["user_id"]." - blog id: ".$row["blog_id"]."<br/>");
$perm = new UserPermission( $row["user_id"], $row["blog_id"], $perm->getId());
$userPermissions->grantPermission( $perm );
}
}
}
}
-
+
$this->message .= "{$this->updatedRecords} users updated (".$this->getPercentProcessed()."%%)<br/>";
$this->Execute("DROP TABLE ".Db::getPrefix()."tmp_users_permissions");
@@ -1575,31 +1574,31 @@
class PermissionLoader extends DatabaseDataTransformer
{
-
+
//
// load the new list of permissions
- //
+ //
function getNumSteps()
{
return( 0 );
}
-
+
function perform()
{
// initial message, no errors yet
- $this->message = "Loading new permissions (step %s of %s)<br/>";
+ $this->message = "Loading new permissions (step %s of %s)<br/>";
$errors = false;
-
+
// load the core permissions
- include( PLOG_CLASS_PATH."install/corepermissions.properties.php" );
+ include( PLOG_CLASS_PATH."install/corepermissions.properties.php" );
// process permissions
- $total = 0;
+ $total = 0;
foreach( $permissions as $perm ) {
// check if it already exists
$query = "SELECT * FROM ".$this->dbPrefix."permissions WHERE permission = '".$perm[0]."'";
$result = $this->Execute( $query );
- if( !$result || $result->RowCount() < 1 ) {
+ if( !$result || $result->RowCount() < 1 ) {
// permission needs to be added
$corePerm = ( $perm[2] == true ? 1 : 0 );
$adminOnly = ( $perm[3] == true ? 1 : 0 );
@@ -1609,14 +1608,14 @@
$total++;
}
}
-
+
//
// prepare the users_permissions table for the next step
//
// make sure we are starting with an empty table
$this->Execute("DELETE FROM ".Db::getPrefix()."tmp_users_permissions");
-
+
if( !$this->Execute( "INSERT INTO ".$this->dbPrefix."tmp_users_permissions SELECT * FROM ".$this->dbPrefix."users_permissions WHERE blog_id != 0 AND permission_id != 1" )) {
$this->message .= "Error preparing the users_permissions table for transformation";
$errors = true;
@@ -1625,10 +1624,10 @@
$this->Execute( "DELETE FROM ".$this->dbPrefix."users_permissions" );
$this->message .= count($permissions)." permissions successfully loaded";
$errors = false;
- }
-
- return( !$errors );
- }
+ }
+
+ return( !$errors );
+ }
}
class ConfigDataTransformer extends DatabaseDataTransformer
@@ -1637,14 +1636,14 @@
{
return( 0 );
}
-
+
function perform()
{
- global $Inserts;
-
+ global $Inserts;
+
$this->message = "Adding new configuration parameters (step %s of %s)<br/>";
$errors = false;
-
+
// Find some of the tools we are going to need (last one is for os x, with fink installed), this will be needed later on
$folders = Array( "/bin/", "/usr/bin/", "/usr/local/bin/", "/sw/bin/" );
$finder = new FileFinder();
@@ -1663,7 +1662,7 @@
$errors = true;
}
else{
- if ($result->RecordCount() == 0) {
+ if ($result->RecordCount() == 0) {
// replace the prefix
$query = str_replace( "{dbprefix}", $this->dbPrefix, $insert );
// replace also the placeholders for the paths to the tools
@@ -1686,9 +1685,9 @@
$result = $this->Execute($query);
// if $result is false, id column has already been removed
if($result){
- $result->Close();
+ $result->Close();
// remove all duplicates in plog_config table
-
+
// first create temp table without the duplicates
$query = "CREATE TEMPORARY TABLE tmptable ".
"SELECT * FROM ".$this->dbPrefix."config WHERE 1 GROUP BY config_key";
@@ -1720,30 +1719,30 @@
$errors = true;
}
}
- }
+ }
if( !$errors ) {
$this->message .= "Configuration settings updated successfully";
}
-
+
return( !$errors );
- }
+ }
}
/**
* Processes all admin users and grants the appropriate permissions
*/
class AdminUserPermissionsDataTransformer extends DatabaseDataTransformer
- {
+ {
function getNumSteps()
{
return( parent::getNumSteps( "users" ));
}
-
+
function perform()
{
- $this->message = "Updating admin user permissions (step %s of %s)<br/>";
-
+ $this->message = "Updating admin user permissions (step %s of %s)<br/>";
+
// load each one of the categories and update them
// list of categories
/*$query3 = "SELECT id, site_admin FROM ".$this->dbPrefix."users";
@@ -1752,15 +1751,15 @@
$this->message .= "No more records to process";
return( true );
}*/
-
+
$users = new Users();
$allUsers = $users->getAllUsers( USER_STATUS_ALL, "", "", $this->page, $this->itemsPerPage );
-
+
$permissions = new Permissions();
$userPermissions = new UserPermissions();
$loginPerm = $permissions->getPermissionByName( "login_perm" );
$allPerms = $permissions->getAllPermissions();
-
+
//while( $row = $res3->FetchRow()) {
foreach( $allUsers as $user ) {
//print("Processing user: ".$user->getUsername()."<br/>");
@@ -1778,15 +1777,15 @@
// grant the login_perm permission or else users won't be able to log in
$newPerm = new UserPermission( $user->getId(), 0, $loginPerm->getId());
$userPermissions->grantPermission( $newPerm );
-
+
$this->updatedRecords++;
}
-
+
$this->message .= "{$this->updatedRecords} users updated (".$this->getPercentProcessed()."%%)<br/>";
- return true;
+ return true;
}
}
-
+
/**
* processes all resource files and renames the files to their "real" names
*/
@@ -1796,11 +1795,11 @@
{
return( parent::getNumSteps( "gallery_resources" ));
}
-
+
function perform()
{
- $this->message = "Updating resource files with original file naming rule (step %s of %s)<br/>";
-
+ $this->message = "Updating resource files with original file naming rule (step %s of %s)<br/>";
+
$query1 = "SELECT id, owner_id, file_name, resource_type, thumbnail_format FROM ".$this->dbPrefix."gallery_resources";
$config =& Config::getConfig();
@@ -1814,25 +1813,25 @@
}
if( $res1->RecordCount() == 0 ) {
$this->message .= "No more records to process";
- return( true );
+ return( true );
}
$numComments = Array();
while( $row = $res1->FetchRow()) {
//
// process each one of the rows and rename the main file
//
-
+
// get the file extension
- if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
+ if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
$fileExt = substr( $row["file_name"], $extPos+1, strlen( $row["file_name"] ));
}
else {
$fileExt = "";
}
-
+
$fileName = $galleryFolder.$row["owner_id"]."/".$row["owner_id"]."-".$row["id"].".".$fileExt;
$destFileName = $galleryFolder.$row["owner_id"]."/".$row["file_name"];
-
+
//print( "Renaming file: $fileName --- $destFileName<br/>" );
// skip the rename if we already did it
@@ -1843,7 +1842,7 @@
}
}
}
-
+
// if it's an image, we also need to process the previews
if( $row["resource_type"] == "1" ) {
// calculate the extension of the preview file, depending on how it was saved
@@ -1857,17 +1856,17 @@
//print("file name = ".$row["file_name"]." - file ext = $fileExt - previewExt = $previewExt" );
$destFileName = str_replace( $fileExt, $previewExt, $row["file_name"] );
}
-
+
// file names for the preview and medium preview
$previewFileName = $galleryFolder.$row["owner_id"]."/previews/".$row["owner_id"]."-".$row["id"].".".$previewExt;
- $medPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$row["owner_id"]."-".$row["id"].".".$previewExt;
+ $medPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$row["owner_id"]."-".$row["id"].".".$previewExt;
// destination file names for the preview and medium preview
$destPreviewFileName = $galleryFolder.$row["owner_id"]."/previews/".$destFileName;
$destMedPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$destFileName;
-
+
//print(" -- renaming preview: $previewFileName -- $destPreviewFileName<br/>");
- //print(" -- renaming medium preview: $medPreviewFileName -- $destMedPreviewFileName<br/>");
-
+ //print(" -- renaming medium preview: $medPreviewFileName -- $destMedPreviewFileName<br/>");
+
if( File::exists( $previewFileName )) {
if( !File::exists( $destPreviewFileName)) {
File::rename( $previewFileName, $destPreviewFileName );
@@ -1884,8 +1883,8 @@
}
$res1->Close();
$this->message .= "{$this->updatedRecords} resource files updated, ".$this->getTotalProcessedRecords()." processed so far (".$this->getPercentProcessed()."%%)<br/>";
- return true;
- }
+ return true;
+ }
}
/**
@@ -1897,11 +1896,11 @@
{
return( parent::getNumSteps( "gallery_resources" ));
}
-
+
function perform()
{
- $this->message = "Updating resource files with encoded file naming rule (step %s of %s)<br/>";
-
+ $this->message = "Updating resource files with encoded file naming rule (step %s of %s)<br/>";
+
$query1 = "SELECT id, owner_id, file_name, resource_type, thumbnail_format FROM ".$this->dbPrefix."gallery_resources";
$config =& Config::getConfig();
@@ -1915,25 +1914,25 @@
}
if( $res1->RecordCount() == 0 ) {
$this->message .= "No more records to process";
- return( true );
+ return( true );
}
$numComments = Array();
while( $row = $res1->FetchRow()) {
//
// process each one of the rows and rename the main file
//
-
+
// get the file extension
- if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
+ if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
$fileExt = substr( $row["file_name"], $extPos+1, strlen( $row["file_name"] ));
}
else {
$fileExt = "";
}
-
+
$fileName = $galleryFolder.$row["owner_id"]."/".$row["owner_id"]."-".$row["id"].".".$fileExt;
$destFileName = $galleryFolder.$row["owner_id"]."/".$row["owner_id"]."-".$row["id"].".".strtolower($fileExt);
-
+
if( $fileName != $destFileName ) {
if( File::exists( $fileName )) {
if( !File::exists( $destFileName)) {
@@ -1942,14 +1941,14 @@
}
}
}
- }
+ }
$this->updatedRecords++;
}
$res1->Close();
$this->message .= "{$this->updatedRecords} resource files updated, ".$this->getTotalProcessedRecords()." processed so far (".$this->getPercentProcessed()."%%)<br/>";
- return true;
- }
+ return true;
+ }
}
/**
@@ -1961,11 +1960,11 @@
{
return( parent::getNumSteps( "gallery_resources" ));
}
-
+
function perform()
{
- $this->message = "Fixing resource files with original file naming rule (step %s of %s)<br/>";
-
+ $this->message = "Fixing resource files with original file naming rule (step %s of %s)<br/>";
+
$query1 = "SELECT id, owner_id, file_name, resource_type, thumbnail_format FROM ".$this->dbPrefix."gallery_resources";
$config =& Config::getConfig();
@@ -1979,16 +1978,16 @@
}
if( $res1->RecordCount() == 0 ) {
$this->message .= "No more records to process";
- return( true );
+ return( true );
}
$numComments = Array();
while( $row = $res1->FetchRow()) {
//
// process each one of the rows and rename the main file
//
-
+
// get the file extension
- if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
+ if(( $extPos = strrpos( $row["file_name"], "." )) !== false ) {
$fileExt = substr( $row["file_name"], $extPos+1, strlen( $row["file_name"] ));
}
else {
@@ -2010,17 +2009,17 @@
//print("file name = ".$row["file_name"]." - file ext = $fileExt - previewExt = $previewExt" );
$destFileName = str_replace( $fileExt, $previewExt, $row["file_name"] );
}
-
+
// file names for the preview and medium preview
$previewFileName = $galleryFolder.$row["owner_id"]."/previews/".$row["owner_id"]."-".$row["id"].".".$previewExt;
- $medPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$row["owner_id"]."-".$row["id"].".".$previewExt;
+ $medPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$row["owner_id"]."-".$row["id"].".".$previewExt;
// destination file names for the preview and medium preview
$destPreviewFileName = $galleryFolder.$row["owner_id"]."/previews/".$destFileName;
$destMedPreviewFileName = $galleryFolder.$row["owner_id"]."/previews-med/".$destFileName;
-
+
//print(" -- renaming preview: $previewFileName -- $destPreviewFileName<br/>");
- //print(" -- renaming medium preview: $medPreviewFileName -- $destMedPreviewFileName<br/>");
-
+ //print(" -- renaming medium preview: $medPreviewFileName -- $destMedPreviewFileName<br/>");
+
if( File::exists( $previewFileName )) {
if( !File::exists( $destPreviewFileName)) {
File::rename( $previewFileName, $destPreviewFileName );
@@ -2038,9 +2037,9 @@
}
$res1->Close();
$this->message .= "{$this->updatedRecords} resource files updated, ".$this->getTotalProcessedRecords()." processed so far (".$this->getPercentProcessed()."%%)<br/>";
- return true;
- }
- }
+ return true;
+ }
+ }
// Dummy Transformer
class DummyDataTransformer extends DatabaseDataTransformer
@@ -2049,13 +2048,13 @@
{
return( 0 );
}
-
+
function perform()
{
return true;
}
}
-
+
/**
* This class is basically now a "data transformer runner", because now it works
* like class that executes data transformers, collects their results and refreshes
@@ -2069,7 +2068,7 @@
* - page
* - transformerId
*
- * The 'page' parameter holds the current page, while 'transformerId' is the index of
+ * The 'page' parameter holds the current page, while 'transformerId' is the index of
* the current transformer in the $this->transformers array.
*
* In order to add new transformers, follow these steps:
@@ -2079,15 +2078,15 @@
* first does the data processing while the second one returns the number of needed steps to the
* class running the transformer.
* - Add the name of the transformer class to the the UpdateStepThree::transformers array,
- * and the class will take care of everything else.
+ * and the class will take care of everything else.
*/
class UpdateStepThree extends WizardPagedAction
{
var $resourcesNamingRule;
- var $message;
+ var $message;
var $currentTransformerId;
var $totalTransformers;
-
+
function UpdateStepThree( $actionInfo, $httpRequest )
{
$this->WizardPagedAction( $actionInfo, $httpRequest );
@@ -2096,7 +2095,7 @@
$errorView = new WizardView( "update2" );
$errorView->setErrorMessage( "Some data was incorrect or missing." );
$this->setValidationErrorView( $errorView );
-
+
/**
* array with the data transformers that will be run
*/
@@ -2127,7 +2126,7 @@
$this->currentTransformerId = $this->getTransformerIdFromRequest();
$this->totalTransformers = count( $this->transformers ) - 1;
}
-
+
/**
* gets the id of the transformer from the request. If it is not available, it
* will return the id of the first transformer available (which is '0')
@@ -2135,19 +2134,19 @@
* @private
*/
function getTransformerIdFromRequest()
- {
+ {
$id = HttpVars::getRequestValue( "transformerId" );
$val = new IntegerValidator();
if( !$val->validate( $id ))
$id = 0;
-
- return $id;
- }
+ return $id;
+ }
+
function perform()
{
$step = $this->getPageFromRequest();
-
+
// get the current transformer class so that we can continue where we left
$transformerClass = $this->transformers[$this->currentTransformerId];
$transformer = new $transformerClass( $step );
@@ -2155,29 +2154,29 @@
$complete = $transformer->isComplete();
$message = $transformer->message;
$message = sprintf( $message, $this->currentTransformerId + 1, $this->totalTransformers );
-
+
//print("transformer = $transformerClass<br/>");
-
+
// error during processing and the processor is configured
- // to fail on error
+ // to fail on error
if( !$result && $transformer->failOnError ) {
//print("Error in step = $step<br/>");
$this->_view = new WizardView( "update3" );
$this->_view->setValue( "resourcesNamingRule", $this->resourcesNamingRule );
// current and next step
$this->_view->setValue( "currentStep", $step );
- $this->_view->setValue( "nextStep", $step+1 );
+ $this->_view->setValue( "nextStep", $step+1 );
// whether this transformer is ready
$this->_view->setValue( "complete", $complete );
// transformer id
- $this->_view->setValue( "transformerId", $this->currentTransformerId );
+ $this->_view->setValue( "transformerId", $this->currentTransformerId );
$this->_view->setValue( "error", true );
if( $transformer->DbError() != "" ) {
$message .= "<br/>The database error message was: ".$transformer->DbError()."<br/>";
}
$this->_view->setErrorMessage( $message );
- }
+ }
else {
if( !$complete ) {
//print("it's not complete! step = $step<br/>");
@@ -2185,12 +2184,12 @@
$this->_view->setValue( "resourcesNamingRule", $this->resourcesNamingRule );
// current and next step
$this->_view->setValue( "currentStep", $step );
- $this->_view->setValue( "nextStep", $step+1 );
+ $this->_view->setValue( "nextStep", $step+1 );
// whether this transformer is ready
$this->_view->setValue( "complete", $complete );
// transformer id
$this->_view->setValue( "transformerId", $this->currentTransformerId );
- }
+ }
else {
// have we already been through all transformers?
//print("transformer complete! - num transformers = ".count($this->transformers)."<br/>");
@@ -2201,7 +2200,7 @@
$this->_view->setValue( "resourcesNamingRule", $this->resourcesNamingRule );
// current and next step
$this->_view->setValue( "currentStep", 0 );
- $this->_view->setValue( "nextStep", 1 );
+ $this->_view->setValue( "nextStep", 1 );
// whether this transformer is ready
$this->_view->setValue( "complete", false );
// transformer id
@@ -2214,7 +2213,7 @@
$config =& Config::getConfig();
$tmpFolder = $config->getValue( "temp_folder", TEMP_FOLDER );
WizardTools::cleanTmpFolder();
-
+
// save the resources naming rule to config table
$config->saveValue( "resources_naming_rule", $this->resourcesNamingRule );
@@ -2223,7 +2222,7 @@
}
}
- $this->_view->setValue( "message", $message );
+ $this->_view->setValue( "message", $message );
return true;
}
@@ -2232,14 +2231,14 @@
// Fix those resources that we did not convert correctly in 1.2.0
class Fix120StepOne extends WizardPagedAction
{
- var $message;
+ var $message;
var $currentTransformerId;
var $totalTransformers;
-
+
function Fix120StepOne( $actionInfo, $httpRequest )
{
$this->WizardPagedAction( $actionInfo, $httpRequest );
-
+
/**
* array with the data transformers that will be run
*/
@@ -2251,7 +2250,7 @@
$this->currentTransformerId = $this->getTransformerIdFromRequest();
$this->totalTransformers = count( $this->transformers ) - 1;
}
-
+
/**
* gets the id of the transformer from the request. If it is not available, it
* will return the id of the first transformer available (which is '0')
@@ -2259,19 +2258,19 @@
* @private
*/
function getTransformerIdFromRequest()
- {
+ {
$id = HttpVars::getRequestValue( "transformerId" );
$val = new IntegerValidator();
if( !$val->validate( $id ))
$id = 0;
-
- return $id;
- }
+ return $id;
+ }
+
function perform()
{
$step = $this->getPageFromRequest();
-
+
// get the current transformer class so that we can continue where we left
$transformerClass = $this->transformers[$this->currentTransformerId];
$transformer = new $transformerClass( $step );
@@ -2279,40 +2278,40 @@
$complete = $transformer->isComplete();
$message = $transformer->message;
$message = sprintf( $message, $this->currentTransformerId + 1, $this->totalTransformers );
-
+
//print("transformer = $transformerClass<br/>");
-
+
// error during processing and the processor is configured
- // to fail on error
+ // to fail on error
if( !$result && $transformer->failOnError ) {
//print("Error in step = $step<br/>");
$this->_view = new WizardView( "update3" );
// current and next step
$this->_view->setValue( "currentStep", $step );
- $this->_view->setValue( "nextStep", $step+1 );
+ $this->_view->setValue( "nextStep", $step+1 );
// whether this transformer is ready
$this->_view->setValue( "complete", $complete );
// transformer id
- $this->_view->setValue( "transformerId", $this->currentTransformerId );
+ $this->_view->setValue( "transformerId", $this->currentTransformerId );
$this->_view->setValue( "error", true );
if( $transformer->DbError() != "" ) {
$message .= "<br/>The database error message was: ".$transformer->DbError()."<br/>";
}
$this->_view->setErrorMessage( $message );
- }
+ }
else {
if( !$complete ) {
//print("it's not complete! step = $step<br/>");
$this->_view = new WizardView( "fix120" );
// current and next step
$this->_view->setValue( "currentStep", $step );
- $this->_view->setValue( "nextStep", $step+1 );
+ $this->_view->setValue( "nextStep", $step+1 );
// whether this transformer is ready
$this->_view->setValue( "complete", $complete );
// transformer id
$this->_view->setValue( "transformerId", $this->currentTransformerId );
- }
+ }
else {
// have we already been through all transformers?
//print("transformer complete! - num transformers = ".count($this->transformers)."<br/>");
@@ -2322,7 +2321,7 @@
$this->_view = new WizardView( "fix120" );
// current and next step
$this->_view->setValue( "currentStep", 0 );
- $this->_view->setValue( "nextStep", 1 );
+ $this->_view->setValue( "nextStep", 1 );
// whether this transformer is ready
$this->_view->setValue( "complete", false );
// transformer id
@@ -2347,7 +2346,7 @@
}
}
- $this->_view->setValue( "message", $message );
+ $this->_view->setValue( "message", $message );
return true;
}
Modified: plog/trunk/xmlrpc.php
===================================================================
--- plog/trunk/xmlrpc.php 2007-11-13 07:23:05 UTC (rev 6034)
+++ plog/trunk/xmlrpc.php 2007-11-15 13:13:47 UTC (rev 6035)
@@ -1,12 +1,9 @@
<?php
-
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
-
-
- $server = new XmlRpcServer();
-?>
+ $server = new XmlRpcServer();
+?>
\ No newline at end of file
More information about the pLog-svn
mailing list