From 4cf21eba9147f0c7f438881418967822abc4c18c Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 26 Nov 2022 22:22:42 +0100 Subject: [PATCH] cosmetic --- _define.php | 2 +- _install.php | 17 ++++++++--------- _prepend.php | 4 ++-- inc/class.dc.packman.php | 8 ++++---- index.php | 16 +++++++--------- 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/_define.php b/_define.php index 9af8bcf..c4f3176 100644 --- a/_define.php +++ b/_define.php @@ -25,6 +25,6 @@ $this->registerModule( 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/pacKman', 'details' => 'https://plugins.dotaddict.org/dc2/details/pacKman', - 'repository' => 'https://raw.githubusercontent.com/JcDenis/pacKman/master/dcstore.xml' + 'repository' => 'https://raw.githubusercontent.com/JcDenis/pacKman/master/dcstore.xml', ] ); diff --git a/_install.php b/_install.php index 74572b7..0710451 100644 --- a/_install.php +++ b/_install.php @@ -23,50 +23,49 @@ $mod_conf = [ 'packman_menu_plugins', 'Add link to pacKman in plugins page', false, - 'boolean' + 'boolean', ], [ 'packman_pack_nocomment', 'Remove comments from files', false, - 'boolean' + 'boolean', ], [ 'packman_pack_overwrite', 'Overwrite existing package', false, - 'boolean' + 'boolean', ], [ 'packman_pack_filename', 'Name of package', '%type%-%id%', - 'string' + 'string', ], [ 'packman_secondpack_filename', 'Name of second package', '%type%-%id%-%version%', - 'string' + 'string', ], [ 'packman_pack_repository', 'Path to package repository', '', - 'string' + 'string', ], [ 'packman_pack_excludefiles', 'Extra files to exclude from package', '*.zip,*.tar,*.tar.gz,.directory,.hg', - 'string' - ] + 'string', + ], ]; # -- Nothing to change below -- try { - # Check module version if (version_compare( dcCore::app()->getVersion($mod_id), diff --git a/_prepend.php b/_prepend.php index d1a02dd..d016ad7 100644 --- a/_prepend.php +++ b/_prepend.php @@ -16,6 +16,6 @@ if (!defined('DC_RC_PATH')) { $d = __DIR__ . '/inc/'; -Clearbricks::lib()->autoload(['dcPackman' => $d . 'class.dc.packman.php']); -Clearbricks::lib()->autoload(['libPackman' => $d . 'lib.packman.php']); +Clearbricks::lib()->autoload(['dcPackman' => $d . 'class.dc.packman.php']); +Clearbricks::lib()->autoload(['libPackman' => $d . 'lib.packman.php']); Clearbricks::lib()->autoload(['packmanFileZip' => $d . 'lib.packman.filezip.php']); diff --git a/inc/class.dc.packman.php b/inc/class.dc.packman.php index 82a6b98..c854dcf 100644 --- a/inc/class.dc.packman.php +++ b/inc/class.dc.packman.php @@ -26,7 +26,7 @@ class dcPackman '.git*', 'CVS', '.DS_Store', - 'Thumbs.db' + 'Thumbs.db', ]; public static function quote_exclude(array $exclude): array @@ -96,7 +96,7 @@ class dcPackman if (is_array($res[$i])) { $res[$i] = array_merge($res[$i], [ 'id' => $zip_root_dir, - 'root' => $root . '/' . $zip_file + 'root' => $root . '/' . $zip_file, ]); unlink($cache . '_define.php'); @@ -193,14 +193,14 @@ class dcPackman '%id%', '%version%', '%author%', - '%time%' + '%time%', ], [ $info['type'], $info['id'], $info['version'], $info['author'], - time() + time(), ], $file ); diff --git a/index.php b/index.php index 250ecdc..263e483 100644 --- a/index.php +++ b/index.php @@ -74,7 +74,6 @@ try { if (preg_match('/' . preg_quote($_REQUEST['package']) . '$/', $f['root']) && is_file($f['root']) && is_readable($f['root']) ) { - # --BEHAVIOR-- packmanBeforeDownloadPackage dcCore::app()->callBehavior('packmanBeforeDownloadPackage', $f, $type); @@ -111,7 +110,7 @@ try { $root = $s->packman_pack_repository; $files = [ $s->packman_pack_filename, - $s->packman_secondpack_filename + $s->packman_secondpack_filename, ]; $nocomment = $s->packman_pack_nocomment; $fixnewline = $s->packman_pack_fixnewline; @@ -137,7 +136,7 @@ try { dcCore::app()->adminurl->redirect('admin.plugin.pacKman', [], '#packman-' . $type); } - # Delete + # Delete } elseif ($action == 'delete') { foreach ($_POST['modules'] as $root => $id) { if (!file_exists($root) || !files::isDeletable($root)) { @@ -157,10 +156,9 @@ try { dcCore::app()->adminurl->redirect('admin.plugin.pacKman', [], '#packman-repository-' . $type); } - # Install + # Install } elseif ($action == 'install') { foreach ($_POST['modules'] as $root => $id) { - # --BEHAVIOR-- packmanBeforeInstallPackage dcCore::app()->callBehavior('packmanBeforeInstallPackage', $type, $id, $root); @@ -185,7 +183,7 @@ try { dcCore::app()->adminurl->redirect('admin.plugin.pacKman', [], '#packman-repository-' . $type); } - # Copy + # Copy } elseif (strpos($action, 'copy_to_') !== false) { $dest = $repo_path; if ($action == 'copy_to_plugins') { @@ -211,7 +209,7 @@ try { dcCore::app()->adminurl->redirect('admin.plugin.pacKman', [], '#packman-repository-' . $type); } - # Move + # Move } elseif (strpos($action, 'move_to_') !== false) { $dest = $repo_path; if ($action == 'move_to_plugins') { @@ -256,7 +254,7 @@ echo dcPage::breadcrumb([ __('Plugins') => '', - __('pacKman') => '' + __('pacKman') => '', ]) . dcPage::notices(); @@ -272,7 +270,7 @@ if (dcCore::app()->error->flag() || !$is_configured) { dcPackman::getPackages(dirname($repo_path . '/' . $s->packman_secondpack_filename)) ); $plugins_path_modules = dcPackman::getPackages($plugins_path); - $themes_path_modules = dcPackman::getPackages($themes_path); + $themes_path_modules = dcPackman::getPackages($themes_path); libPackman::modules( $plugins->getModules(),