Lines Matching refs:file

647      * @param string $field name of the upload file
771 * Purge the cache by touching the main configuration file
824 * Save the given URL and current datetime in the manager.dat file of all installed extensions
856 * Read the manager.dat file
862 $file = @file($managerpath);
863 if (!empty($file)) {
864 foreach ($file as $line) {
877 * Write the manager.data file
905 * downloads a file from the net and saves it
907 * - $file is the directory where the file should be saved
908 * - if successful will return the name used for the saved file, false otherwise
914 * @param string $file path to file or directory where to save
916 * @return bool|string if failed false, otherwise true or the name of the file in the given dir
918 protected function downloadToFile($url, $file, $defaultName = '')
947 $file .= $name;
949 $fileexists = file_exists($file);
950 $fp = @fopen($file, "w");
954 if (!$fileexists && $conf['fperm']) chmod($file, $conf['fperm']);
972 // try to get the file from the path (used as plugin name fallback)
973 $file = parse_url($url, PHP_URL_PATH);
974 if (is_null($file)) {
975 $file = md5($url);
977 $file = PhpString::basename($file);
986 if (!$file = $this->downloadToFile($url, $tmp . '/', $file)) {
994 return $tmp . '/' . $file;
998 * @param string $file The path to the archive that shall be installed
1004 public function installArchive($file, $overwrite = false, $base = '')
1019 $this->decompress($file, "$tmp/" . $base);
1104 * as indicator for a root folder. When such a file is found, it's base
1136 // it's a file -> check for config
1185 * Decompress a given file to the given target directory
1187 * Determines the compression type from the file extension
1189 * @param string $file archive to extract
1194 private function decompress($file, $target)
1199 $ext = $this->guessArchiveType($file);
1203 $tar->open($file);
1213 $zip->open($file);
1223 // when the archive file can't be read
1224 throw new Exception($this->getLang('error_decompress') . ' Couldn\'t read archive file');
1228 * Determine the archive type of the given file
1230 * Reads the first magic bytes of the given file for content type guessing,
1234 * @param string $file The file to analyze
1235 * @return string|false false if the file can't be read, otherwise an "extension"
1237 private function guessArchiveType($file)
1239 $fh = fopen($file, 'rb');
1253 * @param string $src filename path to file
1254 * @param string $dst filename path to file
1295 // get definition file
1306 $list = file($definitionfile);
1311 $file = $extensiondir . $line;
1312 if (!file_exists($file)) continue;
1314 io_rmdir($file, true);