aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-01-31 15:09:07 +0000
committerplegall <plg@piwigo.org>2012-01-31 15:09:07 +0000
commit7157b8a8f4028c207234d2b85ed22b7dc29f5afe (patch)
tree9ba188a6215bc2918a31be83249a1b19e5e2d0ce /include/ws_functions.inc.php
parent7c322f6d9c241c9282bc9c8362e702b49814fbad (diff)
remove obsolete function add_file
git-svn-id: http://piwigo.org/svn/trunk@13003 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/ws_functions.inc.php60
1 files changed, 0 insertions, 60 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index dae51e967..908eb6118 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1602,66 +1602,6 @@ function remove_chunks($original_sum, $type)
}
}
-/*
- * The $file_path must be the path of the basic "web sized" photo
- * The $type value will automatically modify the $file_path to the corresponding file
- */
-function add_file($file_path, $type, $original_sum, $file_sum)
-{
- include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
-
- $upload_dir = dirname($file_path);
- if (substr(PHP_OS, 0, 3) == 'WIN')
- {
- $upload_dir = str_replace('/', DIRECTORY_SEPARATOR, $upload_dir);
- }
-
- ws_logfile('[add_file] file_path : '.$file_path);
- ws_logfile('[add_file] upload_dir : '.$upload_dir);
-
- if (!is_dir($upload_dir)) {
- umask(0000);
- $recursive = true;
- if (!@mkdir($upload_dir, 0777, $recursive))
- {
- return new PwgError(500, '[add_file] error during '.$type.' directory creation');
- }
- }
-
- if (!is_writable($upload_dir))
- {
- // last chance to make the directory writable
- @chmod($upload_dir, 0777);
-
- if (!is_writable($upload_dir))
- {
- return new PwgError(500, '[add_file] '.$type.' directory has no write access');
- }
- }
-
- secure_directory($upload_dir);
-
- // merge the file
- merge_chunks($file_path, $original_sum, $type);
- chmod($file_path, 0644);
-
- // check dumped thumbnail md5
- $dumped_md5 = md5_file($file_path);
- if ($dumped_md5 != $file_sum)
- {
- return new PwgError(500, '[add_file] '.$type.' transfer failed');
- }
-
- list($width, $height) = getimagesize($file_path);
- $filesize = floor(filesize($file_path)/1024);
-
- return array(
- 'width' => $width,
- 'height' => $height,
- 'filesize' => $filesize,
- );
-}
-
function ws_images_addFile($params, &$service)
{
ws_logfile(__FUNCTION__.', input : '.var_export($params, true));