src/Starter.php
public function process (Report $report, bool $skipExec = false)
    {
        $compiledFullPath = $this->compiledPath . DIRECTORY_SEPARATOR . pathinfo($report->getSourceFile(), PATHINFO_FILENAME) . '.jasper';
        $processedFullPath = $this->processedPath . DIRECTORY_SEPARATOR . uniqid('ASB');

        $format = ' -f ' . $report->getTargetType();

        $value = empty($report->getDataSource()) ? $this->getDataSource() : $report->getDataSource();
        $type = "-t $value ";

        $datafile = '';
        if (!empty($report->getFile('file'))) {
            $datafile .= $this->processCsvFileOptions($report);
        }

        $database = $this->processDatabaseOptions($report);
        $parameters = $this->processReportParameters($report);

        $this->shellCommand = $this->executablePath . " pr -o $processedFullPath $compiledFullPath $format $type $database $datafile $parameters";

        if (!$skipExec) {
            $oldcwd = getcwd();
            chdir($this->sourcePath);
            $error = shell_exec(escapeshellcmd($this->shellCommand));
            chdir($oldcwd);

            if (!empty($error)) {
                throw new \Exception($error);
            }
        }

        return $processedFullPath . '.' . $report->getTargetType();
    }
public function process (Report $report, bool $skipExec = false)
    {
        $compiledFullPath = $this->compiledPath . DIRECTORY_SEPARATOR . pathinfo($report->getSourceFile(), PATHINFO_FILENAME) . '.jasper';
        $processedFullPath = $this->processedPath . DIRECTORY_SEPARATOR . uniqid('ASB');

        $format = ' -f ' . $report->getTargetType();

        $value = empty($report->getDataSource()) ? $this->getDataSource() : $report->getDataSource();
        $type = "-t $value ";

        $datafile = '';
        if (!empty($report->getFile('file'))) {
            $datafile .= $this->processCsvFileOptions($report);
        }

        $database = $this->processDatabaseOptions($report);
        $parameters = $this->processReportParameters($report);

        $this->shellCommand = $this->executablePath . " pr -o $processedFullPath $compiledFullPath $format $type $database $datafile $parameters";

        if (!$skipExec) {
            $oldcwd = getcwd();
            chdir($this->sourcePath);
            $error = shell_exec(escapeshellcmd($this->shellCommand));
            chdir($oldcwd);

            if (!empty($error)) {
                throw new \Exception($error);
            }
        }

        return $processedFullPath . '.' . $report->getTargetType();
    }
public function process ( Report $ report , bool $ skipExec = false ) { $ compiledFullPath = $ this -> compiledPath . DIRECTORY_SEPARATOR . pathinfo ( $ report -> getSourceFile ( ) , PATHINFO_FILENAME ) . '.jasper' ; $ processedFullPath = $ this -> processedPath . DIRECTORY_SEPARATOR . uniqid ( 'ASB' ) ; $ format = ' -f ' . $ report -> getTargetType ( ) ; $ value = empty ( $ report -> getDataSource ( ) ) ? $ this -> getDataSource ( ) : $ report -> getDataSource ( ) ; $ type = "-t $value " ; $ datafile = '' ; if ( ! empty ( $ report -> getFile ( 'file' ) ) ) { $ datafile .= $ this -> processCsvFileOptions ( $ report ) ; } $ database = $ this -> processDatabaseOptions ( $ report ) ; $ parameters = $ this -> processReportParameters ( $ report ) ; $ this -> shellCommand = $ this -> executablePath . " pr -o $processedFullPath $compiledFullPath $format $type $database $datafile $parameters" ; if ( ! $ skipExec ) { $ oldcwd = getcwd ( ) ; chdir ( $ this -> sourcePath ) ; $ error = shell_exec ( escapeshellcmd ( $ this -> shellCommand ) ) ; chdir ( $ oldcwd ) ; if ( ! empty ( $ error ) ) { throw new \ Exception ( $ error ) ; } } return $ processedFullPath . '.' . $ report -> getTargetType ( ) ; }
Process JASPER file into PDF or similar output format.

@return $this
Process JASPER file into PDF or similar output format .