release 0.5
This commit is contained in:
parent
4646e02b82
commit
a68017d3b0
@ -1,5 +1,5 @@
|
|||||||
0.5 - 2022.11.12
|
0.5 - 2022.11.20
|
||||||
- require Dotclear 2.24
|
- fix compatibility with Dotclear 2.24 (required)
|
||||||
|
|
||||||
0.4 - 2021.09.02
|
0.4 - 2021.09.02
|
||||||
- clean up code
|
- clean up code
|
||||||
|
17
README.md
17
README.md
@ -1,5 +1,12 @@
|
|||||||
# README
|
# README
|
||||||
|
|
||||||
|
[![Release](https://img.shields.io/github/v/release/JcDenis/tinyPacker)](https://github.com/JcDenis/tinyPacker/releases)
|
||||||
|
[![Date](https://img.shields.io/github/release-date/JcDenis/tinyPacker)](https://github.com/JcDenis/tinyPacker/releases)
|
||||||
|
[![Issues](https://img.shields.io/github/issues/JcDenis/tinyPacker)](https://github.com/JcDenis/tinyPacker/issues)
|
||||||
|
[![Dotclear](https://img.shields.io/badge/dotclear-v2.24-blue.svg)](https://fr.dotclear.org/download)
|
||||||
|
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/tinyPacker)
|
||||||
|
[![License](https://img.shields.io/github/license/JcDenis/tinyPacker)](https://github.com/JcDenis/tinyPacker/blob/master/LICENSE)
|
||||||
|
|
||||||
## WHAT IS tinyPacker ?
|
## WHAT IS tinyPacker ?
|
||||||
|
|
||||||
_tinyPacker_ is a plugin for the open-source
|
_tinyPacker_ is a plugin for the open-source
|
||||||
@ -13,7 +20,7 @@ direct from Dotclear blog manager.
|
|||||||
_tinyPacker_ requires:
|
_tinyPacker_ requires:
|
||||||
|
|
||||||
* Super administrator permissions
|
* Super administrator permissions
|
||||||
* Dotclear 2.18
|
* Dotclear 2.24
|
||||||
* A writable public directory.
|
* A writable public directory.
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
@ -29,4 +36,10 @@ and it's pack into current blog public directory.
|
|||||||
|
|
||||||
* License : GNU GPL v2
|
* License : GNU GPL v2
|
||||||
* Source & contribution : [GitHub Page](https://github.com/JcDenis/tinyPacker)
|
* Source & contribution : [GitHub Page](https://github.com/JcDenis/tinyPacker)
|
||||||
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/tinyPacker)
|
* Packages & details : [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/tinyPacker)
|
||||||
|
|
||||||
|
## CONTRIBUTORS
|
||||||
|
|
||||||
|
* Jean-Christian Denis
|
||||||
|
|
||||||
|
You are welcome to contribute to this code.
|
31
_admin.php
31
_admin.php
@ -10,7 +10,6 @@
|
|||||||
* @copyright Jean-Christian Denis
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -77,13 +76,15 @@ class tinyPacker
|
|||||||
}
|
}
|
||||||
|
|
||||||
$modules = array_keys($_POST['tinypacker']);
|
$modules = array_keys($_POST['tinypacker']);
|
||||||
$id = $modules[0];
|
$id = $modules[0];
|
||||||
|
|
||||||
# Repository directory
|
# Repository directory
|
||||||
if (($root = self::repositoryDir($list->core)) === false) {
|
if (($root = self::repositoryDir()) === false) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
__('Destination directory is not writable.'
|
__(
|
||||||
));
|
'Destination directory is not writable.'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Module to pack
|
# Module to pack
|
||||||
@ -93,7 +94,7 @@ class tinyPacker
|
|||||||
$module = $list->modules->getModules($id);
|
$module = $list->modules->getModules($id);
|
||||||
|
|
||||||
# Excluded files and dirs
|
# Excluded files and dirs
|
||||||
$exclude = array(
|
$exclude = [
|
||||||
'\.',
|
'\.',
|
||||||
'\.\.',
|
'\.\.',
|
||||||
'__MACOSX',
|
'__MACOSX',
|
||||||
@ -103,24 +104,23 @@ class tinyPacker
|
|||||||
'CVS',
|
'CVS',
|
||||||
'\.directory',
|
'\.directory',
|
||||||
'\.DS_Store',
|
'\.DS_Store',
|
||||||
'Thumbs\.db'
|
'Thumbs\.db',
|
||||||
);
|
];
|
||||||
|
|
||||||
# Packages names
|
# Packages names
|
||||||
$files = array(
|
$files = [
|
||||||
$type . '-' . $id . '.zip',
|
$type . '-' . $id . '.zip',
|
||||||
$type . '-' . $id . '-' . $module['version'] . '.zip'
|
$type . '-' . $id . '-' . $module['version'] . '.zip',
|
||||||
);
|
];
|
||||||
|
|
||||||
# Create zip
|
# Create zip
|
||||||
foreach($files as $f) {
|
foreach ($files as $f) {
|
||||||
|
|
||||||
@set_time_limit(300);
|
@set_time_limit(300);
|
||||||
$fp = fopen($root . '/' . $f, 'wb');
|
$fp = fopen($root . '/' . $f, 'wb');
|
||||||
|
|
||||||
$zip = new fileZip($fp);
|
$zip = new fileZip($fp);
|
||||||
|
|
||||||
foreach($exclude AS $e) {
|
foreach ($exclude as $e) {
|
||||||
$zip->addExclusion(sprintf(
|
$zip->addExclusion(sprintf(
|
||||||
'#(^|/)(%s)(/|$)#',
|
'#(^|/)(%s)(/|$)#',
|
||||||
$e
|
$e
|
||||||
@ -155,11 +155,10 @@ class tinyPacker
|
|||||||
files::makeDir($dir, true);
|
files::makeDir($dir, true);
|
||||||
}
|
}
|
||||||
if (is_writable($dir)) {
|
if (is_writable($dir)) {
|
||||||
|
|
||||||
return $dir;
|
return $dir;
|
||||||
}
|
}
|
||||||
|
} catch(Exception $e) {
|
||||||
}
|
}
|
||||||
catch(Exception $e) {}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
11
_define.php
11
_define.php
@ -10,7 +10,6 @@
|
|||||||
* @copyright Jean-Christian Denis
|
* @copyright Jean-Christian Denis
|
||||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('DC_RC_PATH')) {
|
if (!defined('DC_RC_PATH')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -21,11 +20,11 @@ $this->registerModule(
|
|||||||
'Jean-Christian Denis',
|
'Jean-Christian Denis',
|
||||||
'0.5',
|
'0.5',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.24']],
|
'requires' => [['core', '2.24']],
|
||||||
'permissions' => null,
|
'permissions' => null,
|
||||||
'type' => 'plugin',
|
'type' => 'plugin',
|
||||||
'support' => 'https://github.com/JcDenis/tinyPacker',
|
'support' => 'https://github.com/JcDenis/tinyPacker',
|
||||||
'details' => 'https://plugins.dotaddict.org/dc2/details/tinyPacker',
|
'details' => 'https://plugins.dotaddict.org/dc2/details/tinyPacker',
|
||||||
'repository' => 'https://raw.githubudsfsfdsfsercontent.com/JcDenis/tinyPacker/master/dcstore.xml'
|
'repository' => 'https://raw.githubudsfsfdsfsercontent.com/JcDenis/tinyPacker/master/dcstore.xml',
|
||||||
]
|
]
|
||||||
);
|
);
|
20
dcstore.xml
20
dcstore.xml
@ -1,11 +1,13 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
<modules xmlns:da="http://dotaddict.org/da/">
|
<modules xmlns:da="http://dotaddict.org/da/">
|
||||||
<module id="tinyPacker">
|
<module id="tinyPacker">
|
||||||
<name>Tiny packer</name>
|
<name>Tiny packer</name>
|
||||||
<version>0.4</version>
|
<version>0.5</version>
|
||||||
<author>Jean-Christian Denis</author>
|
<author>Jean-Christian Denis</author>
|
||||||
<desc>Quick pack theme or plugin into public dir</desc>
|
<desc>Quick pack theme or plugin into public dir</desc>
|
||||||
<file>https://github.com/JcDenis/tinyPacker/releases/download/v0.4/plugin-tinyPacker.zip</file>
|
<file>https://github.com/JcDenis/tinyPacker/releases/download/v0.5/plugin-tinyPacker.zip</file>
|
||||||
<da:details>https://plugins.dotaddict.org/dc2/details/tinyPacker</da:details>
|
<da:dcmin>2.24</da:dcmin>
|
||||||
<da:support>https://github.com/JcDenis/tinyPacker</da:support>
|
<da:details>https://plugins.dotaddict.org/dc2/details/tinyPacker</da:details>
|
||||||
</module>
|
<da:support>https://github.com/JcDenis/tinyPacker</da:support>
|
||||||
|
</module>
|
||||||
</modules>
|
</modules>
|
Loading…
Reference in New Issue
Block a user