Skip to content

Commit 0187f38

Browse files
committed
Fixed PHP 7 constructor deprecation warnings.
1 parent 8649d74 commit 0187f38

File tree

141 files changed

+3213
-3025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+3213
-3025
lines changed

DB/Sync.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ class DB_Sync {
1515
var $renamed = array();
1616
var $listeners = array();
1717

18-
function DB_Sync($db1, $db2, $table1=null, $table2=null, $renamed=null){
18+
function __construct($db1, $db2, $table1=null, $table2=null, $renamed=null){
1919
$this->db1 = $db1;
2020
$this->db2 = $db2;
2121

2222
$this->init($table1, $table2, $renamed);
2323
}
24+
function DB_Sync($db1, $db2, $table1=null, $table2=null, $renamed=null) { self::__construct($db1, $db2, $table1, $table2, $renamed); }
2425

2526

2627
/**

Dataface/ActionTool.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Dataface_ActionTool {
2929
var $actions=array();
3030
var $tableActions=array();
3131

32-
function Dataface_ActionTool($conf=null){
32+
function __construct($conf=null){
3333
if ( $conf === null ){
3434
$this->_loadActionsINIFile(/*DATAFACE_PATH."/actions.ini"*/);
3535
//$this->_loadActionsINIFile(DATAFACE_SITE_PATH."/actions.ini");
@@ -38,6 +38,7 @@ function Dataface_ActionTool($conf=null){
3838
}
3939

4040
}
41+
function Dataface_ActionTool($conf=null) { self::__construct($conf); }
4142

4243

4344

Dataface/AuthenticationTool.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function &getInstance($params=array()){
7676
return $instance;
7777
}
7878

79-
function Dataface_AuthenticationTool($params=array()){
79+
function __construct($params=array()){
8080
$this->conf = $params;
8181
$this->usersTable = ( isset($params['users_table']) ? $params['users_table'] : null);
8282
$this->usernameColumn = ( isset($params['username_column']) ? $params['username_column'] : null);
@@ -85,6 +85,7 @@ function Dataface_AuthenticationTool($params=array()){
8585

8686
$this->setAuthType(@$params['auth_type']);
8787
}
88+
function Dataface_AuthenticationTool($params=array()) { self::__construct($params); }
8889

8990
function setAuthType($type){
9091
if ( isset( $type ) and $type != $this->authType ){

Dataface/Cache.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ class Dataface_Cache {
3535
*/
3636
var $monitored = array();
3737

38-
function Dataface_Cache($cachedir=null, $prefix=null){
38+
function __construct($cachedir=null, $prefix=null){
3939
if ( $cachedir === null ) $cachedir = '/tmp';
4040
$this->cachedir = $cachedir;
4141
if ( $prefix === null ) $prefix = DATAFACE_SITE_PATH;
4242
$this->prefix = $prefix;
4343

4444

4545
}
46+
function Dataface_Cache($cachedir=null, $prefix=null) { self::__construct($cachedir, $prefix); }
4647

4748
function apc_get($key){
4849
return apc_fetch($this->prefix.$key);

Dataface/Clipboard.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ class Dataface_Clipboard {
1717
var $warnings;
1818
var $messages;
1919

20-
function Dataface_Clipboard($id){
20+
function __construct($id){
2121
$this->id = $id;
2222
}
23+
function Dataface_Clipboard($id) { self::__construct($id); }
2324

2425
/**
2526
* Checks whether the clipboard is currently installed.

Dataface/CompositeForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ class Dataface_CompositeForm extends HTML_QuickForm {
2828
var $changed_fields = array();
2929

3030

31-
function Dataface_CompositeForm($uris){
31+
function __construct($uris){
3232
$this->uris = $uris;
3333
$this->HTML_QuickForm();
3434
}
35+
function Dataface_CompositeForm($uris) { self::__construct($uris); }
3536

3637
function &getQuickForm($uri){
3738
// This returns a builder quickform to build the form

Dataface/DB.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Dataface_DB {
5252

5353
var $blobs = array(); // Blobs.
5454

55-
function Dataface_DB($db=null){
55+
function __construct($db=null){
5656
$this->app =& Dataface_Application::getInstance();
5757
if ( $db === null ){
5858
$db = $this->app->db();
@@ -77,6 +77,7 @@ function Dataface_DB($db=null){
7777

7878

7979
}
80+
function Dataface_DB($db=null) { self::__construct($db); }
8081

8182
/**
8283
* Loads cached queries from the file Dataface_DB.cache in the DATAFACE_CACHE

Dataface/DeleteForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Dataface_DeleteForm extends HTML_QuickForm {
3636
var $_isBuilt;
3737

3838

39-
function Dataface_DeleteForm( $tablename, $db, $query){
39+
function __construct( $tablename, $db, $query){
4040
$this->_tablename = $tablename;
4141
$this->_table =& Dataface_Table::loadTable($tablename);
4242
$this->_db = $db;
@@ -51,6 +51,7 @@ function Dataface_DeleteForm( $tablename, $db, $query){
5151

5252

5353
}
54+
function Dataface_DeleteForm($tablename, $db, $query) { self::__construct($tablename, $db, $query); }
5455

5556
function _build(){
5657

Dataface/ExistingRelatedRecordForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Dataface_ExistingRelatedRecordForm extends HTML_QuickForm {
9393
* @type string
9494
* @param db The database resource handle.
9595
*/
96-
function Dataface_ExistingRelatedRecordForm(&$record, $relationshipName, $db=''){
96+
function __construct(&$record, $relationshipName, $db=''){
9797
if ( !$record ){
9898
$record =& $this->getRecord();
9999
}
@@ -116,6 +116,7 @@ function Dataface_ExistingRelatedRecordForm(&$record, $relationshipName, $db='')
116116
);
117117

118118
}
119+
function Dataface_ExistingRelatedRecordForm(&$record, $relationshipName, $db='') { self::__construct($record, $relationshipName, $db); }
119120

120121

121122
/**

Dataface/FormTool.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1547,9 +1547,10 @@ function saveSession($record, $new=false, $session_key = null ){
15471547
* handles the creation of multiple fields of the same name gracefully.
15481548
*/
15491549
class HTML_QuickFormFactory extends HTML_QuickForm {
1550-
function HTML_QuickFormFactory($name){
1550+
function __construct($name){
15511551
$this->HTML_QuickForm($name);
15521552
}
1553+
function HTML_QuickFormFactory($name) { self::__construct($name); }
15531554

15541555
function &addElement($element){
15551556
$args = func_get_args();

Dataface/IO.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ class Dataface_IO {
7474
*/
7575
var $_altTablename = null;
7676

77-
function Dataface_IO($tablename, $db=null, $altTablename=null){
77+
function __construct($tablename, $db=null, $altTablename=null){
7878
$app =& Dataface_Application::getInstance();
7979
$this->lang = $app->_conf['lang'];
8080
$this->_table =& Dataface_Table::loadTable($tablename, $db);
8181
$this->_serializer = new Dataface_Serializer($tablename);
8282
$this->_altTablename = $altTablename;
8383
$this->dbObj =& Dataface_DB::getInstance();
8484
}
85+
function Dataface_IO($tablename, $db=null, $altTablename=null) { self::__construct($tablename, $db, $altTablename); }
8586

8687
function __destruct(){
8788
unset($this->_table);

Dataface/ImportFilter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ class Dataface_ImportFilter {
5858
* @param $name The name of the filter.
5959
* @param $label The label of the filter.
6060
*/
61-
function Dataface_ImportFilter( $tablename, $name, $label ){
61+
function __construct( $tablename, $name, $label ){
6262
$this->_table =& Dataface_Table::loadTable($tablename);
6363
$this->label = $label;
6464
$this->name = $name;
6565
}
66+
function Dataface_ImportFilter($tablename, $name, $label) { self::__construct($tablename, $name, $label); }
6667

6768

6869
/**

Dataface/ImportFilter/xml.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@
5151

5252
class Dataface_ImportFilter_xml extends Dataface_ImportFilter {
5353

54-
function Dataface_ImportFilter_xml(){
54+
function __construct(){
5555
$this->name = 'xml';
5656
$this->label = 'XML';
5757
}
58+
function Dataface_ImportFilter_xml() { self::__construct(); }
5859

5960

6061
function import(&$data){

Dataface/ImportForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Dataface_ImportForm extends HTML_QuickForm {
4747
var $_filterNames=array();
4848

4949

50-
function Dataface_ImportForm( $tablename, $relationshipname=null ){
50+
function __construct( $tablename, $relationshipname=null ){
5151
$this->_table =& Dataface_Table::loadTable($tablename);
5252
if ( $relationshipname !== null ) $this->_relationship =& $this->_table->getRelationship($relationshipname);
5353
else $this->_relationship =& $this->getRelationship($this->_table);
@@ -59,6 +59,7 @@ function Dataface_ImportForm( $tablename, $relationshipname=null ){
5959

6060

6161
}
62+
function Dataface_ImportForm($tablename, $relationshipname=null) { self::__construct($tablename, $relationshipname); }
6263

6364

6465

Dataface/ImportRecord.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ class Dataface_ImportRecord {
3737
* }
3838
* </code>
3939
*/
40-
function Dataface_ImportRecord($classpath, $data){
40+
function __construct($classpath, $data){
4141
$this->classpath = $classpath;
4242
$this->load($data);
4343
}
44+
function Dataface_ImportRecord($classpath, $data) { self::__construct($classpath, $data); }
4445

4546

4647
/**

Dataface/MetadataTool.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ class Dataface_MetadataTool {
3636
*/
3737
var $keyColumns = null;
3838

39-
function Dataface_MetadataTool($tablename){
39+
function __construct($tablename){
4040
$this->tablename = $tablename;
4141
}
42+
function Dataface_MetadataTool($tablename) { self::__construct($tablename); }
4243

4344
/**
4445
* Checks a table name to see if it is a metadata table. A metadata table

Dataface/NavMenu.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Dataface_NavMenu {
2929
//var $_smarty;
3030
var $_skinTool;
3131
var $_current;
32-
function Dataface_NavMenu( $tables, $current='' ){
32+
function __construct( $tables, $current='' ){
3333
$this->_tables = $tables;
3434
if ( $current ){
3535
$this->_current = $current ;
@@ -45,6 +45,7 @@ function Dataface_NavMenu( $tables, $current='' ){
4545
//$this->_smarty->compile_dir = $GLOBALS['Dataface_Globals_Templates_c'];
4646
$this->_skinTool =& Dataface_SkinTool::getInstance();
4747
}
48+
function Dataface_NavMenu($tables, $current='') { self::__construct($tables, $current); }
4849

4950

5051
function toHtml(){

Dataface/Ontology.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ class Dataface_Ontology {
1616
var $fieldnames;
1717
var $relationships;
1818

19-
function Dataface_Ontology($tablename){
19+
function __construct($tablename){
2020
$this->table =& Dataface_Table::loadTable($tablename);
2121
}
22+
function Dataface_Ontology($tablename) { self::__construct($tablename); }
2223

2324
function &getAttributes(){
2425
if ( !isset($this->attributes) ){
@@ -137,10 +138,11 @@ class Dataface_Ontology_individual {
137138
var $record;
138139
var $ontology;
139140

140-
function Dataface_Ontology_individual(&$ontology, &$record){
141+
function __construct(&$ontology, &$record){
141142
$this->record =& $record;
142143
$this->ontology =& $ontology;
143144
}
145+
function Dataface_Ontology_individual(&$ontology, &$record) { self::__construct($ontology, $record); }
144146

145147
function _get($method, $attname){
146148
return $this->record->$method(

Dataface/OutputCache.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Dataface_OutputCache {
2626
*/
2727
var $usedTables=array();
2828

29-
function Dataface_OutputCache($params=array()){
29+
function __construct($params=array()){
3030
if ( !extension_loaded('zlib') ){
3131
$this->useGzipCompression = false;
3232
} else if ( isset($params['useGzipCompression']) ){
@@ -44,6 +44,7 @@ function Dataface_OutputCache($params=array()){
4444

4545
if ( !$this->_cacheTableExists() ) $this->_createCacheTable();
4646
}
47+
function Dataface_OutputCache($params=array()) { self::__construct($params); }
4748

4849
function getUserId(){
4950
if ( !isset($this->userId) ){

Dataface/PageCache.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class Dataface_PageCache extends Cache_Lite {
2424

2525
var $tables;
26-
function Dataface_PageCache($tables=array()){
26+
function __construct($tables=array()){
2727
$this->tables =& $tables;
2828
$app =& Dataface_Application::getInstance();
2929
$params = array(
@@ -43,6 +43,7 @@ function Dataface_PageCache($tables=array()){
4343

4444

4545
}
46+
function Dataface_PageCache($tables=array()) { self::__construct($tables); }
4647

4748
function dbmtime(){
4849
$tables =& $this->tables;

Dataface/QueryBuilder.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Dataface_QueryBuilder {
127127
* @param query Associative array with keys = column names and values equal
128128
* query values for that column.
129129
*/
130-
function Dataface_QueryBuilder($tablename, $query=''){
130+
function __construct($tablename, $query=''){
131131
$this->_tablename = $tablename;
132132
$this->_table =& Dataface_Table::loadTable($tablename);
133133
$this->_query = is_array($query) ? $query : array();
@@ -155,6 +155,7 @@ function Dataface_QueryBuilder($tablename, $query=''){
155155

156156

157157
}
158+
function Dataface_QueryBuilder($tablename, $query='') { self::__construct($tablename, $query); }
158159

159160
function _opt($code, $isText=true){
160161
switch ( $code ){

Dataface/QueryTranslator.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function translateJoinClause($func, $lang=null){}
6565
function translateWhereClause($func, $lang=null){}
6666
*/
6767

68-
function Dataface_QueryTranslator($lang=null){
68+
function __construct($lang=null){
6969
$this->app =& Dataface_Application::getInstance();
7070
if ( !isset($lang) ) $lang = $this->app->_conf['lang'];
7171
$this->_lang = $lang;
@@ -84,6 +84,7 @@ function Dataface_QueryTranslator($lang=null){
8484
//}
8585

8686
}
87+
function Dataface_QueryTranslator($lang=null) { self::__construct($lang); }
8788

8889
/**
8990
* IF this translator is meant to work within the context of another translator,

Dataface/QuickForm.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Dataface_QuickForm extends HTML_QuickForm {
172172
* @type array(string)
173173
*
174174
*/
175-
function Dataface_QuickForm($tablename, $db='', $query='', $formname='', $new=false, $fieldnames=null, $lang=null){
175+
function __construct($tablename, $db='', $query='', $formname='', $new=false, $fieldnames=null, $lang=null){
176176
$app =& Dataface_Application::getInstance();
177177
$this->app =& $app;
178178
$appQuery =& $app->getQuery();
@@ -287,6 +287,7 @@ function Dataface_QuickForm($tablename, $db='', $query='', $formname='', $new=f
287287

288288

289289
}
290+
function Dataface_QuickForm($tablename, $db='', $query='', $formname='', $new=false, $fieldnames=null, $lang=null) { self::__construct($tablename, $db, $query, $formname, $new, $fieldnames, $lang); }
290291

291292

292293
function formSubmitted(){

Dataface/RecordGrid.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Dataface_RecordGrid {
7171
var $actionCellCallbacks = array();
7272
var $cellFilters = array();
7373

74-
function Dataface_RecordGrid(&$records, $columns=null, $labels=null){
74+
function __construct(&$records, $columns=null, $labels=null){
7575
$this->records =& $records;
7676
if ( !is_array($this->records) ){
7777
throw new Exception('In Dataface_RecordGrid the first parameter is expected to be an array but received "'.get_class($records).'"', E_USER_ERROR);
@@ -80,6 +80,7 @@ function Dataface_RecordGrid(&$records, $columns=null, $labels=null){
8080
$this->columns = $columns;
8181
$this->labels = $labels;
8282
}
83+
function Dataface_RecordGrid(&$records, $columns=null, $labels=null) { self::__construct($records, $columns, $labels); }
8384

8485
function addActionCellCallback($callback){
8586
$this->actionCellCallbacks[] = $callback;

0 commit comments

Comments
 (0)