From: <var...@us...> - 2014-10-08 12:49:23
|
Revision: 9226 http://sourceforge.net/p/phpwiki/code/9226 Author: vargenau Date: 2014-10-08 12:49:20 +0000 (Wed, 08 Oct 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/Request.php trunk/lib/main.php trunk/tests/unit/test.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-08 08:28:06 UTC (rev 9225) +++ trunk/lib/Request.php 2014-10-08 12:49:20 UTC (rev 9226) @@ -24,7 +24,7 @@ { public $args = array(); - function Request() + function __construct() { $this->_fix_magic_quotes_gpc(); $this->_fix_multipart_form_data(); @@ -578,7 +578,7 @@ class Request_SessionVars { - function Request_SessionVars() + function __construct() { // Prevent cacheing problems with IE 5 session_cache_limiter('none'); @@ -716,6 +716,11 @@ */ class Request_UploadedFile { + function __construct($fileinfo) + { + $this->_info = $fileinfo; + } + function getUploadedFile($postname) { global $HTTP_POST_FILES; @@ -767,14 +772,6 @@ "end with a slash. upload_tmp_dir = \"C:/WINDOWS/TEMP/\" is good suggestion.", E_USER_ERROR); return false; - } else { - /* - trigger_error(sprintf("Workaround for PHP/Windows is_uploaded_file() problem for %s.", - $fileinfo['tmp_name'])."\n". - "Probably illegal TEMP environment or upload_tmp_dir setting.", - E_USER_NOTICE); - */ - ; } } else { trigger_error(sprintf("Uploaded tmpfile %s not found.", $fileinfo['tmp_name']) . "\n" . @@ -785,11 +782,6 @@ return new Request_UploadedFile($fileinfo); } - function Request_UploadedFile($fileinfo) - { - $this->_info = $fileinfo; - } - function getSize() { return $this->_info['size']; @@ -853,10 +845,10 @@ class Request_AccessLog { /** - * @param $logfile string Log file name. + * @param string $logfile Log file name. * @param bool $do_sql */ - function Request_AccessLog($logfile, $do_sql = false) + function __construct($logfile, $do_sql = false) { //global $request; // request not yet initialized! @@ -1221,7 +1213,7 @@ class HTTP_ETag { - function HTTP_ETag($val, $is_weak = false) + function __construct($val, $is_weak = false) { $this->_val = wikihash($val); $this->_weak = $is_weak; @@ -1292,7 +1284,7 @@ class HTTP_ValidatorSet { - function HTTP_ValidatorSet($validators) + function __construct($validators) { $this->_mtime = $this->_weak = false; $this->_tag = array(); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-10-08 08:28:06 UTC (rev 9225) +++ trunk/lib/main.php 2014-10-08 12:49:20 UTC (rev 9226) @@ -92,7 +92,7 @@ //$x = error_reporting(); $this->version = phpwiki_version(); - $this->Request(); // [90ms] + parent::__construct(); // [90ms] // Normalize args... $this->setArg('pagename', $this->_deducePagename()); Modified: trunk/tests/unit/test.php =================================================================== --- trunk/tests/unit/test.php 2014-10-08 08:28:06 UTC (rev 9225) +++ trunk/tests/unit/test.php 2014-10-08 12:49:20 UTC (rev 9226) @@ -508,12 +508,12 @@ $ErrorManager->setPostponedErrorMask(EM_FATAL_ERRORS|EM_WARNING_ERRORS|EM_NOTICE_ERRORS); // FIXME: ignore cached requests (if-modified-since) from cli class MockRequest extends WikiRequest { - function MockRequest($dbparams) { + function __construct($dbparams) { $this->_dbi = WikiDB::open($dbparams); $this->_user = new MockUser("a_user", $GLOBALS['user_level']); $this->_group = new GroupNone(); $this->_args = array('pagename' => 'HomePage', 'action' => 'browse'); - $this->Request(); + parent::__construct(); } function getGroup() { if (is_object($this->_group)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |