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',
'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',
]
);

View File

@ -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),

View File

@ -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']);

View File

@ -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
);

View File

@ -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(),