LatexCompiler
class LatexCompiler (View source)
Properties
| protected obj|aray | $data | Data to be passed to $view | |
| protected string | $view | view to be rendered | |
| protected string | $fileName | File name without extension | |
| protected int | $runs | Number of runs for pdflatex to run |
Methods
No description
Master Compile
Delete PDF file
Set Storage Path
Fills in the template
Writes filled in template to file
Sends to terminal to compile in tex
Check for existing PDF and move from temp
Tearsdown temp folder
Details
at line 40
__construct($data, $view, $fileName, $runs = null)
at line 61
string
compile()
Master Compile
The master compilation function to generate a Latex Document from the shell and return the file path to the user.
at line 78
deletePdf()
Delete PDF file
Can be called anywhere to delete the PDF function generated from the class.
at line 92
string
storagePath(string $storagePath)
Set Storage Path
Called after the class is initialized to overide the default storage path
at line 104
protected string
fillTemplate(string $view)
Fills in the template
at line 116
protected
writeToFile(string $fileName, string $template)
Writes filled in template to file
at line 134
protected
compileTex(string $fileName, int $runs)
Sends to terminal to compile in tex
Sets the absolute file position on the disk and attempts to run pdf latex after cding into the directory. If the exit code is anything other than 0, it logs the error in the latex.log, tears down the temp directory, and throws a new exception which can be caught if desired.
at line 160
protected
handlePDF(string $fileName)
Check for existing PDF and move from temp
Checks the PDF path to see if there is already a PDF with the same name. If there is, it deletes the PDF in the path and then moves the new PDF there. If not, then it moves the PDF.
at line 172
protected
tearDownTemp()
Tearsdown temp folder
Deletes temp directory