Dotclear


Ignore:
Timestamp:
09/14/18 12:16:17 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

short notation for array (array() → [])

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/inc/class.dc.maintenance.php

    r3731 r3874  
    2020    public $p_url; 
    2121 
    22     private $tasks  = array(); 
    23     private $tabs   = array(); 
    24     private $groups = array(); 
     22    private $tasks  = []; 
     23    private $tabs   = []; 
     24    private $groups = []; 
    2525    private $logs   = null; 
    2626 
     
    6161     * @return <b>dcMaintenance</b>    Self 
    6262     */ 
    63     public function addTab($id, $name, $options = array()) 
     63    public function addTab($id, $name, $options = []) 
    6464    { 
    6565        $this->tabs[$id] = new dcMaintenanceDescriptor($id, $name, $options); 
     
    100100     * @return <b>dcMaintenance</b>    Self 
    101101     */ 
    102     public function addGroup($id, $name, $options = array()) 
     102    public function addGroup($id, $name, $options = []) 
    103103    { 
    104104        $this->groups[$id] = new dcMaintenanceDescriptor($id, $name, $options); 
     
    205205        ); 
    206206 
    207         $logs = array(); 
     207        $logs = []; 
    208208        while ($rs->fetch()) { 
    209209            $logs[] = $rs->log_id; 
     
    231231    { 
    232232        // Retrieve logs from this task 
    233         $rs = $this->core->log->getLogs(array( 
     233        $rs = $this->core->log->getLogs([ 
    234234            'log_table' => 'maintenance', 
    235235            'blog_id'   => 'all' 
    236         )); 
    237  
    238         $logs = array(); 
     236        ]); 
     237 
     238        $logs = []; 
    239239        while ($rs->fetch()) { 
    240240            $logs[] = $rs->log_id; 
     
    250250     * Get logs 
    251251     * 
    252      * Return array( 
    253      *        task id => array( 
     252     * Return [ 
     253     *        task id => [ 
    254254     *            timestamp of last execution, 
    255255     *            logged on current blog or not 
    256      *        ) 
    257      * ) 
     256     *        ] 
     257     * ] 
    258258     * 
    259259     * @return    <b>array</b> List of logged tasks 
     
    262262    { 
    263263        if ($this->logs === null) { 
    264             $rs = $this->core->log->getLogs(array( 
     264            $rs = $this->core->log->getLogs([ 
    265265                'log_table' => 'maintenance', 
    266266                'blog_id'   => 'all' 
    267             )); 
    268  
    269             $this->logs = array(); 
     267            ]); 
     268 
     269            $this->logs = []; 
    270270            while ($rs->fetch()) { 
    271                 $this->logs[$rs->log_msg] = array( 
     271                $this->logs[$rs->log_msg] = [ 
    272272                    'ts'   => strtotime($rs->log_dt), 
    273273                    'blog' => $rs->blog_id == $this->core->blog->id 
    274                 ); 
     274                ]; 
    275275            } 
    276276        } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map