constructors are named __construct for php8
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Apr 2022 08:10:54 +0000 (10:10 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Apr 2022 08:11:24 +0000 (10:11 +0200)
13 files changed:
planetlab/includes/plc_objects.php
planetlab/includes/plc_peers.php
planetlab/includes/plc_session.php
planetlab/includes/plc_visibletags.php [deleted file]
planetlab/includes/plc_visibletags2.php
plekit/php/columns.php
plekit/php/datepicker.php
plekit/php/details.php
plekit/php/form.php
plekit/php/table.php
plekit/php/table2.php
plekit/php/toggle.php
plekit/php/tophat_api.php

index 27ca475..d726d5f 100644 (file)
@@ -69,7 +69,7 @@ class Person {
   var $email;
   var $enabled;
 
-  function Person($person) {
+  function __construct($person) {
     $this->roles = $person['role_ids'];
     $this->person_id = $person['person_id'];
     $this->first_name = $person['first_name'];
@@ -136,7 +136,7 @@ class Person {
 class PCU {
   var $data;
 
-  function PCU($pcu) {
+  function __construct($pcu) {
     $this->data = $pcu;
   }
 
@@ -169,7 +169,7 @@ class PCU {
 class Address {
   var $data;
 
-  function Address($address) {
+  function __construct($address) {
     $this->data = $address;
   }
 
@@ -204,7 +204,7 @@ class Node extends PlcObject {
   var $pcu_ids;
   var $data;
 
-  function Node($node) {
+  function __construct($node) {
     global $plc, $api, $adm;
     $this->data = $node;
     $this->node_type = $node['node_type'];
@@ -318,7 +318,7 @@ class Node extends PlcObject {
 class Slice {
   var $data;
 
-  function Slice($val) {
+  function __construct($val) {
     $this->data = $val;
   }
 
@@ -349,7 +349,7 @@ class Site extends PlcObject {
   var $site_id;
   var $data;
 
-  function Site($site_id) {
+  function __construct($site_id) {
     global $plc, $api, $adm;
     $site_info= $adm->GetSites( array( intval($site_id) ) );
     $this->data = $site_info[0];
index 6fa26ca..a4a4dda 100644 (file)
@@ -9,8 +9,8 @@ drupal_set_html_head('<link href="/planetlab/css/plc_peers.css" rel="stylesheet"
 // all known peers hashed on peer_id
 class Peers {
   var $hash;
-  
-  function Peers ($api) {
+
+  function __construct ($api) {
     $hash=array();
     // fake entry fot the local myplc
     $local_fake_peer = array ('peername' => PLC_NAME,
@@ -110,7 +110,7 @@ class PeerScope {
   var $filter;
   var $label;
 
-  function PeerScope ($api, $peerscope) {
+  function __construct ($api, $peerscope) {
     switch ($peerscope) {
     case '':
       $this->filter=array();
index 4c42375..7850d86 100644 (file)
@@ -48,7 +48,7 @@ class PLCSession
   var $alt_person;
   var $alt_auth;
 
-  function PLCSession($name = NULL, $pass = NULL)
+  function __construct($name = NULL, $pass = NULL)
   {
     $name= strtolower( $name );
     // User API access
diff --git a/planetlab/includes/plc_visibletags.php b/planetlab/includes/plc_visibletags.php
deleted file mode 100644 (file)
index 0d45bb8..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
-  // $Id: plc_functions.php 15734 2009-11-13 10:52:31Z thierry $
-
-  // utility function for displaying extra columns based on tags and categories
-  // expected type is e.g. 'node' 
-
-class VisibleTags {
-  var $api;
-  var $type;
-  
-  function VisibleTags ($api,$type) {
-    $this->api=$api;
-    $this->type=$type;
-    $this->columns=NULL;
-  }
-  
-  // returns an ordered set of columns - compute only once
-  function columns () {
-    # if cached
-    if ($this->columns != NULL) 
-      return $this->columns;
-
-    // scan tag types to find relevant additional columns
-    $tag_types = $this->api->GetTagTypes(array('category'=>"$type*/ui*"));
-    
-    $columns = array();
-    foreach ($tag_types as $tag_type) {
-      $tagname=$tag_type['tagname'];
-      $column=array();
-      $column['tagname']=$tagname;
-      // defaults
-      $column['header']=$tagname;
-      $column['rank']=$tagname;
-      $column['type']='string';
-      $column['description']=$tag_type['description'];
-      // split category and parse any setting
-      $category_tokens=explode('/',$tag_type['category']);
-      foreach ($category_tokens as $token) {
-       $assign=explode('=',$token);
-       if (count($assign)==2) 
-         $column[$assign[0]]=$assign[1];
-      }
-      $columns []= $column;
-    }
-    
-    // sort upon 'rank'
-    usort ($columns, create_function('$col1,$col2','return strcmp($col1["rank"],$col2["rank"]);'));
-
-    # cache for next time
-    $this->columns=$columns;
-//    plc_debug('columns',$columns);
-    return $columns;
-  }
-
-  // extract tagname
-  function column_names () {
-    return array_map(create_function('$tt','return $tt["tagname"];'),$this->columns());
-  }
-  
-  // to add with array_merge to the headers part of the Plekit Table
-  function headers () {
-    $headers=array();
-    $columns=$this->columns();
-    foreach ($columns as $column)
-      if ($column['header'] == $column['tagname']) 
-       $headers[$column['header']]=$column['type'];
-      else
-       $headers[$column['header']]=array('type'=>$column['type'],'title'=>$column['description']);
-    return $headers;
-  }
-
-  // to add with array_merge to the notes part of the Plekit Table
-  function notes () {
-    $notes=array();
-    $columns=$this->columns();
-    foreach ($columns as $column)
-      if ($column['header'] != $column['tagname']) 
-       $notes []= strtoupper($column['header']) . ' = ' . $column['description'];
-    return $notes;
-  }
-
-}
-?>
index e0aad8f..8bcdb81 100644 (file)
@@ -8,8 +8,8 @@
 class VisibleTags {
   var $api;
   var $type;
-  
-  function VisibleTags ($api,$type) {
+
+  function __construct ($api,$type) {
     $this->api=$api;
     $this->type=$type;
     $this->columns=NULL;
index 3cab960..e75e4b4 100644 (file)
@@ -31,7 +31,7 @@ var $table_ids;
 var $HopCount = array();
 var $RTT = array();
 
-function PlekitColumns ($column_configuration, $fix_columns, $tag_columns, $extra_columns=NULL, $this_table_headers=NULL) {
+function __construct ($column_configuration, $fix_columns, $tag_columns, $extra_columns=NULL, $this_table_headers=NULL) {
 
        if ($column_configuration != NULL) {
        $this->fix_columns = $fix_columns;
index 7a983f8..9460e8b 100644 (file)
@@ -18,8 +18,8 @@ class PlekitDatepicker {
 
   var $id;
 
-  function PlekitDatepicker ($id,$display,$options=NULL) {
-    $datepicker_default_options = 
+  function __construct ($id,$display,$options=NULL) {
+    $datepicker_default_options =
       array ('inline'=>true,
             'format'=>'Y-sl-M-sl-d',
             'value'=>'');
index e9cbc39..72d1f6a 100644 (file)
@@ -32,7 +32,7 @@ class PlekitDetails {
   var $height;
   var $input_type;
 
-  function PlekitDetails ($editable) {
+  function __construct ($editable) {
     $this->editable=$editable;
     $this->form=NULL;
     $this->width="";
index f56f02a..6436172 100644 (file)
@@ -16,7 +16,7 @@ class PlekitForm {
   var $onSubmit; // can be set with options
   var $onReset; // can be set with options
 
-  function PlekitForm ($full_url, $values, $options=NULL) {
+  function __construct ($full_url, $values, $options=NULL) {
     // so we can use the various l_* functions:
     // we parse the url to extract var-values pairs, 
     // and add them to the 'values' argument if any
@@ -160,7 +160,7 @@ class PlekitFormButton extends PlekitForm {
   var $button_id;
   var $button_text;
 
-  function PlekitFormButton ($full_url, $button_id, $button_text, $method="POST") {
+  function __construct ($full_url, $button_id, $button_text, $method="POST") {
     $this->PlekitForm($full_url,array(),$method);
     $this->button_id=$button_id;
     $this->button_text=$button_text;
index dc5bd8e..2e75dac 100644 (file)
@@ -60,7 +60,7 @@ class PlekitTable {
   // internal
   var $has_tfoot;
 
-  function PlekitTable ($table_id,$headers,$sort_column,$options=NULL) {
+  function __construct ($table_id,$headers,$sort_column,$options=NULL) {
     $this->table_id = $table_id;
     $this->headers = $headers;
     $this->sort_column = $sort_column;
index 094c3f2..d3b6849 100644 (file)
@@ -61,7 +61,7 @@ class PlekitTable {
   // internal
   var $has_tfoot;
 
-  function PlekitTable ($table_id,$headers,$sort_column,$options=NULL) {
+  function __construct ($table_id,$headers,$sort_column,$options=NULL) {
     $this->table_id = $table_id;
     $this->headers = $headers;
     $this->sort_column = $sort_column;
index b481195..014be9e 100644 (file)
@@ -37,7 +37,7 @@ class PlekitToggle {
   var $id;
   var $nifty;
 
-  function PlekitToggle ($id,$trigger,$options=NULL) {
+  function __construct ($id,$trigger,$options=NULL) {
     $this->id = $id;
     $this->trigger=$trigger;
     if ( ! $options ) $options = array();
index 3ce485d..4e690c5 100644 (file)
@@ -21,7 +21,7 @@ class TopHatAPI
   var $calls;
   var $multicall;
 
-  function TopHatAPI($auth = NULL,
+  function __construct($auth = NULL,
                  $server = TOPHAT_API_HOST,
                  $port = TOPHAT_API_PORT,
                  $path = TOPHAT_API_PATH,