ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 9581


Ignore:
Timestamp:
Dec 17, 2008, 10:30:00 PM (11 years ago)
Author:
ebihara
Message:

changed openpne:install for comfirmation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/task/openpneInstallTask.class.php

    r9199 r9581  
    4343    }
    4444
    45     @$this->fixPerms();
    46     @$this->clearCache();
    47     $this->configureDatabase($dbms, $username, $password, $hostname, $dbname, $sock);
    48     $this->buildDb();
    49     $this->clearCache();
     45    $maskedPassword = '******';
     46    if (!$password)
     47    {
     48      $maskedPassword = '';
     49    }
     50
     51    $this->log($this->formatList(array(
     52      'The DBMS             ' => $dbms,
     53      'The Database Username' => $username,
     54      'The Database Password' => $maskedPassword,
     55      'The Database Hostname' => $hostname,
     56      'The Database Name    ' => $dbname,
     57      'The Database Socket  ' => $sock,
     58    )));
     59
     60    if ($this->askConfirmation('Is it OK to start this task? (y/n)'))
     61    {
     62      @$this->fixPerms();
     63      @$this->clearCache();
     64      $this->configureDatabase($dbms, $username, $password, $hostname, $dbname, $sock);
     65      $this->buildDb();
     66      $this->clearCache();
     67    }
    5068  }
    5169
     
    135153  {
    136154    $buildAllLoad = new sfPropelBuildAllLoadTask($this->dispatcher, $this->formatter);
    137     $buildAllLoad->run();
     155    $buildAllLoad->run(array(), array('--no-confirmation'));
    138156  }
    139157
     
    143161    $permissions->run();
    144162  }
     163
     164  protected function formatList($list)
     165  {
     166    $result = '';
     167
     168    foreach ($list as $key => $value)
     169    {
     170      $result .= $this->formatter->format($key, 'INFO')."\t";
     171      $result .= $value."\n";
     172    }
     173
     174    return $result;
     175  }
    145176}
Note: See TracChangeset for help on using the changeset viewer.