autorise les fichiers archive compressé au téléchargement
@return ODDragNDrop
@throws ReflectionException
770723
public function enaArchiveFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $archExts   = $this->getArchiveExtensionConstant();
        foreach ($archExts as $archExt) {
            if (strpos($extString, $archExt) === false) {
                $extString .= ','.$archExt;
            }
        }
        $extString                      = substr($extString, 1);
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1048053
public function getZipFile() {
        if (!$this->isFinalized) {
            $this->finalize();
        }

        $this->zipflush();

        rewind($this->zipFile);

        return $this->zipFile;
    }
211847
protected function generateTutorialFile()
    {
        if ($this->generator->getOptionGenerateTutorialFile() === true && $this->getClassmapFile() instanceof ClassMapFile) {
            $tutorialFile = new TutorialFile($this->generator, 'tutorial');
            $tutorialFile->write();
        }
        return $this;
    }
389231
private function ClassFile()
    {
        if (!$this->classFile)
        {
            
            $class = new \ReflectionClass($this);
            $this->classFile = $class->getFileName();
        }
        return $this->classFile;
    }
106358
private function setFileAction()
    {
        array_push($this->actions, 'file');

        $this->addForm = array_diff($this->addForm, ['files']);
        $this->editForm = array_diff($this->addForm, ['files']);

        $this->setModelDefaults('files', []);
        $this->setColumnFormat('files', 'files');

        return $this;
    }
1037376
public function startIndexing()
    {
        $directories = $this->indexerConfig['directories'];
        $directoryArray = GeneralUtility::trimExplode(',', $directories, true);

        if ($this->pObj->indexerConfig['fal_storage'] > 0) {
            /* @var $storageRepository StorageRepository */
            $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
            $this->storage = $storageRepository->findByUid($this->pObj->indexerConfig['fal_storage']);

            $files = array();
            $this->getFilesFromFal($files, $directoryArray);
        } else {
            $files = $this->getFilesFromDirectories($directoryArray);
        }

        $counter = $this->extractContentAndSaveToIndex($files);

        // show indexer content?
        $content = '<p><b>Indexer "' . $this->indexerConfig['title'] . '": </b><br />'
            . count($files) . ' files have been found for indexing.<br />' . "\n"
            . $counter . ' files have been indexed.</p>' . "\n";

        $content .= $this->showErrors();
        $content .= $this->showTime();

        return $content;
    }
33188
public function getFilenameWithoutExtension()
    {
        $filename = $this->getDocument()->getFile()->getFilename();

        return substr($filename, 0, strrpos($filename, '.'));
    }
1203584
public function initFile()
    {
        
    	if ($this->maxFileSize > 0 && file_exists($this->filename) && filesize($this->filename) >= $this->maxFileSize) {
	    	
	    	if ($this->compression == self::COMPRESSION_ZIP) {
	    		$zip = new ZipArchive;
				$res = $zip->open($this->getAvailableArchiveFileName(), ZipArchive::CREATE);
				if ($res === true) {
				    $zip->addFile($this->filename, basename($this->filename));
				    $zip->close();
				    unlink($this->filename);
				} else {
					//fail silently
					return false;
				}	
	    	} elseif ($this->compression == self::COMPRESSION_NONE) {
	    		$success = rename($this->filename, $this->getAvailableArchiveFileName());
	    		if (!$success) {
					//fail silently
					return false;
	    		}
	    	} else {
				//fail silently
				return false;
	    	}
    	}
    	$this->filehandle = @fopen($this->filename, 'a');
        

    }
1022014
public function toJPG()
    {
        $this->extension = 'jpg';
        $this->type = IMAGETYPE_JPEG;
        $this->mimetype = Utils::getMimetypeByImageType(IMAGETYPE_JPEG);
        return $this;
    }
347432
protected function fileExtension()
    {
        if (!$this->fileExtension) {
            $mimeType = $this->serializer->mimeType();
            $this->fileExtension = $this->mimetypes->fileExtensions($mimeType)[0];
        };
        return $this->fileExtension;
    }
1311773
protected function createMimetypeFile()
    {
        $this->createFileWithContents($this->rootFolder, self::MIMETYPE_FILE_NAME, self::MIMETYPE);
        return $this;
    }
840496
protected static function getPluginArchivers()
    {
        if (empty(static::$archivers)) {
            $pluginNames = \Piwik\Plugin\Manager::getInstance()->getActivatedPlugins();
            $archivers = array();
            foreach ($pluginNames as $pluginName) {
                $archivers[$pluginName] = self::getPluginArchiverClass($pluginName);
            }
            static::$archivers = array_filter($archivers);
        }
        return static::$archivers;
    }
691515
public function minify()
	{
		$data = '';

		foreach ($this->files as $fileData)
		{
			$fileData = $this->handleFile($fileData);

			$data .= $this->doMinify($fileData['content'], $fileData['options']);
		}

		return $data;
	}
355769
public function createCopy(): AbstractResize
    {
        $this->createCanvas();

        $this->intermediate['copy'] = imagecreatefrompng($this->source['path'] . $this->source['file']);
        if ($this->intermediate['copy'] === false) {
            throw new \Exception('Call to imagecreatefrompng failed');
        }

        $this->resampleCopy();

        return $this;
    }
899671
public function enaDocumentFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $docsExts   = $this->getDocumentExtensionConstant();
        foreach ($docsExts as $docsExt) {
            if (strpos($extString, $docsExt) === false) {
                $extString .= ','.$docsExt;
            }
        }
        $extString                      = substr($extString, 1);
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
550142
public function downloadzippedAction() {
        $params = $this->getRequest()->getParams();

        if (!array_key_exists('files', $params)
            || !array_key_exists('zipname', $params)
            || !$params['files']
            || !$params['zipname']
        ) {
            throw new Exception('Please provide a filename list, and a name for the archive.');
        }

        $zip = new ZipArchive();
        $tmpDir = sys_get_temp_dir();
        $tmpDir .= $tmpDir[strlen($tmpDir) - 1] !== '/' ? '/' : '';
        $zipPath = $tmpDir . $params['zipname'] . '.zip';

        if ($zip->open($zipPath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE) !== true) {
            throw new Exception("Cannot open <$zipPath>\n");
        }

        //  @todo: als cdn niet lokaal is, moet je waarschijnlijk met zip::addFromString werken.
        $filenames = explode(',', $params['files']);

        $image = new Garp_Image_File(Garp_File::FILE_VARIANT_UPLOAD);
        $document = new Garp_File(null, Garp_File::FILE_VARIANT_UPLOAD);
        $ini = Zend_Registry::get('config');
        $cdnIsLocal = $ini->cdn->type === "local";

        foreach ($filenames as $filename) {
            $allowedImageExtensions = $image->getAllowedExtensions();
            $filenameParts = explode('.', $filename);
            $extension = $filenameParts[count($filenameParts) - 1];

            $fileIsImage = in_array($extension, $allowedImageExtensions);

            $file = $fileIsImage ? $image : $document;

            $url = $file->getUrl($filename);
            if ($content = @file_get_contents($url)) {
                $zip->addFromString('/' . $params['zipname'] . '/' . $filename, $content);
            } else {
                throw new Exception("{$url} could not be opened for inclusion in the zip archive.");
            }
        }

        $zip->close();

        $this->_downloadFile($zipPath);
        @unlink($zipPath);
    }
30556
public function recursiveCompress():bool
    {
        if ($this->source == null) {
            throw new Server500(new \ArrayObject(array("explain" => "The source must be not null.",
                "Please add source path.")));
        }
        if ($this->name == null) {
            throw new Server500(new \ArrayObject(array("explain" => "The archive name must be not null.",
                "Please add an archive name.")));
        }

        $source = str_replace('\\', '/', realpath($this->source));
        if (is_dir($source) === true) {
            $files = new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator($source),
                \RecursiveIteratorIterator::SELF_FIRST
            );
            foreach ($files as $file) {
                $file = str_replace('\\', '/', $file);
                if (in_array(substr($file, strrpos($file, '/') + 1), array('.', '..'))) {
                    continue;
                }
                $file = realpath($file);
                if (is_dir($file) === true) {
                    $this->addEmptyDir(str_replace($source . '/', '', $file . '/'));
                } elseif (is_file($file) === true) {
                    $this->addFromString(str_replace(
                        $source . '/',
                        '',
                        $file
                    ), file_get_contents($file));
                }
            }
        } elseif (is_file($source) === true) {
            $this->addFromString(basename($source), file_get_contents($source));
        }
        return (true);
    }