Definition at line 36 of file File.php.
◆ file_exists()
static PHPExcel_Shared_File::file_exists |
( |
|
$pFilename | ) |
|
|
static |
Verify if a file exists.
- Parameters
-
- Returns
- bool
Definition at line 73 of file File.php.
Referenced by PHPExcel_Writer_Excel2007_ContentTypes\_getImageMimeType(), realpath(), and sys_get_temp_dir().
77 if ( strtolower(substr($pFilename, 0, 3)) ==
'zip' ) {
79 $zipFile = substr($pFilename, 6, strpos($pFilename,
'#') - 6);
80 $archiveFile = substr($pFilename, strpos($pFilename,
'#') + 1);
82 $zip =
new ZipArchive();
83 if ($zip->open($zipFile) ===
true) {
84 $returnValue = ($zip->getFromName($archiveFile) !==
false);
static file_exists($pFilename)
Verify if a file exists.
◆ getUseUploadTempDirectory()
static PHPExcel_Shared_File::getUseUploadTempDirectory |
( |
| ) |
|
|
static |
Get the flag indicating whether the File Upload Temp directory should be used for temporary files.
- Returns
- boolean Use File Upload Temporary directory (true or false)
Definition at line 62 of file File.php.
63 return self::$_useUploadTempDirectory;
◆ realpath()
static PHPExcel_Shared_File::realpath |
( |
|
$pFilename | ) |
|
|
static |
Returns canonicalized absolute pathname, also for ZIP archives.
- Parameters
-
- Returns
- string
Definition at line 102 of file File.php.
References file_exists().
Referenced by PHPExcel_Reader_Excel2007\_getFromZipArchive(), PHPExcel_Reader_Excel2007\listWorksheetInfo(), PHPExcel_Reader_Excel2007\load(), and sys_get_temp_dir().
108 $returnValue =
realpath($pFilename);
112 if ($returnValue ==
'' || ($returnValue === NULL)) {
113 $pathArray = explode(
'/' , $pFilename);
114 while(in_array(
'..', $pathArray) && $pathArray[0] !=
'..') {
115 for ($i = 0; $i < count($pathArray); ++$i) {
116 if ($pathArray[$i] ==
'..' && $i > 0) {
117 unset($pathArray[$i]);
118 unset($pathArray[$i - 1]);
123 $returnValue = implode(
'/', $pathArray);
static realpath($pFilename)
Returns canonicalized absolute pathname, also for ZIP archives.
static file_exists($pFilename)
Verify if a file exists.
◆ setUseUploadTempDirectory()
static PHPExcel_Shared_File::setUseUploadTempDirectory |
( |
|
$useUploadTempDir = FALSE | ) |
|
|
static |
Set the flag indicating whether the File Upload Temp directory should be used for temporary files.
- Parameters
-
boolean | $useUploadTempDir | Use File Upload Temporary directory (true or false) |
Definition at line 52 of file File.php.
53 self::$_useUploadTempDirectory = (boolean) $useUploadTempDir;
◆ sys_get_temp_dir()
static PHPExcel_Shared_File::sys_get_temp_dir |
( |
| ) |
|
|
static |
Get the systems temporary directory.
- Returns
- string
Definition at line 135 of file File.php.
References file_exists(), and realpath().
Referenced by PHPExcel_Shared_OLE_PPS_Root\__construct(), PHPExcel_Shared_XMLWriter\__construct(), PHPExcel_CachedObjectStorage_DiscISAM\__construct(), PHPExcel_Writer_PDF_Core\__construct(), PHPExcel_Writer_HTML\_writeChartInCell(), PHPExcel_Shared_ZipArchive\open(), PHPExcel_Shared_OLE_PPS_Root\save(), PHPExcel_Writer_OpenDocument\save(), and PHPExcel_Writer_Excel2007\save().
137 if (self::$_useUploadTempDirectory) {
140 if (ini_get(
'upload_tmp_dir') !== FALSE) {
141 if ($temp = ini_get(
'upload_tmp_dir')) {
150 if ( !function_exists(
'sys_get_temp_dir')) {
151 if ($temp = getenv(
'TMP') ) {
154 if ($temp = getenv(
'TEMP') ) {
157 if ($temp = getenv(
'TMPDIR') ) {
163 $temp = tempnam(__FILE__,
'');
static sys_get_temp_dir()
Get the systems temporary directory.
static realpath($pFilename)
Returns canonicalized absolute pathname, also for ZIP archives.
static file_exists($pFilename)
Verify if a file exists.
◆ $_useUploadTempDirectory
PHPExcel_Shared_File::$_useUploadTempDirectory = FALSE |
|
staticprotected |
The documentation for this class was generated from the following file:
- libs/composer/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/File.php