예제 #1
0
 /**
  * Parse timestamp from user input
  *
  * @return string
  *
  * @throws oxConsoleException
  */
 protected function _parseTimestamp()
 {
     $oInput = $this->getInput();
     if ($sTimestamp = $oInput->getArgument(1)) {
         if (!oxMigrationQuery::isValidTimestamp($sTimestamp)) {
             if ($sTime = strtotime($sTimestamp)) {
                 $sTimestamp = date('YmdHis', $sTime);
             } else {
                 /** @var oxConsoleException $oEx */
                 $oEx = oxNew('oxConsoleException');
                 $oEx->setMessage('Invalid timestamp format, use YYYYMMDDhhmmss format');
                 throw $oEx;
             }
         }
         return $sTimestamp;
     }
     return oxMigrationQuery::getCurrentTimestamp();
 }