ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Helper class to be used in sample code. More...
Public Member Functions | |
isCli () | |
Returns whether we run on CLI or browser. More... | |
getScriptFilename () | |
Return the filename currently being executed. More... | |
isIndex () | |
Whether we are executing the index page. More... | |
getPageTitle () | |
Return the page title. More... | |
getPageHeading () | |
Return the page heading. More... | |
getSamples () | |
Returns an array of all known samples. More... | |
write (Spreadsheet $spreadsheet, $filename, array $writers=['Xlsx', 'Xls']) | |
Write documents. More... | |
getFilename ($filename, $extension='xlsx') | |
Returns the filename that should be used for sample output. More... | |
getTemporaryFilename ($extension='xlsx') | |
Return a random temporary file name. More... | |
log ($message) | |
logEndingNotes () | |
Log ending notes. More... | |
logWrite (IWriter $writer, $path, $callStartTime) | |
Log a line about the write operation. More... | |
logRead ($format, $path, $callStartTime) | |
Log a line about the read operation. More... | |
Protected Member Functions | |
isDirOrMkdir (string $folder) | |
Private Member Functions | |
getTemporaryFolder () | |
Returns the temporary directory and make sure it exists. More... | |
Helper class to be used in sample code.
Definition at line 18 of file Sample.php.
PhpOffice\PhpSpreadsheet\Helper\Sample::getFilename | ( | $filename, | |
$extension = 'xlsx' |
|||
) |
Returns the filename that should be used for sample output.
string | $filename | |
string | $extension |
Definition at line 157 of file Sample.php.
References $filename, and PhpOffice\PhpSpreadsheet\Helper\Sample\getTemporaryFolder().
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\write().
PhpOffice\PhpSpreadsheet\Helper\Sample::getPageHeading | ( | ) |
Return the page heading.
Definition at line 65 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\getScriptFilename(), and PhpOffice\PhpSpreadsheet\Helper\Sample\isIndex().
PhpOffice\PhpSpreadsheet\Helper\Sample::getPageTitle | ( | ) |
Return the page title.
Definition at line 55 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\getScriptFilename(), and PhpOffice\PhpSpreadsheet\Helper\Sample\isIndex().
PhpOffice\PhpSpreadsheet\Helper\Sample::getSamples | ( | ) |
PhpOffice\PhpSpreadsheet\Helper\Sample::getScriptFilename | ( | ) |
Return the filename currently being executed.
Definition at line 35 of file Sample.php.
References $_SERVER.
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\getPageHeading(), PhpOffice\PhpSpreadsheet\Helper\Sample\getPageTitle(), and PhpOffice\PhpSpreadsheet\Helper\Sample\isIndex().
PhpOffice\PhpSpreadsheet\Helper\Sample::getTemporaryFilename | ( | $extension = 'xlsx' | ) |
Return a random temporary file name.
string | $extension |
Definition at line 171 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\getTemporaryFolder().
|
private |
Returns the temporary directory and make sure it exists.
Definition at line 139 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\isDirOrMkdir().
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\getFilename(), and PhpOffice\PhpSpreadsheet\Helper\Sample\getTemporaryFilename().
PhpOffice\PhpSpreadsheet\Helper\Sample::isCli | ( | ) |
Returns whether we run on CLI or browser.
Definition at line 25 of file Sample.php.
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\log().
|
protected |
Definition at line 129 of file Sample.php.
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\getTemporaryFolder().
PhpOffice\PhpSpreadsheet\Helper\Sample::isIndex | ( | ) |
Whether we are executing the index page.
Definition at line 45 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\getScriptFilename().
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\getPageHeading(), and PhpOffice\PhpSpreadsheet\Helper\Sample\getPageTitle().
PhpOffice\PhpSpreadsheet\Helper\Sample::log | ( | $message | ) |
Definition at line 179 of file Sample.php.
References $message, PhpOffice\PhpSpreadsheet\Helper\Sample\isCli(), and PHP_EOL.
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\logEndingNotes(), PhpOffice\PhpSpreadsheet\Helper\Sample\logRead(), and PhpOffice\PhpSpreadsheet\Helper\Sample\logWrite().
PhpOffice\PhpSpreadsheet\Helper\Sample::logEndingNotes | ( | ) |
Log ending notes.
Definition at line 188 of file Sample.php.
References PhpOffice\PhpSpreadsheet\Helper\Sample\log().
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\write().
PhpOffice\PhpSpreadsheet\Helper\Sample::logRead | ( | $format, | |
$path, | |||
$callStartTime | |||
) |
Log a line about the read operation.
string | $format | |
string | $path | |
float | $callStartTime |
Definition at line 218 of file Sample.php.
References $message, and PhpOffice\PhpSpreadsheet\Helper\Sample\log().
PhpOffice\PhpSpreadsheet\Helper\Sample::logWrite | ( | IWriter | $writer, |
$path, | |||
$callStartTime | |||
) |
Log a line about the write operation.
string | $path | |
float | $callStartTime |
Definition at line 200 of file Sample.php.
References $format, $message, and PhpOffice\PhpSpreadsheet\Helper\Sample\log().
Referenced by PhpOffice\PhpSpreadsheet\Helper\Sample\write().
PhpOffice\PhpSpreadsheet\Helper\Sample::write | ( | Spreadsheet | $spreadsheet, |
$filename, | |||
array | $writers = ['Xlsx' , |
||
'Xls'] | |||
) |
Write documents.
string | $filename | |
string[] | $writers |
Definition at line 112 of file Sample.php.
References $filename, $path, PhpOffice\PhpSpreadsheet\IOFactory\createWriter(), PhpOffice\PhpSpreadsheet\Helper\Sample\getFilename(), PhpOffice\PhpSpreadsheet\Helper\Sample\logEndingNotes(), PhpOffice\PhpSpreadsheet\Helper\Sample\logWrite(), and PhpOffice\PhpSpreadsheet\Spreadsheet\setActiveSheetIndex().