This commit is contained in:
Jean-Christian Paul Denis 2022-11-26 22:22:42 +01:00
parent d07ccf9329
commit 4cf21eba91
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
5 changed files with 22 additions and 25 deletions

View File

@ -25,6 +25,6 @@ $this->registerModule(
'type' => 'plugin', 'type' => 'plugin',
'support' => 'https://github.com/JcDenis/pacKman', 'support' => 'https://github.com/JcDenis/pacKman',
'details' => 'https://plugins.dotaddict.org/dc2/details/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',
] ]
); );

View File

@ -23,50 +23,49 @@ $mod_conf = [
'packman_menu_plugins', 'packman_menu_plugins',
'Add link to pacKman in plugins page', 'Add link to pacKman in plugins page',
false, false,
'boolean' 'boolean',
], ],
[ [
'packman_pack_nocomment', 'packman_pack_nocomment',
'Remove comments from files', 'Remove comments from files',
false, false,
'boolean' 'boolean',
], ],
[ [
'packman_pack_overwrite', 'packman_pack_overwrite',
'Overwrite existing package', 'Overwrite existing package',
false, false,
'boolean' 'boolean',
], ],
[ [
'packman_pack_filename', 'packman_pack_filename',
'Name of package', 'Name of package',
'%type%-%id%', '%type%-%id%',
'string' 'string',
], ],
[ [
'packman_secondpack_filename', 'packman_secondpack_filename',
'Name of second package', 'Name of second package',
'%type%-%id%-%version%', '%type%-%id%-%version%',
'string' 'string',
], ],
[ [
'packman_pack_repository', 'packman_pack_repository',
'Path to package repository', 'Path to package repository',
'', '',
'string' 'string',
], ],
[ [
'packman_pack_excludefiles', 'packman_pack_excludefiles',
'Extra files to exclude from package', 'Extra files to exclude from package',
'*.zip,*.tar,*.tar.gz,.directory,.hg', '*.zip,*.tar,*.tar.gz,.directory,.hg',
'string' 'string',
] ],
]; ];
# -- Nothing to change below -- # -- Nothing to change below --
try { try {
# Check module version # Check module version
if (version_compare( if (version_compare(
dcCore::app()->getVersion($mod_id), dcCore::app()->getVersion($mod_id),

View File

@ -26,7 +26,7 @@ class dcPackman
'.git*', '.git*',
'CVS', 'CVS',
'.DS_Store', '.DS_Store',
'Thumbs.db' 'Thumbs.db',
]; ];
public static function quote_exclude(array $exclude): array public static function quote_exclude(array $exclude): array
@ -96,7 +96,7 @@ class dcPackman
if (is_array($res[$i])) { if (is_array($res[$i])) {
$res[$i] = array_merge($res[$i], [ $res[$i] = array_merge($res[$i], [
'id' => $zip_root_dir, 'id' => $zip_root_dir,
'root' => $root . '/' . $zip_file 'root' => $root . '/' . $zip_file,
]); ]);
unlink($cache . '_define.php'); unlink($cache . '_define.php');
@ -193,14 +193,14 @@ class dcPackman
'%id%', '%id%',
'%version%', '%version%',
'%author%', '%author%',
'%time%' '%time%',
], ],
[ [
$info['type'], $info['type'],
$info['id'], $info['id'],
$info['version'], $info['version'],
$info['author'], $info['author'],
time() time(),
], ],
$file $file
); );

View File

@ -74,7 +74,6 @@ try {
if (preg_match('/' . preg_quote($_REQUEST['package']) . '$/', $f['root']) if (preg_match('/' . preg_quote($_REQUEST['package']) . '$/', $f['root'])
&& is_file($f['root']) && is_readable($f['root']) && is_file($f['root']) && is_readable($f['root'])
) { ) {
# --BEHAVIOR-- packmanBeforeDownloadPackage # --BEHAVIOR-- packmanBeforeDownloadPackage
dcCore::app()->callBehavior('packmanBeforeDownloadPackage', $f, $type); dcCore::app()->callBehavior('packmanBeforeDownloadPackage', $f, $type);
@ -111,7 +110,7 @@ try {
$root = $s->packman_pack_repository; $root = $s->packman_pack_repository;
$files = [ $files = [
$s->packman_pack_filename, $s->packman_pack_filename,
$s->packman_secondpack_filename $s->packman_secondpack_filename,
]; ];
$nocomment = $s->packman_pack_nocomment; $nocomment = $s->packman_pack_nocomment;
$fixnewline = $s->packman_pack_fixnewline; $fixnewline = $s->packman_pack_fixnewline;
@ -160,7 +159,6 @@ try {
# Install # Install
} elseif ($action == 'install') { } elseif ($action == 'install') {
foreach ($_POST['modules'] as $root => $id) { foreach ($_POST['modules'] as $root => $id) {
# --BEHAVIOR-- packmanBeforeInstallPackage # --BEHAVIOR-- packmanBeforeInstallPackage
dcCore::app()->callBehavior('packmanBeforeInstallPackage', $type, $id, $root); dcCore::app()->callBehavior('packmanBeforeInstallPackage', $type, $id, $root);
@ -256,7 +254,7 @@ echo
dcPage::breadcrumb([ dcPage::breadcrumb([
__('Plugins') => '', __('Plugins') => '',
__('pacKman') => '' __('pacKman') => '',
]) . ]) .
dcPage::notices(); dcPage::notices();