Skip to content

Commit

Permalink
use __construct() to make compatible with the PHP7.0
Browse files Browse the repository at this point in the history
 * remove trailing close tags
  • Loading branch information
wkpark committed Dec 18, 2019
1 parent 2c53d31 commit 49b5c29
Show file tree
Hide file tree
Showing 224 changed files with 96 additions and 341 deletions.
3 changes: 1 addition & 2 deletions lib/Gettext/MO.php
Expand Up @@ -56,7 +56,7 @@ class File_Gettext_MO extends File_Gettext
* @return object File_Gettext_MO
* @param string $file path to GNU MO file
*/
function File_Gettext_MO($file = '')
function __construct($file = '')
{
$this->file = $file;
}
Expand Down Expand Up @@ -332,4 +332,3 @@ function save($file = null)
return true;
}
}
?>
3 changes: 1 addition & 2 deletions lib/Gettext/PO.php
Expand Up @@ -38,7 +38,7 @@ class File_Gettext_PO extends File_Gettext
* @return object File_Gettext_PO
* @param string path to GNU PO file
*/
function File_Gettext_PO($file = '')
function __construct($file = '')
{
$this->file = $file;
}
Expand Down Expand Up @@ -139,4 +139,3 @@ function save($file = null)
return true;
}
}
?>
1 change: 0 additions & 1 deletion lib/Gettext/TGettext.php
Expand Up @@ -277,4 +277,3 @@ function raiseError($error = null, $code = null)
return exit($code);
}
}
?>
2 changes: 1 addition & 1 deletion lib/HTTPClient.php
Expand Up @@ -65,7 +65,7 @@ class HTTPClient {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function HTTPClient(){
function __construct(){
$this->agent = 'Mozilla/4.0 (compatible; HTTP Client; '.PHP_OS.')';
$this->timeout = 15;
$this->cookies = array();
Expand Down
8 changes: 3 additions & 5 deletions lib/JSON.php
Expand Up @@ -130,7 +130,7 @@ class Services_JSON
* bubble up with an error, so all return values
* from encode() should be checked with isError()
*/
function Services_JSON($use = 0)
function __construct($use = 0)
{
$this->use = $use;
}
Expand Down Expand Up @@ -780,7 +780,7 @@ function isError($data, $code = null)

class Services_JSON_Error extends PEAR_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
Expand All @@ -794,13 +794,11 @@ function Services_JSON_Error($message = 'unknown error', $code = null,
*/
class Services_JSON_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{

}
}

}

?>
2 changes: 1 addition & 1 deletion lib/PageIndex.php
Expand Up @@ -18,7 +18,7 @@ class PageIndex extends TitleIndexer_Text {
*/
var $chunksize = 2000;

function PageIndex($name = 'pageindex')
function __construct($name = 'pageindex')
{
global $Config;

Expand Down
2 changes: 1 addition & 1 deletion lib/cache.text.php
Expand Up @@ -74,7 +74,7 @@ class Cache_Text {
*/
var $hash = 'md5';

function Cache_Text($arena = 'default', $cache_info = false)
function __construct($arena = 'default', $cache_info = false)
{
global $Config;

Expand Down
2 changes: 1 addition & 1 deletion lib/confutils.php
Expand Up @@ -8,7 +8,7 @@
*/

class Config_base {
function Config_base($configfile = 'config.php', $vars = array())
function __construct($configfile = 'config.php', $vars = array())
{
if (file_exists($configfile)) {
$this->config = $this->_getConfig($configfile, $vars);
Expand Down
9 changes: 4 additions & 5 deletions lib/diff3.php
Expand Up @@ -14,7 +14,7 @@
class _Diff3_Block {
var $type = 'diff3';

function _Diff3_Block ($orig = false, $final1 = false, $final2 = false) {
function __construct ($orig = false, $final1 = false, $final2 = false) {
$this->orig = $orig ? $orig : array();
$this->final1 = $final1 ? $final1 : array();
$this->final2 = $final2 ? $final2 : array();
Expand Down Expand Up @@ -43,7 +43,7 @@ function is_conflict () {
class _Diff3_CopyBlock extends _Diff3_Block {
var $type = 'copy';

function _Diff3_CopyBlock ($lines = false) {
function __construct ($lines = false) {
$this->orig = $lines ? $lines : array();
$this->final1 = &$this->orig;
$this->final2 = &$this->orig;
Expand All @@ -59,7 +59,7 @@ function is_conflict () {
}

class _Diff3_BlockBuilder {
function _Diff3_BlockBuilder () {
function __construct () {
$this->_init();
}

Expand Down Expand Up @@ -104,7 +104,7 @@ function finish() {


class Diff3 {
function Diff3 ($orig, $final1, $final2) {
function __construct ($orig, $final1, $final2) {
$eng = new _DiffEngine;
$this->ConflictingBlocks = 0; //Conflict counter
$this->blocks = $this->__diff3($eng->diff($orig, $final1),
Expand Down Expand Up @@ -211,4 +211,3 @@ function merged_output($label1 = false, $label2 = false) {
// c-hanging-comment-ender-p: nil
// indent-tabs-mode: nil
// End:
?>
23 changes: 11 additions & 12 deletions lib/difflib.php
Expand Up @@ -35,7 +35,7 @@ function nfinal() {
class _DiffOp_Copy extends _DiffOp {
var $type = 'copy';

function _DiffOp_Copy ($orig, $_final = false) {
function __construct ($orig, $_final = false) {
if (!is_array($_final))
$_final = $orig;
$this->orig = $orig;
Expand All @@ -51,7 +51,7 @@ function &reverse() {
class _DiffOp_Delete extends _DiffOp {
var $type = 'delete';

function _DiffOp_Delete ($lines) {
function __construct ($lines) {
$this->orig = $lines;
$this->_final = false;
}
Expand All @@ -65,7 +65,7 @@ function &reverse() {
class _DiffOp_Add extends _DiffOp {
var $type = 'add';

function _DiffOp_Add ($lines) {
function __construct ($lines) {
$this->_final = $lines;
$this->orig = false;
}
Expand All @@ -79,7 +79,7 @@ function &reverse() {
class _DiffOp_Change extends _DiffOp {
var $type = 'change';

function _DiffOp_Change ($orig, $_final) {
function __construct ($orig, $_final) {
$this->orig = $orig;
$this->_final = $_final;
}
Expand Down Expand Up @@ -510,7 +510,7 @@ class Diff
* (Typically these are lines from a file.)
* @param $to_lines array An array of strings.
*/
function Diff($from_lines, $to_lines) {
function __construct($from_lines, $to_lines) {
$eng = new _DiffEngine;
$this->edits = $eng->diff($from_lines, $to_lines);
//$this->_check($from_lines, $to_lines);
Expand Down Expand Up @@ -663,7 +663,7 @@ class MappedDiff
* @param $mapped_to_lines array This array should
* have the same number of elements as $to_lines.
*/
function MappedDiff($from_lines, $to_lines,
function __construct($from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines) {

USE_ASSERTS && assert(sizeof($from_lines) == sizeof($mapped_from_lines));
Expand Down Expand Up @@ -858,7 +858,7 @@ function _changed($orig, $_final) {
define('NBSP', "\r"); // iso-8859-x non-breaking space.

class _HWLDF_WordAccumulator {
function _HWLDF_WordAccumulator ($tags = array(), $nbsp = '&nbsp;', $html = null) {
function __construct ($tags = array(), $nbsp = '&nbsp;', $html = null) {
if (empty($tags))
$tags = array("<del class='diff-removed'>", "</del>",
"<ins class='diff-added'>", "</ins>");
Expand Down Expand Up @@ -938,7 +938,7 @@ function getLines() {

class WordLevelDiff extends MappedDiff
{
function WordLevelDiff ($orig_lines, $final_lines,
function __construct ($orig_lines, $final_lines,
$charset="euc-kr",$tags=array()) {
if (strtolower($charset) == 'euc-kr') # two bytes sequence rule
$this->charset_rule='[\xb0-\xfd][\xa1-\xfe]|';
Expand Down Expand Up @@ -1018,7 +1018,7 @@ function all ($tags = array(), $nbsp = '', $html = null) {
*/
class UnifiedDiffFormatter extends DiffFormatter
{
function UnifiedDiffFormatter($context_lines = 3) {
function __construct($context_lines = 3) {
$this->leading_context_lines = $context_lines;
$this->trailing_context_lines = $context_lines;
}
Expand Down Expand Up @@ -1050,7 +1050,7 @@ function _changed($orig, $_final) {
*/
class InlineDiffFormatter extends DiffFormatter
{
function InlineDiffFormatter($context_lines = 10000) {
function __construct($context_lines = 10000) {
$this->leading_context_lines = $context_lines;
$this->trailing_context_lines = $context_lines;
}
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class PlainDiffFormatter
{
var $trailing_cr = "\n";

function PlainDiffFormatter() {
function __construct() {
}

function _lines($lines, $prefix = '') {
Expand Down Expand Up @@ -1143,4 +1143,3 @@ function format($diff) {
}
}
// vim:et:sts=4:
?>
9 changes: 4 additions & 5 deletions lib/fckpacker.php
Expand Up @@ -41,7 +41,7 @@ class FCKConstantProcessor
var $_Constants ;
var $_ConstantsRegexPart ;

function FCKConstantProcessor()
function __construct()
{
$this->RemoveDeclaration = TRUE ;
$this->HasConstants = FALSE ;
Expand Down Expand Up @@ -109,7 +109,7 @@ class FCKFunctionProcessor

var $_IsGlobal ;

function FCKFunctionProcessor( $function, $parameters, $isGlobal )
function __construct( $function, $parameters, $isGlobal )
{
$this->_Function = $function ;
$this->_Parameters = $isGlobal ? NULL : $parameters ;
Expand Down Expand Up @@ -209,7 +209,7 @@ function _RenewPrefix()

class FCKJavaScriptCompressor
{
function FCKJavaScriptCompressor()
function __construct()
{}

function Revision()
Expand Down Expand Up @@ -378,7 +378,7 @@ class FCKStringsProcessor
{
var $_ProtectedStrings ;

function FCKStringsProcessor()
function __construct()
{
$_ProtectedStrings = array() ;
}
Expand Down Expand Up @@ -463,4 +463,3 @@ function _RestoreStringsMatch( $match )
}

// vim:et:sts=4:sw=4:
?>
3 changes: 1 addition & 2 deletions lib/indexer.DBA.php
Expand Up @@ -17,7 +17,7 @@ class Indexer_dba {
var $prefix = '';
var $use_stemming = 0; // 0: noop / 1: fake stemming / 2: using KoreanStemmer

function Indexer_dba($arena,$mode='r',$type, $prefix = '') {
function __construct($arena,$mode='r',$type, $prefix = '') {
global $DBInfo;

$this->index_dir=$DBInfo->cache_dir.'/index';
Expand Down Expand Up @@ -445,4 +445,3 @@ function searchPages($words) {
}

// vim:et:sts=4:sw=4:
?>
1 change: 0 additions & 1 deletion lib/metadata.php
Expand Up @@ -83,4 +83,3 @@ function _get_metadata($body) {
}

// vim:et:sts=4:sw=4:
?>
4 changes: 2 additions & 2 deletions lib/metadb.compact.php
Expand Up @@ -28,7 +28,7 @@ class MetaDB_compact extends MetaDB {
var $storage;
var $aux = array();

function MetaDB_compact()
function __construct()
{
$args = func_get_args();
$num = func_num_args();
Expand Down Expand Up @@ -267,7 +267,7 @@ class Storage_dba {
var $db = null;

// init class
function Storage_dba($dbname, $dba_type)
function __construct($dbname, $dba_type)
{
$this->dbname = !empty($dbname) ? $dbname : 'temp.db';
$this->dba_type = !empty($dba_type) ? $dba_type : 'db4';
Expand Down
2 changes: 1 addition & 1 deletion lib/metadb.dba.php
Expand Up @@ -12,7 +12,7 @@ class MetaDB_dba extends MetaDB {
var $metadb;
var $aux = array();

function MetaDB_dba($file, $type = 'db4') {
function __construct($file, $type = 'db4') {
if (function_exists('dba_open'))
$this->metadb = @dba_open($file.".cache", 'r', $type);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/metadb.text.php
Expand Up @@ -12,7 +12,7 @@ class MetaDB_text extends MetaDB {
var $alias; // alias metadata
var $db; // extra aliases from the AliasPageNames

function MetaDB_text($db = array()) {
function __construct($db = array()) {
// open aliasname metadata
$this->alias = new Cache_Text('aliasname');
$this->db = $db;
Expand Down
4 changes: 1 addition & 3 deletions lib/openid.php
Expand Up @@ -21,7 +21,7 @@ class SimpleOpenID{
var $_user_agent_ = "Simple OpenID PHP Class";
var $_request = 'CURL_Request';

function SimpleOpenID() {
function __construct() {
if (!function_exists('curl_exec')) {
require_once('HTTPClient.php');
$this->_request='HTTP_Request';
Expand Down Expand Up @@ -296,5 +296,3 @@ function ValidateWithServer() {
}
}
}

?>
2 changes: 1 addition & 1 deletion lib/pagekey.base.php
Expand Up @@ -7,7 +7,7 @@
//

class PageKey_base {
function getPageKey($pagename) {
function __construct($pagename) {
}

function pageToKeyname($pagename) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pagekey.base64url.php
Expand Up @@ -11,7 +11,7 @@
class PageKey_base64url extends PageKey_base {
var $text_dir;

function PageKey_base64url($conf) {
function __construct($conf) {
if (is_object($conf)) {
$this->text_dir = $conf->text_dir;
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/pagekey.compat.php
Expand Up @@ -14,7 +14,7 @@ class PageKey_compat extends PageKey_base {
var $text_dir;
var $use_namespace = false;

function PageKey_compat($conf) {
function __construct($conf) {
if (is_object($conf)) {
$this->text_dir = $conf->text_dir;
$this->use_namespace = $conf->use_namespace;
Expand Down
2 changes: 1 addition & 1 deletion lib/pagekey.utf8fs.php
Expand Up @@ -12,7 +12,7 @@
class PageKey_utf8fs extends PageKey_base {
var $text_dir;

function PageKey_utf8fs($conf) {
function __construct($conf) {
if (is_object($conf)) {
$this->text_dir = $conf->text_dir;
} else {
Expand Down

0 comments on commit 49b5c29

Please sign in to comment.