public function __construct(PHP_Beautifier_Batch $oBatch) { parent::__construct($oBatch); $sOutput = $this->oBatch->getOutputPath(); $sOutput = preg_replace("/(\\.tar|\\.tar\\.gz|\\.tgz|\\.gz|\\.tar\\.bz2)\$/", '', $sOutput) . "." . $this->sExt; PHP_Beautifier_Common::createDir($sOutput); $this->oTar = new Archive_Tar($sOutput, $this->sCompress); }
public function save() { $aInputFiles = $this->oBatch->getInputFiles(); $sOutputPath = $this->oBatch->getOutputPath(); $aOutputFiles = PHP_Beautifier_Common::getSavePath($aInputFiles, $sOutputPath); for ($x = 0; $x < count($aInputFiles); $x++) { unset($oTar); $oTar = $this->getTar($aOutputFiles[$x]); $this->beautifierSetInputFile($aInputFiles[$x]); $this->beautifierProcess(); PHP_Beautifier_Common::createDir($aOutputFiles[$x]); $oTar->addString(basename($aOutputFiles[$x]), $this->beautifierGet()); } return true; }
public function save() { $aInputFiles = $this->oBatch->getInputFiles(); $sOutputPath = $this->oBatch->getOutputPath(); $aOutputFiles = PHP_Beautifier_Common::getSavePath($aInputFiles, $sOutputPath); $oLog = PHP_Beautifier_Common::getLog(); for ($x = 0; $x < count($aInputFiles); $x++) { try { $this->beautifierSetInputFile($aInputFiles[$x]); $this->beautifierProcess(); PHP_Beautifier_Common::createDir($aOutputFiles[$x]); $this->beautifierSave($aOutputFiles[$x]); } catch (Exception $oExp) { $oLog->log($oExp->getMessage(), PEAR_LOG_ERR); } } return true; }