mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 03:39:57 +03:00
Corections to respect coding conventions.
Change plugins versions to 1.8 Change 3 plugins URI. git-svn-id: http://piwigo.org/svn/trunk@2243 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
78e175b3fb
commit
1283b5ecb1
19 changed files with 274 additions and 262 deletions
|
@ -182,18 +182,24 @@ function extract_plugin_files($action, $source, $dest)
|
|||
{
|
||||
// we search main.inc.php in archive
|
||||
if (basename($file['filename']) == 'main.inc.php'
|
||||
and (!isset($main_filepath) or strlen($file['filename']) < strlen($main_filepath)))
|
||||
and (!isset($main_filepath)
|
||||
or strlen($file['filename']) < strlen($main_filepath)))
|
||||
{
|
||||
$main_filepath = $file['filename'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($main_filepath))
|
||||
{
|
||||
$root = dirname($main_filepath); // main.inc.php path in archive
|
||||
if ($action == 'upgrade') $extract_path = PHPWG_PLUGINS_PATH . $dest;
|
||||
else $extract_path = PHPWG_PLUGINS_PATH . ($root == '.' ? 'extension_' . $dest : basename($root));
|
||||
|
||||
if ($action == 'upgrade')
|
||||
{
|
||||
$extract_path = PHPWG_PLUGINS_PATH.$dest;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extract_path = PHPWG_PLUGINS_PATH
|
||||
. ($root == '.' ? 'extension_' . $dest : basename($root));
|
||||
}
|
||||
if($result = $zip->extract(PCLZIP_OPT_PATH, $extract_path,
|
||||
PCLZIP_OPT_REMOVE_PATH, $root,
|
||||
PCLZIP_OPT_REPLACE_NEWER))
|
||||
|
@ -226,7 +232,7 @@ function extract_plugin_files($action, $source, $dest)
|
|||
* delete $path directory
|
||||
* @param string - path
|
||||
*/
|
||||
function pm_deltree($path)
|
||||
function deltree($path)
|
||||
{
|
||||
if (is_dir($path))
|
||||
{
|
||||
|
@ -236,8 +242,14 @@ function pm_deltree($path)
|
|||
if ($file != '.' and $file != '..')
|
||||
{
|
||||
$pathfile = $path . '/' . $file;
|
||||
if (is_dir($pathfile)) pm_deltree($pathfile);
|
||||
else @unlink($pathfile);
|
||||
if (is_dir($pathfile))
|
||||
{
|
||||
deltree($pathfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@unlink($pathfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($fh);
|
||||
|
@ -250,7 +262,7 @@ function pm_deltree($path)
|
|||
* send $path to trash directory
|
||||
* @param string - path
|
||||
*/
|
||||
function send_pm_trash($path)
|
||||
function send_to_trash($path)
|
||||
{
|
||||
$trash_path = PHPWG_PLUGINS_PATH . 'trash';
|
||||
if (!is_dir($trash_path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue