add report, change preference for setting, less functions args, less interface text

This commit is contained in:
Jean-Christian Denis 2021-09-15 23:48:58 +02:00
parent bb3966b189
commit 346b59b5bb
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
13 changed files with 994 additions and 418 deletions

View file

@ -1,10 +1,16 @@
0.2 -dev 0.2 -dev
- [ ] add global config for file size limit - [ ] add global config for file size limit
- [ ] add function to summarize by action what was done
- [ ] add module to check depracated Dotclear function - [ ] add module to check depracated Dotclear function
- [ ] add module to check deprecated PHP function - [ ] add module to check deprecated PHP function
- [ ] add module to check directory structure - [ ] add module to check directory structure
- [ ] add DA badge to module _gitshields_ - [ ] write documentation of php class
0.1.2
- add logs / report systeme
- add DA badge to module _gitshields_
- change function args, less is better
- change interface, lighter names
- add function to summarize by action what was done
0.1.1 0.1.1
- fix php < 8.0 - fix php < 8.0

View file

@ -19,7 +19,7 @@ $this->registerModule(
'improve', 'improve',
'Tiny tools to fix things for module devs', 'Tiny tools to fix things for module devs',
'Jean-Christian Denis and contributors', 'Jean-Christian Denis and contributors',
'0.1.1', '0.1.2',
[ [
'requires' => [['core', '2.19']], 'requires' => [['core', '2.19']],
'permissions' => null, 'permissions' => null,

View file

@ -11,24 +11,33 @@
* @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
*/ */
/** /**
* This is the absract action class. * @brief Plugin improve action class
* *
* Action class must extends class ImproveAction. * Action class must extends class ImproveAction.
* Call 'create' function with child class name through behavior, * If your class signature is myActionClass extends ImproveAction,
* If your class signature is myClass extends ImproveAction, do * do $core->addBehavior('ImproveAddAction'), ['myClass', 'create']);
* $core->addBehavior('ImproveAddAction'), ['myClass', 'create']); * yoru action class is automatically created,
* then function init() of your class wil be called. * then function init() of your class wil be called.
* One class must manage only one action. * One class must manage only one action.
*
* @package Plugin_improve
* @subpackage Action
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0-only
*/ */
abstract class ImproveAction abstract class ImproveAction
{ {
protected $core; protected $core;
protected $type = '';
protected $module = []; protected $module = [];
protected $path_full = '';
protected $path_extension = '';
protected $path_is_dir = null;
private static $notice = []; private $logs = ['success' => [], 'warning' => [], 'error' => []];
private $preferences = []; private $settings = [];
private $properties = [ private $properties = [
'id' => '', 'id' => '',
'name' => '', 'name' => '',
@ -38,14 +47,17 @@ abstract class ImproveAction
'types' => ['plugin'] 'types' => ['plugin']
]; ];
/**
* ImproveAction constructor inits properpties and settings of a child class.
*
* @param string $core dcCore instance
*/
final public function __construct(dcCore $core) final public function __construct(dcCore $core)
{ {
$this->core = $core; $this->core = $core;
self::$notice[get_called_class()] = ['error' => [], 'warning' => []]; $settings = @unserialize($core->blog->settings->improve->get('settings_' . get_called_class()));
$this->settings = is_array($settings) ? $settings : [];
$pref = @unserialize($core->blog->settings->improve->get('preferences_' . get_called_class()));
$this->preferences = is_array($pref) ? $pref : [];
$this->init(); $this->init();
@ -55,33 +67,64 @@ abstract class ImproveAction
} }
} }
final protected static function notice(string $message, bool $is_error = true) /**
* Helper to create an instance of a ImproveAction child class.
*
* @param string $o ArrayObject of actions list
* @param string $core dcCore instance
*/
public static function create(arrayObject $o, dcCore $core)
{ {
if (!empty($message)) { $c = get_called_class();
self::$notice[get_called_class()][$is_error ? 'error' : 'warning'][] = $message; $o->append(new $c($core));
}
} }
final public static function hasNotice(bool $error = true): bool /**
{ * Action initialisation function.
return !empty(self::$notice[get_called_class()][$error ? 'error' : 'warning']); *
} * It's called when an instance of ImproveAction child class is created.
* Usefull to setup action class.
final public static function getNotice(bool $error = true): array *
{ * @return bool True if initialisation is ok.
return self::$notice[get_called_class()][$error ? 'error' : 'warning']; */
} abstract protected function init(): bool;
/// @name Properties methods
//@{
/**
* @see getProperty();
*/
final public function __get(string $property) final public function __get(string $property)
{ {
return $this->getProperty($property); return $this->getProperty($property);
} }
/**
* Get a definition property of action class
*
* @return mixed A property of action definition.
*/
final public function getProperty(string $property) final public function getProperty(string $property)
{ {
return $this->properties[$property] ?? null; return $this->properties[$property] ?? null;
} }
/**
* Set a definition property of action class
*
* Property can be:
* - id : action id
* - name : action short name
* - desc : action short description,
* - priority : order of execution of this action
* - config : as configuration gui, false = none, true = internal, string = ext url
* - types : array of supported type of module, can : be plugins and/or themes
*
* @param mixed $property one or more definition
* @param dtring $value value for a single property
*
* @return mixed A property of action definition.
*/
final protected function setProperties($property, $value = null): bool final protected function setProperties($property, $value = null): bool
{ {
$properties = is_array($property) ? $property : [$property => $value]; $properties = is_array($property) ? $property : [$property => $value];
@ -95,26 +138,51 @@ abstract class ImproveAction
} }
return true; return true;
} }
//@}
final protected function getPreference(string $preference) /// @name Settings methods
//@{
/**
* Get a settings of action class
*
* @param string $setting a settings id
*
* @return mixed A setting of action.
*/
final protected function getSetting(string $setting)
{ {
return $this->preferences[$preference] ?? null; return $this->settings[$setting] ?? null;
} }
final protected function setPreferences($preference, $value = null) /**
* Set one or more setting of action class
*
* @param mixed $settings one or more settings
* @param string $value value for a single setting
*
* @return mixed A setting of action.
*/
final protected function setSettings($settings, $value = null)
{ {
$preferences = is_array($preference) ? $preference : [$preference => $value]; $settings = is_array($settings) ? $settings : [$setting => $value];
foreach($preferences as $k => $v) { foreach($settings as $k => $v) {
$this->preferences[$k] = $v; $this->settings[$k] = $v;
} }
return true; return true;
} }
/**
* Redirection after settings update
*
* This save settings update before redirect.
*
* @param string $url redirect url after settings update
*/
final protected function redirect(string $url) final protected function redirect(string $url)
{ {
$this->core->blog->settings->improve->put( $this->core->blog->settings->improve->put(
'preferences_' . get_called_class(), 'settings_' . get_called_class(),
serialize($this->preferences), serialize($this->settings),
'string', 'string',
null, null,
true, true,
@ -125,51 +193,240 @@ abstract class ImproveAction
http::redirect($url); http::redirect($url);
} }
abstract protected function init(): bool; /**
* Check if action class is well configured
*
* @return boolean True if class action is well configured
*/
abstract public function isConfigured(): bool; abstract public function isConfigured(): bool;
public static function create(arrayObject $o, dcCore $core) /**
* Get configuraton gui
*
* If action class uses internal configuration,
* it must share here html form content of its settings.
* It must not use enclose bloc "form" nor button "save".
* This function is also called to redirect form
* after validation with $this->redirect($url);
*
* @param string $url post form redirect url
*
* @return mixed A setting of action.
*/
public function configure(string $url): ?string
{ {
$c = get_called_class(); return null;
$o->append(new $c($core)); }
//@}
/**
* Set in class var current module definitions.
*
* @see Improve::sanitizeModule()
*
* @param array $module Full array of module definitons
*/
final public function setModule(array $module)
{
$this->module = $module;
} }
public function configure(string $redirect_url): ?string /**
* Set in class var current path definitons.
*
* @param string $path_full Full path
* @param string $path_extension Path extension (if it is a file)
* @param string $path_is_dir True if path is a directory
*/
final public function setPath(string $path_full, string $path_extension, bool $path_is_dir)
{
$this->path_full = $path_full;
$this->path_extension = $path_extension;
$this->path_is_dir = $path_is_dir;
}
/// @name Fix methods
//@{
/**
* Called when starting to fix module.
*/
public function openModule(): ?bool
{ {
return null; return null;
} }
public function openModule(string $module_type, array $module_info): ?bool /**
{ * Called when open a directory to fix.
$this->type = $module_type; */
$this->module = $module_info; public function openDirectory(): ?bool
return null;
}
public function openDirectory(string $path): ?bool
{ {
return null; return null;
} }
public function openFile(string $path, string $extension): ?bool /**
* Called when open a file to fix.
*/
public function openFile(): ?bool
{ {
return null; return null;
} }
public function readFile(string $path, string $extension, string &$content): ?bool /**
* Called when read content of a file to fix.
*
* Content is shared from action to another.
* If an action erase content, fix is stopped.
* If you want to erase a content you must erase
* the file on action openDirectory.
*
* @param string $content File content
*/
public function readFile(string &$content): ?bool
{ {
return null; return null;
} }
public function closeFile(string $path, string $extension): ?bool /**
* Called when close a file to fix.
*/
public function closeFile(): ?bool
{ {
return null; return null;
} }
public function closeModule(string $module_type, array $module_info): ?bool /**
* Called when close a module to fix.
*/
public function closeModule(): ?bool
{ {
return null; return null;
} }
//@}
/// @name Logs methods
//@{
/**
* Set an action log.
*
* Log must be use every time an action something happen.
*
* @param string $type type of message, can be error, warning, succes
* @param string $message message to log
*
* @return boolean True if message is logged.
*/
final public function setLog(string $type, string $message): bool
{
if (empty($this->path_full) || !array_key_exists($type, $this->logs)) {
return false;
}
$this->logs[$type][$this->path_full][] = $message;
return true;
}
/**
* Check if action class has log of given type.
*
* @param string $type type of message, can be error, warning, succes
*
* @return boolean True if messages exist.
*/
final public function hasLog(string $type): bool
{
return array_key_exists($type, $this->logs) && !empty($this->logs[$type]);
}
/**
* Get action logs.
*
* @param mixed $type type of message, can be error, warning, succes
*
* @return array Arry of given type of log or all if type is null
*/
final public function getLogs($type = null): array
{
if (null === $type) {
return $this->logs;
}
if (empty($this->path_full)
|| !array_key_exists($type, $this->logs)
|| !array_key_exists($this->path_full, $this->logs[$type])
) {
return [];
}
return $this->logs[$type][$this->path_full];
}
/**
* Set a log of type error.
*/
final public function setError(string $message)
{
$this->setLog('error', $message);
}
/**
* Check logs of type error exists.
*/
final public function hasError(): bool
{
return !empty($this->getLogs('error'));
}
/**
* Get logs of type error.
*/
final public function getErrors(): array
{
return $this->getLogs('error');
}
/**
* Set a log of type warning.
*/
final public function setWarning(string $message)
{
$this->setLog('warning', $message);
}
/**
* Check logs of type error warnings.
*/
final public function hasWarning(): bool
{
return !empty($this->getLogs('warning'));
}
/**
* Get logs of type warning.
*/
final public function getWarnings(): array
{
return $this->getLogs('warning');
}
/**
* Set a log of type success.
*/
final public function setSuccess(string $message)
{
$this->setLog('success', $message);
}
/**
* Check logs of type error success.
*/
final public function hasSuccess(): bool
{
return !empty($this->getLogs('success'));
}
/**
* Get logs of type success.
*/
final public function getSuccess(): array
{
return $this->getLogs('success');
}
//@}
} }

View file

@ -21,6 +21,8 @@ class Improve
]; ];
private $core; private $core;
private $actions = []; private $actions = [];
private $logs = [];
private $has_log = ['success' => false, 'warning' => false, 'error' => false];
public function __construct(dcCore $core) public function __construct(dcCore $core)
{ {
@ -42,6 +44,72 @@ class Improve
uasort($this->actions, [$this, 'sortModules']); uasort($this->actions, [$this, 'sortModules']);
} }
public function getLogs(): array
{
return $this->logs;
}
public function hasLog(string $type): bool
{
return array_key_exists($type, $this->has_log) && $this->has_log[$type];
}
public function writeLogs(): string
{
if (empty($this->logs)) {
return '';
}
$cur = $this->core->con->openCursor($this->core->prefix . 'log');
$cur->log_msg = serialize($this->logs);
$cur->log_table = 'improve';
$id = $this->core->log->addLog($cur);
return $id;
}
public function readLogs(int $id ): array
{
$rs = $this->core->log->getLogs(['log_table' => 'improve', 'log_id' => $id, 'limit' => 1]);
if ($rs->isEmpty()) {
return [];
}
$this->core->log->delLogs($rs->log_id);
return unserialize($rs->log_msg);
}
public function parselogs(int $id): array
{
$logs = $this->readLogs($id);
if (empty($logs)) {
return [];
}
$lines = [];
foreach($logs['improve'] as $path => $tools) {
$l_types = [];
foreach(['success', 'warning', 'error'] as $type) {
$l_tools = [];
foreach($tools as $tool) {
$l_msg = [];
if (!empty($logs[$tool][$type][$path])) {
foreach($logs[$tool][$type][$path] as $msg) {
$l_msg[] = $msg;
}
}
if (!empty($l_msg)) {
$l_tools[$tool] = $l_msg;
}
}
if (!empty($l_tools)) {
$l_types[$type] = $l_tools;
}
}
if (!empty($l_types)) {
$lines[$path] = $l_types;
}
}
return $lines;
}
public function module(string $id): ?ImproveAction public function module(string $id): ?ImproveAction
{ {
if (empty($id)) { if (empty($id)) {
@ -58,9 +126,10 @@ class Improve
return $this->actions[$id] ?? null; return $this->actions[$id] ?? null;
} }
public function fix(string $type, string $id, array $module, array $actions): int public function fixModule(string $type, string $id, array $properties, array $actions): float
{ {
$module = ImproveDefinition::clean($id, $module); $time_start = microtime(true);
$module = ImproveDefinition::clean($type, $id, $properties);
$workers = []; $workers = [];
foreach($actions as $action) { foreach($actions as $action) {
@ -69,9 +138,13 @@ class Improve
} }
} }
foreach($workers as $action) { foreach($workers as $action) {
// action: // trace all path and action in logs
// open module $this->logs['improve'][__('Begin')][] = $action->id;
$action->openModule($type, $module); // info: set current module
$action->setModule($module);
$action->setPath(__('Begin'), '', true);
// action: open module
$action->openModule();
} }
if (!isset($module['sroot']) || !$module['root_writable'] || !is_writable($module['sroot'])) { if (!isset($module['sroot']) || !$module['root_writable'] || !is_writable($module['sroot'])) {
throw new Exception(__('Module path is not writable')); throw new Exception(__('Module path is not writable'));
@ -81,25 +154,28 @@ class Improve
if (!file_exists($file[0])) { if (!file_exists($file[0])) {
continue; continue;
} }
foreach($workers as $action) {
// trace all path and action in logs
$this->logs['improve'][$file[0]][] = $action->id;
// info: set current path
$action->setPath($file[0], $file[1], $file[2]);
}
if (!$file[2]) { if (!$file[2]) {
foreach($workers as $action) { foreach($workers as $action) {
// action: // action: open a directory. full path
// open a directory. full path $action->openDirectory();
$action->openDirectory($file[0]);
} }
} else { } else {
foreach($workers as $action) { foreach($workers as $action) {
// action: // action: before openning a file. full path, extension
// before openning a file. full path, extension $action->openFile();
$action->openFile($file[0], $file[1]);
} }
if (in_array($file[1], self::$readfile_extensions)) { if (in_array($file[1], self::$readfile_extensions)) {
if (false !== ($content = file_get_contents($file[0]))) { if (false !== ($content = file_get_contents($file[0]))) {
$no_content = empty($content); $no_content = empty($content);
foreach($workers as $action) { foreach($workers as $action) {
// action: // action: read a file content. full path, extension, content
// read a file content. full path, extension, content $action->readFile($content);
$action->readFile($file[0], $file[1], $content);
if (empty($content) && !$no_content) { if (empty($content) && !$no_content) {
throw new Exception(sprintf( throw new Exception(sprintf(
__('File content has been removed: %s by %s'), $file[0], $action->name __('File content has been removed: %s by %s'), $file[0], $action->name
@ -109,29 +185,31 @@ class Improve
files::putContent($file[0], $content); files::putContent($file[0], $content);
} }
foreach($workers as $action) { foreach($workers as $action) {
// action: // action: after closing a file. full path, extension
// after closing a file. full path, extension $action->closeFile();
$action->closeFile($file[0], $file[1]);
} }
} }
} }
} }
// action:
// close module
foreach($workers as $action) {
$action->closeModule($type, $module);
}
foreach($workers as $action) {
if ($action->hasNotice()) {
dcPage::addErrorNotice($action->name . ' : ' . implode(', ', $action->getNotice()));
}
}
foreach($workers as $action) { foreach($workers as $action) {
if ($action->hasNotice(false)) { // trace all path and action in logs
dcPage::addWarningNotice($action->name . ' : ' . implode(', ', $action->getNotice(false))); $this->logs['improve'][__('End')][] = $action->id;
// info: set current module
$action->setPath(__('End'), '', true);
// action: close module
$action->closeModule();
}
// info: get acions reports
foreach($workers as $action) {
$this->logs[$action->id] = $action->getLogs();
foreach($this->has_log as $type => $v) {
if ($action->hasLog($type)) {
$this->has_log[$type] = true;
} }
} }
return count($tree); }
return substr(microtime(true) - $time_start, 0, 5);
} }
private static function getModuleFiles(string $path, string $dir = '', array $res = []): array private static function getModuleFiles(string $path, string $dir = '', array $res = []): array
@ -164,7 +242,7 @@ class Improve
public function getURL(array $params = []): string public function getURL(array $params = []): string
{ {
return $this->core->adminurl->get('admin.plugin.improve', $params); return $this->core->adminurl->get('admin.plugin.improve', $params, '&');
} }
public static function cleanExtensions($in): array public static function cleanExtensions($in): array
@ -197,11 +275,11 @@ class ImproveDefinition
{ {
private $properties = []; private $properties = [];
public function __construct(string $id, array $properties = []) public function __construct(string $type, string $id, array $properties = [])
{ {
$this->loadDefine($id, $properties['root']); $this->loadDefine($id, $properties['root']);
$this->properties = array_merge($this->properties, self::sanitizeModule($id, $properties)); $this->properties = array_merge($this->properties, self::sanitizeModule($type, $id, $properties));
} }
public function get() public function get()
@ -209,9 +287,9 @@ class ImproveDefinition
return $this->properties; return $this->properties;
} }
public static function clean($id, $properties) public static function clean(string $type, string $id, array $properties): array
{ {
$p = new self($id, $properties); $p = new self($type, $id, $properties);
return $p->get(); return $p->get();
} }
@ -255,7 +333,7 @@ class ImproveDefinition
} }
# adapt from lib.moduleslist.php # adapt from lib.moduleslist.php
public static function sanitizeModule(string $id, array $properties): array public static function sanitizeModule(string $type, string $id, array $properties): array
{ {
$label = empty($properties['label']) ? $id : $properties['label']; $label = empty($properties['label']) ? $id : $properties['label'];
$name = __(empty($properties['name']) ? $label : $properties['name']); $name = __(empty($properties['name']) ? $label : $properties['name']);
@ -292,6 +370,7 @@ class ImproveDefinition
[ [
'id' => $id, 'id' => $id,
'sid' => self::sanitizeString($id), 'sid' => self::sanitizeString($id),
'type' => $type,
'label' => $label, 'label' => $label,
'name' => $name, 'name' => $name,
'oname' => $oname, 'oname' => $oname,

View file

@ -17,7 +17,7 @@ class ImproveActionDcstore extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'dcstore', 'id' => 'dcstore',
'name' => __('Fix dcstore.xml'), 'name' => __('Store file'),
'desc' => __('Re-create dcstore.xml file according to _define.php variables'), 'desc' => __('Re-create dcstore.xml file according to _define.php variables'),
'priority' => 420, 'priority' => 420,
'config' => true, 'config' => true,
@ -29,13 +29,13 @@ class ImproveActionDcstore extends ImproveAction
public function isConfigured(): bool public function isConfigured(): bool
{ {
return !empty($this->getPreference('pattern')); return !empty($this->getSetting('pattern'));
} }
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save']) && !empty($_POST['dcstore_pattern'])) { if (!empty($_POST['save']) && !empty($_POST['dcstore_pattern'])) {
$this->setPreferences('pattern', (string) $_POST['dcstore_pattern']); $this->setSettings('pattern', (string) $_POST['dcstore_pattern']);
$this->redirect($url); $this->redirect($url);
} }
@ -43,7 +43,7 @@ class ImproveActionDcstore extends ImproveAction
'<p class="info">' . __('File will be overwritten if it exists') . '</p>' . '<p class="info">' . __('File will be overwritten if it exists') . '</p>' .
'<p><label class="classic" for="dcstore_pattern">' . '<p><label class="classic" for="dcstore_pattern">' .
__('Predictable URL to zip file on the external repository') . '<br />' . __('Predictable URL to zip file on the external repository') . '<br />' .
form::field('dcstore_pattern', 160, 255, $this->getPreference('pattern')) . '</label>' . form::field('dcstore_pattern', 160, 255, $this->getSetting('pattern')) . '</label>' .
'</p>' . '</p>' .
'<p class="form-note">' . '<p class="form-note">' .
sprintf(__('You can use wildcards %s'), '%author%, %type%, %id%, %version%.') . sprintf(__('You can use wildcards %s'), '%author%, %type%, %id%, %version%.') .
@ -54,20 +54,17 @@ class ImproveActionDcstore extends ImproveAction
</p>'; </p>';
} }
public function openModule($module_type, $module_info): ?bool public function openModule(): ?bool
{ {
$this->type = $module_type; $content = $this->generateXML();
$this->module = $module_info; if ($this->hasError()) {
$content = self::generateXML($module_info['id'], $module_info, $this->getPreference('pattern'));
if (self::hasNotice()) {
return false; return false;
} }
try { try {
files::putContent($module_info['sroot'] . '/dcstore.xml', $content); files::putContent($this->module['sroot'] . '/dcstore.xml', $content);
$this->setSuccess(__('Write dcstore.xml file.'));
} catch(Exception $e) { } catch(Exception $e) {
self::notice(__('Failed to write dcstore.xml file')); $this->setError(__('Failed to write dcstore.xml file'));
return false; return false;
} }
@ -75,97 +72,93 @@ class ImproveActionDcstore extends ImproveAction
return true; return true;
} }
public static function generateXML($id, $module, $file_pattern) public function generateXML()
{ {
if (!is_array($module) || empty($module)) {
return false;
}
$xml = ['<modules xmlns:da="http://dotaddict.org/da/">']; $xml = ['<modules xmlns:da="http://dotaddict.org/da/">'];
# id # id
if (empty($module['id'])) { if (empty($this->module['id'])) {
self::notice(__('unkow module id')); $this->setError(__('unkow module id'));
} }
$xml[] = sprintf('<module id="%s">', html::escapeHTML($module['id'])); $xml[] = sprintf('<module id="%s">', html::escapeHTML($this->module['id']));
# name # name
if (empty($module['oname'])) { if (empty($this->module['oname'])) {
self::notice(__('unknow module name')); $this->setError(__('unknow module name'));
} }
$xml[] = sprintf('<name>%s</name>', html::escapeHTML($module['name'])); $xml[] = sprintf('<name>%s</name>', html::escapeHTML($this->module['name']));
# version # version
if (empty($module['version'])) { if (empty($this->module['version'])) {
self::notice(__('unknow module version')); $this->setError(__('unknow module version'));
} }
$xml[] = sprintf('<version>%s</version>', html::escapeHTML($module['version'])); $xml[] = sprintf('<version>%s</version>', html::escapeHTML($this->module['version']));
# author # author
if (empty($module['author'])) { if (empty($this->module['author'])) {
self::notice(__('unknow module author')); $this->setError(__('unknow module author'));
} }
$xml[] = sprintf('<author>%s</author>', html::escapeHTML($module['author'])); $xml[] = sprintf('<author>%s</author>', html::escapeHTML($this->module['author']));
# desc # desc
if (empty($module['desc'])) { if (empty($this->module['desc'])) {
self::notice(__('unknow module description')); $this->setError(__('unknow module description'));
} }
$xml[] = sprintf('<desc>%s</desc>', html::escapeHTML($module['desc'])); $xml[] = sprintf('<desc>%s</desc>', html::escapeHTML($this->module['desc']));
# repository # repository
if (empty($module['repository'])) { if (empty($this->module['repository'])) {
self::notice(__('no repository set in _define.php')); $this->setError(__('no repository set in _define.php'));
} }
# file # file
$file_pattern = self::parseFilePattern($module, $file_pattern); $file_pattern = $this->parseFilePattern();
if (empty($file_pattern)) { if (empty($file_pattern)) {
self::notice(__('no zip file pattern set in configuration')); $this->setError(__('no zip file pattern set in configuration'));
} }
$xml[] = sprintf('<file>%s</file>', html::escapeHTML($file_pattern)); $xml[] = sprintf('<file>%s</file>', html::escapeHTML($file_pattern));
# da dc_min or requires core # da dc_min or requires core
if (!empty($module['requires']) && is_array($module['requires'])) { if (!empty($this->module['requires']) && is_array($this->module['requires'])) {
foreach ($module['requires'] as $req) { foreach ($this->module['requires'] as $req) {
if (!is_array($req)) { if (!is_array($req)) {
$req = [$req]; $req = [$req];
} }
if ($req[0] == 'core') { if ($req[0] == 'core') {
$module['dc_min'] = $req[1]; $this->module['dc_min'] = $req[1];
break; break;
} }
} }
} }
if (empty($module['dc_min'])) { if (empty($this->module['dc_min'])) {
self::notice(__('no minimum dotclear version'), false); $this->setWarning(__('no minimum dotclear version'));
} else { } else {
$xml[] = sprintf('<da:dcmin>%s</da:dcmin>', html::escapeHTML($module['dc_min'])); $xml[] = sprintf('<da:dcmin>%s</da:dcmin>', html::escapeHTML($this->module['dc_min']));
} }
# da details # da details
if (empty($module['details'])) { if (empty($this->module['details'])) {
self::notice(__('no details URL'), false); $this->setWarning(__('no details URL'));
} else { } else {
$xml[] = sprintf('<da:details>%s</da:details>', html::escapeHTML($module['details'])); $xml[] = sprintf('<da:details>%s</da:details>', html::escapeHTML($this->module['details']));
} }
# da sshot # da sshot
//$xml[] = sprintf('<da:sshot>%s</da:sshot>', html::escapeHTML($module['sshot'])); //$xml[] = sprintf('<da:sshot>%s</da:sshot>', html::escapeHTML($this->module['sshot']));
# da section # da section
//$xml[] = sprintf('<da:section>%s</da:section>', html::escapeHTML($module['section'])); //$xml[] = sprintf('<da:section>%s</da:section>', html::escapeHTML($this->module['section']));
# da support # da support
if (empty($module['support'])) { if (empty($this->module['support'])) {
self::notice(__('no support URL'), false); $this->setWarning(__('no support URL'));
} else { } else {
$xml[] = sprintf('<da:support>%s</da:support>', html::escapeHTML($module['support'])); $xml[] = sprintf('<da:support>%s</da:support>', html::escapeHTML($this->module['support']));
} }
# da tags # da tags
//$xml[] = sprintf('<da:tags>%s</da:tags>', html::escapeHTML($module['tags'])); //$xml[] = sprintf('<da:tags>%s</da:tags>', html::escapeHTML($this->module['tags']));
$xml[] = '</module>'; $xml[] = '</module>';
$xml[] = '</modules>'; $xml[] = '</modules>';
@ -173,7 +166,7 @@ class ImproveActionDcstore extends ImproveAction
return implode("\n", $xml); return implode("\n", $xml);
} }
private static function parseFilePattern($module, $file_pattern) private function parseFilePattern()
{ {
return text::tidyURL(str_replace( return text::tidyURL(str_replace(
[ [
@ -183,12 +176,12 @@ class ImproveActionDcstore extends ImproveAction
'%author%' '%author%'
], ],
[ [
$module['type'], $this->module['type'],
$module['id'], $this->module['id'],
$module['version'], $this->module['version'],
$module['author'] $this->module['author']
], ],
$file_pattern $this->getSetting('pattern')
)); ));
} }
} }

View file

@ -31,7 +31,7 @@ class ImproveActionGitshields extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'gitshields', 'id' => 'gitshields',
'name' => __('Fix shields badges'), 'name' => __('Shields badges'),
'desc' => __('Add and maintain shields.io badges to the REDAME.md file'), 'desc' => __('Add and maintain shields.io badges to the REDAME.md file'),
'priority' => 380, 'priority' => 380,
'config' => true, 'config' => true,
@ -43,13 +43,13 @@ class ImproveActionGitshields extends ImproveAction
public function isConfigured(): bool public function isConfigured(): bool
{ {
return !empty($this->getPreference('username')); return !empty($this->getSetting('username'));
} }
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save']) && !empty($_POST['username'])) { if (!empty($_POST['save']) && !empty($_POST['username'])) {
$this->setPreferences([ $this->setSettings([
'username' => (string) $_POST['username'], 'username' => (string) $_POST['username'],
'dotaddict' => !empty($_POST['dotaddict']) 'dotaddict' => !empty($_POST['dotaddict'])
]); ]);
@ -58,28 +58,26 @@ class ImproveActionGitshields extends ImproveAction
return ' return '
<p><label for="username">' . __('Your Github user name :') . '</label>' . <p><label for="username">' . __('Your Github user name :') . '</label>' .
form::field('username', 60, 100, $this->getPreference('username')) . ' form::field('username', 60, 100, $this->getSetting('username')) . '
</p><p class="form-note">' . __('Used in your Github URL: http://github.com/username/module_id.') . '<br />' . </p><p class="form-note">' . __('Used in your Github URL: http://github.com/username/module_id.') . '<br />' .
__('If you have badges not created by this tool in the README.md file you should remove them manually.') . '</p> __('If you have badges not created by this tool in the README.md file you should remove them manually.') . '</p>
<p><label for="dotaddict">' . <p><label for="dotaddict">' .
form::checkbox('dotaddict', 1, !empty($this->getPreference('dotaddict'))) . ' '. form::checkbox('dotaddict', 1, !empty($this->getSetting('dotaddict'))) . ' '.
__('Include Dotaddict badge') . '</label> __('Include Dotaddict badge') . '</label>
</p><p class="form-note">' . __('If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.') . '</p>'; </p><p class="form-note">' . __('If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.') . '</p>';
} }
public function openModule(string $module_type, array $module_info): ?bool public function openModule(): ?bool
{ {
$this->type = $module_type;
$this->module = $module_info;
$this->replaceInfo(); $this->replaceInfo();
return null; return null;
} }
public function readFile($path, $extension, &$content): ?bool public function readFile(&$content): ?bool
{ {
if ($this->stop_scan || !preg_match('/(.*?)README\.md$/i', $path)) { if ($this->stop_scan || !preg_match('/(.*?)README\.md$/i', $this->path_full)) {
return null; return null;
} }
@ -92,31 +90,38 @@ class ImproveActionGitshields extends ImproveAction
private function replaceInfo() private function replaceInfo()
{ {
$username = $this->getPreference('username');
$module = $this->module['id'];
$type = $this->module['type'];
$dotclear = $this->getDotclearVersion();
$bloc = []; $bloc = [];
foreach($this->bloc_content as $k => $v) { foreach($this->bloc_content as $k => $v) {
if ($k == 'dotaddict' && empty($this->getPreference('dotaddict'))) { if ($k == 'dotaddict' && empty($this->getSetting('dotaddict'))) {
continue; continue;
} }
$bloc[$k] = trim(str_replace( $bloc[$k] = trim(str_replace(
['%username%', '%module%', '%dotclear%', '%type%', "\r\n", "\n"], [
[$username, $module, $dotclear, $type, '', ''], '%username%',
'%module%',
'%dotclear%',
'%type%',
"\r\n", "\n"
],
[
$this->getSetting('username'),
$this->module['id'],
$dotclear = $this->getDotclearVersion(),
$this->module['type'],
'', ''
],
$v $v
)); ));
} }
$this->bloc = $bloc; $this->bloc = $bloc;
$this->setSuccess(__('Prepare custom shield info'));
} }
private function getDotclearVersion() private function getDotclearVersion()
{ {
$version = null; $version = null;
$module = $this->module; if (!empty($this->module['requires']) && is_array($this->module['requires'])) {
if (!empty($module['requires']) && is_array($module['requires'])) { foreach ($this->module['requires'] as $req) {
foreach ($module['requires'] as $req) {
if (!is_array($req)) { if (!is_array($req)) {
$req = [$req]; $req = [$req];
} }
@ -131,20 +136,31 @@ class ImproveActionGitshields extends ImproveAction
private function writeShieldsBloc($content) private function writeShieldsBloc($content)
{ {
return preg_replace( $res = preg_replace(
$this->bloc_pattern['target'], $this->bloc_pattern['target'],
'$1' . "\n\n" . trim(implode("\n", $this->bloc)) . "\n\n", '$1' . "\n\n" . trim(implode("\n", $this->bloc)) . "\n\n",
$content, $content,
1 1,
$count
); );
if ($count) {
$this->setSuccess(__('Write new shield bloc'));
}
return $res;
} }
private function deleteShieldsBloc($content) private function deleteShieldsBloc($content)
{ {
return preg_replace( $res = preg_replace(
$this->bloc_pattern['remove'], $this->bloc_pattern['remove'],
"\n\n", "\n\n",
$content $content,
1,
$count
); );
if ($count) {
$this->setSuccess(__('Delete old shield bloc'));
}
return $res;
} }
} }

View file

@ -26,7 +26,7 @@ class ImproveActionLicensefile extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'license', 'id' => 'license',
'name' => __('Fix license file'), 'name' => __('License file'),
'desc' => __('Add or remove full license file to module root'), 'desc' => __('Add or remove full license file to module root'),
'priority' => 330, 'priority' => 330,
'config' => true, 'config' => true,
@ -57,7 +57,7 @@ class ImproveActionLicensefile extends ImproveAction
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
$this->setPreferences([ $this->setSettings([
'action_version' => !empty($_POST['action_version']) ? $_POST['action_version'] : '', 'action_version' => !empty($_POST['action_version']) ? $_POST['action_version'] : '',
'action_full' => !empty($_POST['action_full']) ? $_POST['action_full'] : '' 'action_full' => !empty($_POST['action_full']) ? $_POST['action_full'] : ''
]); ]);
@ -66,25 +66,22 @@ class ImproveActionLicensefile extends ImproveAction
return ' return '
<p class="field"><label for="action_version">' . __('License version:') . '</label>' . <p class="field"><label for="action_version">' . __('License version:') . '</label>' .
form::combo('action_version', $this->action_version, $this->getPreference('action_version')) . ' form::combo('action_version', $this->action_version, $this->getSetting('action_version')) . '
</p> </p>
<p class="field"><label for="action_full">' . __('Action on file:') . '</label>' . <p class="field"><label for="action_full">' . __('Action on file:') . '</label>' .
form::combo('action_full', $this->action_full, $this->getPreference('action_full')) . form::combo('action_full', $this->action_full, $this->getSetting('action_full')) .
'</p>'; '</p>';
} }
public function openModule(string $module_type, array $module_info): ?bool public function openModule(): ?bool
{ {
$this->type = $module_type; if (in_array($this->getSetting('action_full'), ['remove', 'full','overwrite'])) {
$this->module = $module_info; $this->deleteFullLicense(($this->getSetting('action_full') == 'overwrite'));
if (in_array($this->getPreference('action_full'), ['remove', 'full','overwrite'])) {
$this->deleteFullLicense(($this->getPreference('action_full') == 'overwrite'));
} }
if (in_array($this->getPreference('action_full'), ['create', 'overwrite', 'full'])) { if (in_array($this->getSetting('action_full'), ['create', 'overwrite', 'full'])) {
if (empty($this->getPreference('action_version'))) { if (empty($this->getSetting('action_version'))) {
self::notice(__('no full license type selected'), false); $this->setWarning(__('No full license type selected'));
} else { } else {
$this->writeFullLicense(); $this->writeFullLicense();
} }
@ -95,15 +92,16 @@ class ImproveActionLicensefile extends ImproveAction
private function writeFullLicense() private function writeFullLicense()
{ {
try { try {
$full = file_get_contents(dirname(__FILE__) . '/license/' . $this->getPreference('action_version') . '.full.txt'); $full = file_get_contents(dirname(__FILE__) . '/license/' . $this->getSetting('action_version') . '.full.txt');
if (empty($full)) { if (empty($full)) {
self::notice(__('failed to load full license')); $this->setError(__('Failed to load license content'));
return null; return null;
} }
files::putContent($this->module['root'] . '/LICENSE', str_replace("\r\n", "\n", $full)); files::putContent($this->module['root'] . '/LICENSE', str_replace("\r\n", "\n", $full));
$this->setSuccess(__('Write new license file "LICENSE"'));
} catch (Exception $e) { } catch (Exception $e) {
self::notice(__('failed to write full license')); $this->setError(__('Failed to write new license file'));
return null; return null;
} }
@ -113,14 +111,15 @@ class ImproveActionLicensefile extends ImproveAction
private function deleteFullLicense($only_one = false) private function deleteFullLicense($only_one = false)
{ {
foreach(self::fileExists($this->module['root']) as $file) { foreach(self::fileExists($this->module['root']) as $file) {
if ($only_one && $file != 'license') { if ($only_one && $file != 'LICENSE') {
continue; continue;
} }
if (!files::isDeletable($this->module['root'] . '/' . $file)) { if (!files::isDeletable($this->module['root'] . '/' . $file)) {
self::notice(sprintf(__('full license is not deletable (%s)'), $file), false); $this->setWarning(sprintf(__('Old license file is not deletable (%s)'), $file));
} } elseif (!@unlink($this->module['root'] . '/' . $file)) {
if (!@unlink($this->module['root'] . '/' . $file)) { $this->setError(sprintf(__('Failed to delete old license file (%s)'), $file));
self::notice(sprintf(__('failed to delete full license (%s)'), $file), false); } else {
$this->setSuccess(sprintf(__('Delete old license file "%s"'), $file));
} }
} }
return true; return true;

View file

@ -17,7 +17,7 @@ class ImproveActionTab extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'tab', 'id' => 'tab',
'name' => __('Fix tabulation'), 'name' => __('Tabulations'),
'desc' => __('Replace tabulation by four space in php files'), 'desc' => __('Replace tabulation by four space in php files'),
'priority' => 820, 'priority' => 820,
'types' => ['plugin', 'theme'] 'types' => ['plugin', 'theme']
@ -26,12 +26,16 @@ class ImproveActionTab extends ImproveAction
return true; return true;
} }
public function readFile($path, $extension, &$content): ?bool public function readFile(&$content): ?bool
{ {
if (!in_array($extension, ['php', 'md'])) { if (!in_array($this->path_extension, ['php', 'md'])) {
return null; return null;
} }
$content = preg_replace('/(\t)/', ' ', $content)."\n"; $clean = preg_replace('/(\t)/', ' ', $content);// . "\n";
if ($content != $clean) {
$this->setSuccess(__('Replace tabulation by spaces'));
$content = $clean;
}
return true; return true;
} }
@ -50,7 +54,7 @@ class ImproveActionNewline extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'newline', 'id' => 'newline',
'name' => __('Fix newline'), 'name' => __('Newlines'),
'desc' => __('Replace bad and repetitive and empty newline by single newline in files'), 'desc' => __('Replace bad and repetitive and empty newline by single newline in files'),
'priority' => 840, 'priority' => 840,
'config' => true, 'config' => true,
@ -68,20 +72,20 @@ class ImproveActionNewline extends ImproveAction
public function isConfigured(): bool public function isConfigured(): bool
{ {
return !empty($this->getPreference('extensions')); return !empty($this->getSetting('extensions'));
} }
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save']) && !empty($_POST['newline_extensions'])) { if (!empty($_POST['save']) && !empty($_POST['newline_extensions'])) {
$this->setPreferences( $this->setSettings(
'extensions', 'extensions',
Improve::cleanExtensions($_POST['newline_extensions']) Improve::cleanExtensions($_POST['newline_extensions'])
); );
$this->redirect($url); $this->redirect($url);
} }
$ext = $this->getPreference('extensions'); $ext = $this->getSetting('extensions');
if (!is_array($ext)) { if (!is_array($ext)) {
$ext = []; $ext = [];
} }
@ -95,13 +99,13 @@ class ImproveActionNewline extends ImproveAction
'</p>'; '</p>';
} }
public function readFile($path, $extension, &$content): ?bool public function readFile(&$content): ?bool
{ {
$ext = $this->getPreference('extensions'); $ext = $this->getSetting('extensions');
if (!is_array($ext) || !in_array($extension, $ext)) { if (!is_array($ext) || !in_array($this->path_extension, $ext)) {
return null; return null;
} }
$content = preg_replace( $clean = preg_replace(
'/(\n\s+\n)/', '/(\n\s+\n)/',
"\n\n", "\n\n",
preg_replace( preg_replace(
@ -111,7 +115,13 @@ class ImproveActionNewline extends ImproveAction
["\r\n", "\r"], ["\r\n", "\r"],
"\n", "\n",
$content $content
))); )
)
);
if ($content != $clean) {
$this->setSuccess(__('Replace bad new lines'));
$content = $clean;
}
return true; return true;
} }
@ -125,7 +135,7 @@ class ImproveActionEndoffile extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'endoffile', 'id' => 'endoffile',
'name' => __('Fix end of file'), 'name' => __('End of files'),
'desc' => __('Remove php tag and empty lines from end of files'), 'desc' => __('Remove php tag and empty lines from end of files'),
'priority' => 860, 'priority' => 860,
'config' => true, 'config' => true,
@ -143,29 +153,33 @@ class ImproveActionEndoffile extends ImproveAction
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
$this->setPreferences('psr2', !empty($_POST['endoffile_psr2'])); $this->setSettings('psr2', !empty($_POST['endoffile_psr2']));
$this->redirect($url); $this->redirect($url);
} }
return return
'<p><label class="classic" for="endoffile_psr2">' . '<p><label class="classic" for="endoffile_psr2">' .
form::checkbox('endoffile_psr2', 255, $this->getPreference('psr2')) . form::checkbox('endoffile_psr2', 255, $this->getSetting('psr2')) .
__('Add a blank line to the end of file') . __('Add a blank line to the end of file') .
'</label></p><p class="form-note">' . '</label></p><p class="form-note">' .
__('PSR2 must have a blank line, whereas PSR12 must not.') . __('PSR2 must have a blank line, whereas PSR12 must not.') .
'</p>'; '</p>';
} }
public function readFile($path, $extension, &$content): ?bool public function readFile(&$content): ?bool
{ {
if (!in_array($extension, ['php', 'md'])) { if (!in_array($this->path_extension, ['php', 'md'])) {
return null; return null;
} }
$content = preg_replace( $clean = preg_replace(
['/(\s*)(\?>\s*)$/', '/\n+$/'], ['/(\s*)(\?>\s*)$/', '/\n+$/'],
'', '',
$content $content
) . ($this->getPreference('psr2') ? "\n" : ''); ) . ($this->getSetting('psr2') ? "\n" : '');
if ($content != $clean) {
$this->setSuccess(__('Replace end of file'));
$content = $clean;
}
return true; return true;
} }

View file

@ -44,7 +44,7 @@ class ImproveActionPhpheader extends ImproveAction
{ {
$this->setProperties([ $this->setProperties([
'id' => 'phpheader', 'id' => 'phpheader',
'name' => __('Fix PHP header'), 'name' => __('PHP header'),
'desc' => __('Add or remove phpdoc header bloc from php file'), 'desc' => __('Add or remove phpdoc header bloc from php file'),
'priority' => 340, 'priority' => 340,
'config' => true, 'config' => true,
@ -64,13 +64,13 @@ class ImproveActionPhpheader extends ImproveAction
public function isConfigured(): bool public function isConfigured(): bool
{ {
return !empty($this->getPreference('bloc_action')) || !empty($this->getPreference('remove_old')); return !empty($this->getSetting('bloc_action')) || !empty($this->getSetting('remove_old'));
} }
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
$this->setPreferences([ $this->setSettings([
'bloc_action' => !empty($_POST['bloc_action']) ? $_POST['bloc_action'] : '', 'bloc_action' => !empty($_POST['bloc_action']) ? $_POST['bloc_action'] : '',
'bloc_content' => !empty($_POST['bloc_content']) ? $_POST['bloc_content'] : '', 'bloc_content' => !empty($_POST['bloc_content']) ? $_POST['bloc_content'] : '',
'remove_old' => !empty($_POST['remove_old']), 'remove_old' => !empty($_POST['remove_old']),
@ -81,22 +81,22 @@ class ImproveActionPhpheader extends ImproveAction
return ' return '
<p><label for="bloc_action">' . __('Action:') . '</label>' . <p><label for="bloc_action">' . __('Action:') . '</label>' .
form::combo('bloc_action', $this->action_bloc, $this->getPreference('bloc_action')) . ' form::combo('bloc_action', $this->action_bloc, $this->getSetting('bloc_action')) . '
</p> </p>
<p><label class="classic" for="remove_old">' . <p><label class="classic" for="remove_old">' .
form::checkbox('remove_old', 1, $this->getPreference('remove_old')) . ' ' . form::checkbox('remove_old', 1, $this->getSetting('remove_old')) . ' ' .
__('Remove old style bloc header (using #)') . __('Remove old style bloc header (using #)') .
'</label></p> '</label></p>
<p><label class="classic" for="exclude_locales">' . <p><label class="classic" for="exclude_locales">' .
form::checkbox('exclude_locales', 1, $this->getPreference('exclude_locales')) . ' ' . form::checkbox('exclude_locales', 1, $this->getSetting('exclude_locales')) . ' ' .
__('Do not add bloc to files from "locales" and "libs" folder') . __('Do not add bloc to files from "locales" and "libs" folder') .
'</label></p> '</label></p>
<p>' . __('Bloc content:') . '</p> <p>' . __('Bloc content:') . '</p>
<p class="area">' . <p class="area">' .
form::textarea('bloc_content', 50, 10, html::escapeHTML($this->getPreference('bloc_content'))) . ' form::textarea('bloc_content', 50, 10, html::escapeHTML($this->getSetting('bloc_content'))) . '
</p><p class="form-note">' . </p><p class="form-note">' .
sprintf( sprintf(
__('You can use wildcards %s') , __('You can use wildcards %s') ,
@ -105,49 +105,51 @@ class ImproveActionPhpheader extends ImproveAction
'<div class="fieldset box"><h4>' . __('Exemple') .'</h4><pre class="code">' . self::$exemple . '</pre></div>'; '<div class="fieldset box"><h4>' . __('Exemple') .'</h4><pre class="code">' . self::$exemple . '</pre></div>';
} }
public function openModule(string $module_type, array $module_info): ?bool public function openModule(): ?bool
{ {
$this->type = $module_type;
$this->module = $module_info;
$this->replaceInfo(); $this->replaceInfo();
return null; return null;
} }
public function openDirectory(string $path): ?bool public function openDirectory(): ?bool
{ {
$skipped = $this->stop_scan;
$this->stop_scan = false; $this->stop_scan = false;
if (!empty($this->getPreference('exclude_locales')) && preg_match('/\/(locales|libs)(\/.*?|)$/', $path)) { if (!empty($this->getSetting('exclude_locales')) && preg_match('/\/(locales|libs)(\/.*?|)$/', $this->path_full)) {
if (!$skipped) {
$this->setWarning(__('Skip directory'));
}
$this->stop_scan = true; $this->stop_scan = true;
} }
return null; return null;
} }
public function readFile($path, $extension, &$content): ?bool public function readFile(&$content): ?bool
{ {
if ($this->stop_scan || $extension !='php' || self::hasNotice()) { if ($this->stop_scan || $this->path_extension !='php' || $this->hasError()) {
return null; return null;
} }
if (!empty($this->getPreference('remove_old'))) { if (!empty($this->getSetting('remove_old'))) {
$content = $this->deleteOldBloc($content); $content = $this->deleteOldBloc($content);
} }
if (empty($this->getPreference('bloc_action'))) { if (empty($this->getSetting('bloc_action'))) {
return null; return null;
} }
$clean = $this->deleteDocBloc($content); $clean = $this->deleteDocBloc($content);
if ($this->getPreference('bloc_action') == 'remove') { if ($this->getSetting('bloc_action') == 'remove') {
$content = $clean; $content = $clean;
return null; return null;
} }
if ($content != $clean && $this->getPreference('bloc_action') == 'create') { if ($content != $clean && $this->getSetting('bloc_action') == 'create') {
return null; return null;
} }
if ($content == $clean && $this->getPreference('bloc_action') == 'replace') { if ($content == $clean && $this->getSetting('bloc_action') == 'replace') {
return null; return null;
} }
@ -159,7 +161,7 @@ class ImproveActionPhpheader extends ImproveAction
private function replaceInfo() private function replaceInfo()
{ {
$bloc = trim($this->getPreference('bloc_content')); $bloc = trim($this->getSetting('bloc_content'));
if (empty($bloc)) { if (empty($bloc)) {
self::notice(__('bloc is empty'), false); self::notice(__('bloc is empty'), false);
@ -190,8 +192,9 @@ class ImproveActionPhpheader extends ImproveAction
$bloc $bloc
) )
); );
$this->setSuccess(__('Prepare header info'));
} catch (Exception $e) { } catch (Exception $e) {
self::notice(__('failed to parse bloc')); $this->setError(__('Failed to parse bloc'));
return null; return null;
} }
@ -199,29 +202,46 @@ class ImproveActionPhpheader extends ImproveAction
private function writeDocBloc($content) private function writeDocBloc($content)
{ {
return preg_replace( $res = preg_replace(
'/^(\<\?php[\n|\r\n]+)/', '/^(\<\?php[\n|\r\n]+)/',
'<?php' . "\n/**\n * " . str_replace("\n", "\n * ", trim($this->bloc)) . "\n */\n\n", '<?php' . "\n/**\n * " . str_replace("\n", "\n * ", trim($this->bloc)) . "\n */\n\n",
$content, $content,
1 1,
$count
); );
if ($count) {
$this->setSuccess(__('Write new doc bloc content'));
}
return $res;
} }
private function deleteDocBloc($content) private function deleteDocBloc($content)
{ {
return preg_replace( $res = preg_replace(
'/^(\<\?php\s*[\n|\r\n]{0,1}\s*\/\*\*.*?\s*\*\/\s*[\n|\r\n]+)/msi', '/^(\<\?php\s*[\n|\r\n]{0,1}\s*\/\*\*.*?\s*\*\/\s*[\n|\r\n]+)/msi',
"<?php\n", "<?php\n",
$content $content,
-1,
$count
); );
if ($count) {
$this->setSuccess(__('Delete old doc bloc content'));
}
return $res;
} }
private function deleteOldBloc($content) private function deleteOldBloc($content)
{ {
return preg_replace( $res = preg_replace(
'/((# -- BEGIN LICENSE BLOCK ([-]+))(.*?)(# -- END LICENSE BLOCK ([-]+))([\n|\r\n]{1,}))/msi', '/((# -- BEGIN LICENSE BLOCK ([-]+))(.*?)(# -- END LICENSE BLOCK ([-]+))([\n|\r\n]{1,}))/msi',
"", "",
$content $content,
-1,
$count
); );
if ($count) {
$this->setSuccess(__('Delete old style bloc content'));
}
return $res;
} }
} }

View file

@ -51,13 +51,13 @@ class ImproveActionZip extends ImproveAction
public function isConfigured(): bool public function isConfigured(): bool
{ {
return !empty($this->getPreference('pack_repository')) && !empty($this->getPreference('pack_filename')); return !empty($this->getSetting('pack_repository')) && !empty($this->getSetting('pack_filename'));
} }
public function configure($url): ?string public function configure($url): ?string
{ {
if (!empty($_POST['save'])) { if (!empty($_POST['save'])) {
$this->setPreferences([ $this->setSettings([
'pack_repository' => !empty($_POST['pack_repository']) ? $_POST['pack_repository'] : '', 'pack_repository' => !empty($_POST['pack_repository']) ? $_POST['pack_repository'] : '',
'pack_filename' => !empty($_POST['pack_filename']) ? $_POST['pack_filename'] : '', 'pack_filename' => !empty($_POST['pack_filename']) ? $_POST['pack_filename'] : '',
'secondpack_filename' => !empty($_POST['secondpack_filename']) ? $_POST['secondpack_filename'] : '', 'secondpack_filename' => !empty($_POST['secondpack_filename']) ? $_POST['secondpack_filename'] : '',
@ -73,7 +73,7 @@ class ImproveActionZip extends ImproveAction
<h4>' . __('Root') . '</h4> <h4>' . __('Root') . '</h4>
<p><label for="pack_repository">' . __('Path to repository:') . ' ' . <p><label for="pack_repository">' . __('Path to repository:') . ' ' .
form::field('pack_repository', 65, 255, $this->getPreference('pack_repository'), 'maximal') . form::field('pack_repository', 65, 255, $this->getSetting('pack_repository'), 'maximal') .
'</label></p>' . '</label></p>' .
'<p class="form-note">' . sprintf(__('Preconization: %s'), $this->core->blog->public_path ? '<p class="form-note">' . sprintf(__('Preconization: %s'), $this->core->blog->public_path ?
path::real($this->core->blog->public_path) : __("Blog's public directory") path::real($this->core->blog->public_path) : __("Blog's public directory")
@ -84,17 +84,17 @@ class ImproveActionZip extends ImproveAction
<h4>' . __('Files') . '</h4> <h4>' . __('Files') . '</h4>
<p><label for="pack_filename">' . __('Name of exported package:') . ' ' . <p><label for="pack_filename">' . __('Name of exported package:') . ' ' .
form::field('pack_filename', 65, 255, $this->getPreference('pack_filename'), 'maximal') . form::field('pack_filename', 65, 255, $this->getSetting('pack_filename'), 'maximal') .
'</label></p>
<p class="form-note">' . sprintf(__('Preconization: %s'), '%type%-%id%-%version%') . '</p>
<p><label for="secondpack_filename">' . __('Name of second exported package:') . ' ' .
form::field('secondpack_filename', 65, 255, $this->getPreference('secondpack_filename'), 'maximal') .
'</label></p> '</label></p>
<p class="form-note">' . sprintf(__('Preconization: %s'), '%type%-%id%') . '</p> <p class="form-note">' . sprintf(__('Preconization: %s'), '%type%-%id%') . '</p>
<p><label for="secondpack_filename">' . __('Name of second exported package:') . ' ' .
form::field('secondpack_filename', 65, 255, $this->getSetting('secondpack_filename'), 'maximal') .
'</label></p>
<p class="form-note">' . sprintf(__('Preconization: %s'), '%type%-%id%-%version%') . '</p>
<p><label class="classic" for="pack_overwrite">'. <p><label class="classic" for="pack_overwrite">'.
form::checkbox('pack_overwrite', 1, !empty($this->getPreference('pack_overwrite'))) . ' ' . form::checkbox('pack_overwrite', 1, !empty($this->getSetting('pack_overwrite'))) . ' ' .
__('Overwrite existing package') . '</label></p> __('Overwrite existing package') . '</label></p>
</div> </div>
@ -103,32 +103,34 @@ class ImproveActionZip extends ImproveAction
<h4>' . __('Content') . '</h4> <h4>' . __('Content') . '</h4>
<p><label for="pack_excludefiles">' . __('Extra files to exclude from package:') . ' ' . <p><label for="pack_excludefiles">' . __('Extra files to exclude from package:') . ' ' .
form::field('pack_excludefiles', 65, 255, $this->getPreference('pack_excludefiles'), 'maximal') . form::field('pack_excludefiles', 65, 255, $this->getSetting('pack_excludefiles'), 'maximal') .
'</label></p> '</label></p>
<p class="form-note">' . sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz') . '<br />' . <p class="form-note">' . sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz') . '<br />' .
sprintf(__('By default all these files are always removed from packages : %s'), implode(', ', self::$exclude)) . '</p> sprintf(__('By default all these files are always removed from packages : %s'), implode(', ', self::$exclude)) . '</p>
<p><label class="classic" for="pack_nocomment">' . <p><label class="classic" for="pack_nocomment">' .
form::checkbox('pack_nocomment', 1, $this->getPreference('pack_nocomment')) . ' ' . form::checkbox('pack_nocomment', 1, $this->getSetting('pack_nocomment')) . ' ' .
__('Remove comments from files') . '</label></p> __('Remove comments from files') . '</label></p>
</div>'; </div>';
} }
public function closeModule(string $module_type, array $module_info): ?bool public function closeModule(): ?bool
{ {
$exclude = array_merge( $exclude = array_merge(
self::$exclude, self::$exclude,
explode(',', $this->getPreference('pack_excludefiles')) explode(',', $this->getSetting('pack_excludefiles'))
); );
if (!empty($this->getPreference('pack_nocomment'))) { $this->setSuccess(sprintf(__('Prepare excluded files "%s"'), implode(', ', $exclude)));
if (!empty($this->getSetting('pack_nocomment'))) {
ImproveZipFileZip::$remove_comment = true; ImproveZipFileZip::$remove_comment = true;
$this->setSuccess(__('Prepare comment removal'));
} }
if (!empty($this->getPreference('pack_filename'))) { if (!empty($this->getSetting('pack_filename'))) {
$this->zipModule($this->getPreference('pack_filename'), $exclude); $this->zipModule($this->getSetting('pack_filename'), $exclude);
} }
if (!empty($this->getPreference('secondpack_filename'))) { if (!empty($this->getSetting('secondpack_filename'))) {
$this->zipModule($this->getPreference('secondpack_filename'), $exclude); $this->zipModule($this->getSetting('secondpack_filename'), $exclude);
} }
return null; return null;
} }
@ -150,14 +152,16 @@ class ImproveActionZip extends ImproveAction
foreach($parts as $i => $part) { foreach($parts as $i => $part) {
$parts[$i] = files::tidyFileName($part); $parts[$i] = files::tidyFileName($part);
} }
$path = $this->getPreference('pack_repository') . '/' . implode('/', $parts) . '.zip'; $path = $this->getSetting('pack_repository') . '/' . implode('/', $parts) . '.zip';
if (file_exists($path) && empty($this->getPreference('pack_overwrite'))) { if (file_exists($path) && empty($this->getSetting('pack_overwrite'))) {
self::notice(__('Destination filename already exists'), false); $this->setWarning(__('Destination filename already exists'));
return null; return null;
} }
if (!is_dir(dirname($path)) || !is_writable(dirname($path))) { if (!is_dir(dirname($path)) || !is_writable(dirname($path))) {
self::notice(__('Destination path is not writable')); $this->setError(__('Destination path is not writable'));
return null;
} }
@set_time_limit(300); @set_time_limit(300);
$fp = fopen($path, 'wb'); $fp = fopen($path, 'wb');
@ -179,6 +183,8 @@ class ImproveActionZip extends ImproveAction
$zip->close(); $zip->close();
unset($zip); unset($zip);
$this->setSuccess(sprintf(__('Zip module into "%s"'), $path));
return null; return null;
} }
} }

View file

@ -72,24 +72,27 @@ if (!empty($_POST['fix'])) {
dcPage::addWarningNotice(__('No module selected')); dcPage::addWarningNotice(__('No module selected'));
} else { } else {
try { try {
$time_start = microtime(true); $time = $improve->fixModule(
$improve->fix(
$type, $type,
$module, $module,
$type == 'plugin' ? $core->plugins->getModules($module) : $core->themes->getModules($module), $type == 'plugin' ? $core->plugins->getModules($module) : $core->themes->getModules($module),
$_POST['actions'] $_POST['actions']
); );
$time_end = microtime(true); $log_id = $improve->writeLogs();
$core->blog->triggerBlog(); $core->blog->triggerBlog();
dcPage::addSuccessNotice(sprintf( if ($improve->hasLog('error')) {
__('Fix of %s complete in %s secondes'), $notice = ['type' => 'error', 'msg' => __('Fix of "%s" complete in %s secondes with errors')];
$module, } elseif ($improve->hasLog('warning')) {
substr($time_end - $time_start, 0, 5) $notice = ['type' => 'warning', 'msg' => __('Fix of "%s" complete in %s secondes with warnings')];
)); } elseif ($improve->hasLog('success')) {
$notice = ['type' => 'success', 'msg' => __('Fix of "%s" complete in %s secondes')];
} else {
$notice = ['type' => 'success', 'msg' => __('Fix of "%s" complete in %s secondes without messages')];
}
dcPage::addNotice($notice['type'], sprintf($notice['msg'], $module, $time));
http::redirect($improve->getURL(['type' => $type])); $core->adminurl->redirect('admin.plugin.improve', ['type' => $type, 'upd' => $log_id]);
} catch (Exception $e) { } catch (Exception $e) {
$core->error->add($e->getMessage()); $core->error->add($e->getMessage());
} }
@ -100,14 +103,14 @@ $breadcrumb = [];
if (!empty($_REQUEST['config'])) { if (!empty($_REQUEST['config'])) {
$breadcrumb = [ $breadcrumb = [
($type == 'plugin' ? __('Plugins') : __('Themes')) => ($type == 'plugin' ? __('Plugins') : __('Themes')) =>
$improve->getURL(['type' => ($type == 'plugin' ? 'plugin' : 'theme')]), $core->adminurl->get('admin.plugin.improve', ['type' => ($type == 'plugin' ? 'plugin' : 'theme')]),
'<span class="page-title">' . __('Configure module') . '</span>' => '' '<span class="page-title">' . __('Configure module') . '</span>' => ''
]; ];
} else { } else {
$breadcrumb = [ $breadcrumb = [
'<span class="page-title">' . ($type == 'plugin' ? __('Plugins') : __('Themes')) . '</span>' => '', '<span class="page-title">' . ($type == 'plugin' ? __('Plugins') : __('Themes')) . '</span>' => '',
($type == 'theme' ? __('Plugins') : __('Themes')) => ($type == 'theme' ? __('Plugins') : __('Themes')) =>
$improve->getURL(['type' => ($type == 'theme' ? 'plugin' : 'theme')]) $core->adminurl->get('admin.plugin.improve', ['type' => ($type == 'theme' ? 'plugin' : 'theme')])
]; ];
} }
@ -117,17 +120,17 @@ dcPage::breadcrumb(array_merge([__('improve') => ''], $breadcrumb),['hl' => fals
dcPage::notices(); dcPage::notices();
if (!empty($_REQUEST['config'])) { if (!empty($_REQUEST['config'])) {
$back_url = $_REQUEST['redir'] ?? $improve->getURL(['type' => $type]); $back_url = $_REQUEST['redir'] ?? $core->adminurl->get('admin.plugin.improve', ['type' => $type]);
if (null !== ($action = $improve->module($_REQUEST['config']))) { if (null !== ($action = $improve->module($_REQUEST['config']))) {
$redir = $_REQUEST['redir'] ?? $improve->getURL(['type' => $type, 'config' => $action->id]); $redir = $_REQUEST['redir'] ?? $core->adminurl->get('admin.plugin.improve', ['type' => $type, 'config' => $action->id]);
$res = $action->configure($redir); $res = $action->configure($redir);
echo ' echo '
<h3>' . sprintf(__('Configure module "%s"'), $action->name) . '</h3> <h3>' . sprintf(__('Configure module "%s"'), $action->name) . '</h3>
<p><a class="back" href="' . $back_url . '">' . __('Back') . '</a></p> <p><a class="back" href="' . $back_url . '">' . __('Back') . '</a></p>
<p>' . html::escapeHTML($action->desc) . '</p> <p>' . html::escapeHTML($action->desc) . '</p>
<form action="' . $improve->getURL() . '" method="post" id="form-actions">' . <form action="' . $core->adminurl->get('admin.plugin.improve') . '" method="post" id="form-actions">' .
(empty($res) ? '<p class="message">' . __('Nothing to configure'). '</p>' : $res) . ' (empty($res) ? '<p class="message">' . __('Nothing to configure'). '</p>' : $res) . '
<p class="clear"><input type="submit" name="save" value="' . __('Save') . '" />' . <p class="clear"><input type="submit" name="save" value="' . __('Save') . '" />' .
form::hidden('type', $type) . form::hidden('type', $type) .
@ -148,7 +151,7 @@ if (!empty($_REQUEST['config'])) {
if (count($combo_modules) == 1) { if (count($combo_modules) == 1) {
echo '<p class="message">' . __('No module to manage') . '</p>'; echo '<p class="message">' . __('No module to manage') . '</p>';
} else { } else {
echo '<form action="' . $improve->getURL() . '" method="post" id="form-actions">'; echo '<form action="' . $core->adminurl->get('admin.plugin.improve') . '" method="post" id="form-actions">';
foreach($improve->modules() as $action) { foreach($improve->modules() as $action) {
if (!in_array($type, $action->types)) { if (!in_array($type, $action->types)) {
continue; continue;
@ -170,7 +173,7 @@ if (!empty($_REQUEST['config'])) {
if (false !== $action->config) { if (false !== $action->config) {
echo echo
' - <a class="module-config" href="' . ' - <a class="module-config" href="' .
(true === $action->config ? $improve->getURL(['type' => $type, 'config' => $action->id]) : $action->config) . (true === $action->config ? $core->adminurl->get('admin.plugin.improve', ['type' => $type, 'config' => $action->id]) : $action->config) .
'" title="' . sprintf(__("Configure action '%s'"), $action->name) . '">' . __('Configure module') . '</a>'; '" title="' . sprintf(__("Configure action '%s'"), $action->name) . '">' . __('Configure module') . '</a>';
} }
echo '</p>'; echo '</p>';
@ -192,6 +195,32 @@ if (!empty($_REQUEST['config'])) {
</div> </div>
<br class="clear" /> <br class="clear" />
</form>'; </form>';
$logs = $lines = [];
if (!empty($_REQUEST['upd'])) {
$logs = $improve->parseLogs($_REQUEST['upd']);
if (!empty($logs)) {
echo '<div class="fieldset"><h4>' . __('Details') . '</h4>';
foreach($logs as $path => $types) {
echo '<h5>' . $path .'</h5>';
foreach($types as $type => $tools) {
echo '<div class="' . $type . '"><ul>';
foreach($tools as $tool => $msgs) {
echo '<li>' . $improve->module($tool)->name . '<ul>';
foreach($msgs as $msg) {
echo '<li>' . $msg . '</li>';
}
echo '</ul></li>';
}
echo '</ul></div>';
}
echo '';
}
echo '</div>';
}
}
} }
} }

View file

@ -1,17 +1,25 @@
<?php <?php
// Language: Français // Language: Français
// Module: improve - 0.1.1 // Module: improve - 0.1.1
// Date: 2021-09-12 21:00:21 // Date: 2021-09-14 23:23:55
// Translated with dcTranslater - 2021.09.02.1 // Translated with dcTranslater - 2021.09.02.1
#inc/class.improve.php:77 #inc/class.improve.php:142
#inc/class.improve.php:145
$GLOBALS['__l10n']['Begin'] = 'Début';
#inc/class.improve.php:150
$GLOBALS['__l10n']['Module path is not writable'] = 'Le chemin du module n\'est pas accessible en écriture'; $GLOBALS['__l10n']['Module path is not writable'] = 'Le chemin du module n\'est pas accessible en écriture';
#inc/class.improve.php:105 #inc/class.improve.php:181
$GLOBALS['__l10n']['File content has been removed: %s by %s'] = 'Le contenu du fichier a été supprimé : %s par %s'; $GLOBALS['__l10n']['File content has been removed: %s by %s'] = 'Le contenu du fichier a été supprimé : %s par %s';
#inc/class.improve.php:196
#inc/class.improve.php:198
$GLOBALS['__l10n']['End'] = 'Fin';
#inc/lib.improve.action.dcstore.php:20 #inc/lib.improve.action.dcstore.php:20
$GLOBALS['__l10n']['Fix dcstore.xml'] = 'Fixer dcstore.xml'; $GLOBALS['__l10n']['Store file'] = 'Fichier de dépôt';
#inc/lib.improve.action.dcstore.php:21 #inc/lib.improve.action.dcstore.php:21
$GLOBALS['__l10n']['Re-create dcstore.xml file according to _define.php variables'] = 'Re-créer le fichier dcstore.xml suivant les variables du fichier _define.php'; $GLOBALS['__l10n']['Re-create dcstore.xml file according to _define.php variables'] = 'Re-créer le fichier dcstore.xml suivant les variables du fichier _define.php';
@ -32,41 +40,44 @@ $GLOBALS['__l10n']['For exemple on github https://github.com/MyGitName/%id%/rele
#inc/lib.improve.action.dcstore.php:53 #inc/lib.improve.action.dcstore.php:53
$GLOBALS['__l10n']['Note on github, you must create a release and join to it the module zip file.'] = 'Note sur Github, vous devez créer un release et y joindre le fichier zip du module.'; $GLOBALS['__l10n']['Note on github, you must create a release and join to it the module zip file.'] = 'Note sur Github, vous devez créer un release et y joindre le fichier zip du module.';
#inc/lib.improve.action.dcstore.php:70 #inc/lib.improve.action.dcstore.php:65
$GLOBALS['__l10n']['Write dcstore.xml file.'] = 'Ecrire le fichier dcstore.xml';
#inc/lib.improve.action.dcstore.php:67
$GLOBALS['__l10n']['Failed to write dcstore.xml file'] = 'Impossible d\'écrire le fichier dcstore.xml'; $GLOBALS['__l10n']['Failed to write dcstore.xml file'] = 'Impossible d\'écrire le fichier dcstore.xml';
#inc/lib.improve.action.dcstore.php:88 #inc/lib.improve.action.dcstore.php:81
$GLOBALS['__l10n']['unkow module id'] = 'Id du module inconu'; $GLOBALS['__l10n']['unkow module id'] = 'Id du module inconu';
#inc/lib.improve.action.dcstore.php:94 #inc/lib.improve.action.dcstore.php:87
$GLOBALS['__l10n']['unknow module name'] = 'nom du module inconnu'; $GLOBALS['__l10n']['unknow module name'] = 'nom du module inconnu';
#inc/lib.improve.action.dcstore.php:100 #inc/lib.improve.action.dcstore.php:93
$GLOBALS['__l10n']['unknow module version'] = 'version du module inconnue'; $GLOBALS['__l10n']['unknow module version'] = 'version du module inconnue';
#inc/lib.improve.action.dcstore.php:106 #inc/lib.improve.action.dcstore.php:99
$GLOBALS['__l10n']['unknow module author'] = 'auteur du module inconnu'; $GLOBALS['__l10n']['unknow module author'] = 'auteur du module inconnu';
#inc/lib.improve.action.dcstore.php:113 #inc/lib.improve.action.dcstore.php:106
$GLOBALS['__l10n']['unknow module description'] = 'description du module inconnue'; $GLOBALS['__l10n']['unknow module description'] = 'description du module inconnue';
#inc/lib.improve.action.dcstore.php:119 #inc/lib.improve.action.dcstore.php:112
$GLOBALS['__l10n']['no repository set in _define.php'] = 'Aucun dépôt défini dans le fichier _define.php'; $GLOBALS['__l10n']['no repository set in _define.php'] = 'Aucun dépôt défini dans le fichier _define.php';
#inc/lib.improve.action.dcstore.php:125 #inc/lib.improve.action.dcstore.php:118
$GLOBALS['__l10n']['no zip file pattern set in configuration'] = 'Pas de modèle de fichier zip présent dans la configuration'; $GLOBALS['__l10n']['no zip file pattern set in configuration'] = 'Pas de modèle de fichier zip présent dans la configuration';
#inc/lib.improve.action.dcstore.php:142 #inc/lib.improve.action.dcstore.php:135
$GLOBALS['__l10n']['no minimum dotclear version'] = 'pas de version minimum de Dotclear'; $GLOBALS['__l10n']['no minimum dotclear version'] = 'pas de version minimum de Dotclear';
#inc/lib.improve.action.dcstore.php:149 #inc/lib.improve.action.dcstore.php:142
$GLOBALS['__l10n']['no details URL'] = 'Lien de détail non défini'; $GLOBALS['__l10n']['no details URL'] = 'Lien de détail non défini';
#inc/lib.improve.action.dcstore.php:162 #inc/lib.improve.action.dcstore.php:155
$GLOBALS['__l10n']['no support URL'] = 'Lien de support non défini'; $GLOBALS['__l10n']['no support URL'] = 'Lien de support non défini';
#inc/lib.improve.action.gitshields.php:34 #inc/lib.improve.action.gitshields.php:34
$GLOBALS['__l10n']['Fix shields badges'] = 'Fixer les badges shields.io'; $GLOBALS['__l10n']['Shields badges'] = 'Badges Shields.io';
#inc/lib.improve.action.gitshields.php:35 #inc/lib.improve.action.gitshields.php:35
$GLOBALS['__l10n']['Add and maintain shields.io badges to the REDAME.md file'] = 'Ajoute et maintient à jour les badges shields.io du fichier README.md'; $GLOBALS['__l10n']['Add and maintain shields.io badges to the REDAME.md file'] = 'Ajoute et maintient à jour les badges shields.io du fichier README.md';
@ -86,8 +97,17 @@ $GLOBALS['__l10n']['Include Dotaddict badge'] = 'Inclure le badge Dotaddict';
#inc/lib.improve.action.gitshields.php:68 #inc/lib.improve.action.gitshields.php:68
$GLOBALS['__l10n']['If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.'] = 'Si votre plugin ou theme est sur Dotaddict, vous pouvez ajouter un badge lier à ses détails sur DA.'; $GLOBALS['__l10n']['If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.'] = 'Si votre plugin ou theme est sur Dotaddict, vous pouvez ajouter un badge lier à ses détails sur DA.';
#inc/lib.improve.action.gitshields.php:117
$GLOBALS['__l10n']['Prepare custom shield info'] = 'préparer les informations personnalisées';
#inc/lib.improve.action.gitshields.php:147
$GLOBALS['__l10n']['Write new shield bloc'] = 'Ecrire le nouveau bloc Shield';
#inc/lib.improve.action.gitshields.php:162
$GLOBALS['__l10n']['Delete old shield bloc'] = 'Effacer l\'ancine bloc Shield';
#inc/lib.improve.action.licensefile.php:29 #inc/lib.improve.action.licensefile.php:29
$GLOBALS['__l10n']['Fix license file'] = 'Fixer le fichier de licence'; $GLOBALS['__l10n']['License file'] = 'Fichier de licence';
#inc/lib.improve.action.licensefile.php:30 #inc/lib.improve.action.licensefile.php:30
$GLOBALS['__l10n']['Add or remove full license file to module root'] = 'Ajoute ou supprime le fichier de licence'; $GLOBALS['__l10n']['Add or remove full license file to module root'] = 'Ajoute ou supprime le fichier de licence';
@ -117,53 +137,68 @@ $GLOBALS['__l10n']['License version:'] = 'Version de la licence :';
#inc/lib.improve.action.licensefile.php:72 #inc/lib.improve.action.licensefile.php:72
$GLOBALS['__l10n']['Action on file:'] = 'Action sur le fichier :'; $GLOBALS['__l10n']['Action on file:'] = 'Action sur le fichier :';
#inc/lib.improve.action.licensefile.php:87 #inc/lib.improve.action.licensefile.php:84
$GLOBALS['__l10n']['no full license type selected'] = 'Aucun type de licence sélectionné'; $GLOBALS['__l10n']['No full license type selected'] = 'Pas de type de licence seletionné';
#inc/lib.improve.action.licensefile.php:100 #inc/lib.improve.action.licensefile.php:97
$GLOBALS['__l10n']['failed to load full license'] = 'Impossible de charger le fichier de licence'; $GLOBALS['__l10n']['Failed to load license content'] = 'Impossible de charger le contenu de la licence';
#inc/lib.improve.action.licensefile.php:106 #inc/lib.improve.action.licensefile.php:102
$GLOBALS['__l10n']['failed to write full license'] = 'Impossible d\'écrire le fichier de license'; $GLOBALS['__l10n']['Write new license file "LICENSE"'] = 'Écrire le nouveau fichier "LICENSE" de licence';
#inc/lib.improve.action.licensefile.php:104
$GLOBALS['__l10n']['Failed to write new license file'] = 'Impossible d\'écrire le nouveau fichier de licence';
#inc/lib.improve.action.licensefile.php:118
$GLOBALS['__l10n']['Old license file is not deletable (%s)'] = 'L\'ancien fichier de licence n\'est pas supprimable (%s)';
#inc/lib.improve.action.licensefile.php:120 #inc/lib.improve.action.licensefile.php:120
$GLOBALS['__l10n']['full license is not deletable (%s)'] = 'Le fichier de licence n\'est pas supprimable (%s)'; $GLOBALS['__l10n']['Failed to delete old license file (%s)'] = 'Impossible de supprimer l\'ancien fichier de licence (%s)';
#inc/lib.improve.action.licensefile.php:123 #inc/lib.improve.action.licensefile.php:122
$GLOBALS['__l10n']['failed to delete full license (%s)'] = 'Impossible de supprimer le fichier de licence (%s)'; $GLOBALS['__l10n']['Delete old license file "%s"'] = 'Effacer l\'ancien fichier de Licence "%s"';
#inc/lib.improve.action.php:20 #inc/lib.improve.action.php:20
$GLOBALS['__l10n']['Fix tabulation'] = 'Fixer les tabulations'; $GLOBALS['__l10n']['Tabulations'] = 'Tabulations';
#inc/lib.improve.action.php:21 #inc/lib.improve.action.php:21
$GLOBALS['__l10n']['Replace tabulation by four space in php files'] = 'Remplace les tabulation par quatre espaces dans les fichiers php'; $GLOBALS['__l10n']['Replace tabulation by four space in php files'] = 'Remplace les tabulation par quatre espaces dans les fichiers php';
#inc/lib.improve.action.php:53 #inc/lib.improve.action.php:36
$GLOBALS['__l10n']['Fix newline'] = 'Fixer les retours à la ligne'; $GLOBALS['__l10n']['Replace tabulation by spaces'] = 'Remplacer les tabulations';
#inc/lib.improve.action.php:54 #inc/lib.improve.action.php:57
$GLOBALS['__l10n']['Newlines'] = 'Retour à la ligne';
#inc/lib.improve.action.php:58
$GLOBALS['__l10n']['Replace bad and repetitive and empty newline by single newline in files'] = 'Remplace les mauvais ou répétitifs retour à la ligne par une seule nouvelle ligne'; $GLOBALS['__l10n']['Replace bad and repetitive and empty newline by single newline in files'] = 'Remplace les mauvais ou répétitifs retour à la ligne par une seule nouvelle ligne';
#inc/lib.improve.action.php:91 #inc/lib.improve.action.php:95
$GLOBALS['__l10n']['List of files extension to work on:'] = 'Liste des extensions de fichier à corriger:'; $GLOBALS['__l10n']['List of files extension to work on:'] = 'Liste des extensions de fichier à corriger:';
#inc/lib.improve.action.php:94 #inc/lib.improve.action.php:98
$GLOBALS['__l10n']['Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".'] = 'Utiliser une liste d\'extensions séparé par des virgules et sans le point, recommandation: "php,js,xml,txt,md".'; $GLOBALS['__l10n']['Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".'] = 'Utiliser une liste d\'extensions séparé par des virgules et sans le point, recommandation: "php,js,xml,txt,md".';
#inc/lib.improve.action.php:128 #inc/lib.improve.action.php:122
$GLOBALS['__l10n']['Fix end of file'] = 'Fixer les fins de fichiers'; $GLOBALS['__l10n']['Replace bad new lines'] = 'Remplacer les retours à la ligne';
#inc/lib.improve.action.php:129 #inc/lib.improve.action.php:138
$GLOBALS['__l10n']['Remove php tag and empty lines from end of files'] = 'Supprimer le tag PHP et els lignes vides de fin de fichiers'; $GLOBALS['__l10n']['End of files'] = 'Fin de fichiers';
#inc/lib.improve.action.php:153 #inc/lib.improve.action.php:139
$GLOBALS['__l10n']['Remove php tag and empty lines from end of files'] = 'Supprimer le tag PHP et les lignes vides de fin de fichiers';
#inc/lib.improve.action.php:163
$GLOBALS['__l10n']['Add a blank line to the end of file'] = 'Ajouter une ligne vide en fin de fichier'; $GLOBALS['__l10n']['Add a blank line to the end of file'] = 'Ajouter une ligne vide en fin de fichier';
#inc/lib.improve.action.php:155 #inc/lib.improve.action.php:165
$GLOBALS['__l10n']['PSR2 must have a blank line, whereas PSR12 must not.'] = 'PSR2 doit avoir une ligne vide, alors que PSR12 non.'; $GLOBALS['__l10n']['PSR2 must have a blank line, whereas PSR12 must not.'] = 'PSR2 doit avoir une ligne vide, alors que PSR12 non.';
#inc/lib.improve.action.php:180
$GLOBALS['__l10n']['Replace end of file'] = 'Remplacer les fins de fichiers';
#inc/lib.improve.action.phpheader.php:47 #inc/lib.improve.action.phpheader.php:47
$GLOBALS['__l10n']['Fix PHP header'] = 'Fixer les enêtes php'; $GLOBALS['__l10n']['PHP header'] = 'Entête de fichier PHP';
#inc/lib.improve.action.phpheader.php:48 #inc/lib.improve.action.phpheader.php:48
$GLOBALS['__l10n']['Add or remove phpdoc header bloc from php file'] = 'Ajouter ou supprimer les bloc d\'entête phpdoc des fichiers php'; $GLOBALS['__l10n']['Add or remove phpdoc header bloc from php file'] = 'Ajouter ou supprimer les bloc d\'entête phpdoc des fichiers php';
@ -195,11 +230,26 @@ $GLOBALS['__l10n']['Bloc content:'] = 'Contenu du bloc :';
#inc/lib.improve.action.phpheader.php:104 #inc/lib.improve.action.phpheader.php:104
$GLOBALS['__l10n']['Do not put structural elements to the begining of lines.'] = 'Ne pas mettre d\'élément de structure en début de ligne'; $GLOBALS['__l10n']['Do not put structural elements to the begining of lines.'] = 'Ne pas mettre d\'élément de structure en début de ligne';
#inc/lib.improve.action.phpheader.php:165 #inc/lib.improve.action.phpheader.php:121
$GLOBALS['__l10n']['Skip directory'] = 'Ignorer le répertoire';
#inc/lib.improve.action.phpheader.php:167
$GLOBALS['__l10n']['bloc is empty'] = 'le bloc est vide'; $GLOBALS['__l10n']['bloc is empty'] = 'le bloc est vide';
#inc/lib.improve.action.phpheader.php:194 #inc/lib.improve.action.phpheader.php:195
$GLOBALS['__l10n']['failed to parse bloc'] = 'impossible de traiter le bloc'; $GLOBALS['__l10n']['Prepare header info'] = 'Préparer les informations d\'entête';
#inc/lib.improve.action.phpheader.php:197
$GLOBALS['__l10n']['Failed to parse bloc'] = 'Impossible de préparer le bloc';
#inc/lib.improve.action.phpheader.php:213
$GLOBALS['__l10n']['Write new doc bloc content'] = 'Ecrire le nouveau contenu de bloc';
#inc/lib.improve.action.phpheader.php:228
$GLOBALS['__l10n']['Delete old doc bloc content'] = 'Effacer l\'ancien contenu de type phpdoc';
#inc/lib.improve.action.phpheader.php:243
$GLOBALS['__l10n']['Delete old style bloc content'] = 'Effacer l\'ancien contenu de type ancien';
#inc/lib.improve.action.zip.php:42 #inc/lib.improve.action.zip.php:42
$GLOBALS['__l10n']['Zip module'] = 'Zipper le module'; $GLOBALS['__l10n']['Zip module'] = 'Zipper le module';
@ -243,12 +293,21 @@ $GLOBALS['__l10n']['By default all these files are always removed from packages
#inc/lib.improve.action.zip.php:113 #inc/lib.improve.action.zip.php:113
$GLOBALS['__l10n']['Remove comments from files'] = 'Retirer les commentaires des fichiers'; $GLOBALS['__l10n']['Remove comments from files'] = 'Retirer les commentaires des fichiers';
#inc/lib.improve.action.zip.php:155 #inc/lib.improve.action.zip.php:124
$GLOBALS['__l10n']['Prepare excluded files "%s"'] = 'Préparer les fichiers à exclure "%s"';
#inc/lib.improve.action.zip.php:127
$GLOBALS['__l10n']['Prepare comment removal'] = 'Préparer le retrait des commentaires';
#inc/lib.improve.action.zip.php:157
$GLOBALS['__l10n']['Destination filename already exists'] = 'Le fichier de destination existe déjà'; $GLOBALS['__l10n']['Destination filename already exists'] = 'Le fichier de destination existe déjà';
#inc/lib.improve.action.zip.php:160 #inc/lib.improve.action.zip.php:162
$GLOBALS['__l10n']['Destination path is not writable'] = 'Le répertoire de destination n\'est pas accessible en écriture'; $GLOBALS['__l10n']['Destination path is not writable'] = 'Le répertoire de destination n\'est pas accessible en écriture';
#inc/lib.improve.action.zip.php:186
$GLOBALS['__l10n']['Zip module into "%s"'] = 'Zipper le module vers "%s"';
#index.php:54 #index.php:54
$GLOBALS['__l10n']['Select a module'] = 'Sélectionner un module'; $GLOBALS['__l10n']['Select a module'] = 'Sélectionner un module';
@ -258,40 +317,48 @@ $GLOBALS['__l10n']['No action selected'] = 'Aucune action sélectionné';
#index.php:72 #index.php:72
$GLOBALS['__l10n']['No module selected'] = 'Aucun module sélectionné'; $GLOBALS['__l10n']['No module selected'] = 'Aucun module sélectionné';
#index.php:87 #index.php:85
$GLOBALS['__l10n']['Fix of %s complete in %s secondes'] = 'Correction de %s complété en %s secondes'; $GLOBALS['__l10n']['Fix of "%s" complete in %s secondes with errors'] = 'Fixe de "%s" complété en %s secondes avec des erreurs';
#index.php:102 #index.php:87
#index.php:108 $GLOBALS['__l10n']['Fix of "%s" complete in %s secondes with warnings'] = 'Fixe de "%s" complété en %s secondes avec des avertissements';
#index.php:109
#index.php:146 #index.php:89
$GLOBALS['__l10n']['Fix of "%s" complete in %s secondes'] = 'Fixe de "%s" complété en %s secondes';
#index.php:91
$GLOBALS['__l10n']['Fix of "%s" complete in %s secondes without messages'] = 'Fixe de "%s" complété en %s secondes sans message';
#index.php:105
#index.php:111
#index.php:112
#index.php:149
$GLOBALS['__l10n']['Themes'] = 'Thèmes'; $GLOBALS['__l10n']['Themes'] = 'Thèmes';
#index.php:104 #index.php:107
#index.php:174 #index.php:177
$GLOBALS['__l10n']['Configure module'] = 'Configurer le module'; $GLOBALS['__l10n']['Configure module'] = 'Configurer le module';
#index.php:127 #index.php:130
$GLOBALS['__l10n']['Configure module "%s"'] = 'Configurer le module "%s"'; $GLOBALS['__l10n']['Configure module "%s"'] = 'Configurer le module "%s"';
#index.php:131 #index.php:134
$GLOBALS['__l10n']['Nothing to configure'] = 'Rien à configurer'; $GLOBALS['__l10n']['Nothing to configure'] = 'Rien à configurer';
#index.php:140 #index.php:143
$GLOBALS['__l10n']['Unknow module'] = 'Module inconnu'; $GLOBALS['__l10n']['Unknow module'] = 'Module inconnu';
#index.php:149 #index.php:152
$GLOBALS['__l10n']['No module to manage'] = 'Aucun module à gérer'; $GLOBALS['__l10n']['No module to manage'] = 'Aucun module à gérer';
#index.php:174 #index.php:177
$GLOBALS['__l10n']['Configure action \'%s\''] = 'Configurer l\'action "%s"'; $GLOBALS['__l10n']['Configure action \'%s\''] = 'Configurer l\'action "%s"';
#index.php:184 #index.php:187
$GLOBALS['__l10n']['Save fields selection as preference'] = 'Enregistrer la sélection comme préférence'; $GLOBALS['__l10n']['Save fields selection as preference'] = 'Enregistrer la sélection comme préférence';
#index.php:185 #index.php:188
$GLOBALS['__l10n']['Select a module:'] = 'Sélectionner un module :'; $GLOBALS['__l10n']['Select a module:'] = 'Sélectionner un module :';
#index.php:188 #index.php:191
$GLOBALS['__l10n']['Fix it'] = 'Corriger'; $GLOBALS['__l10n']['Fix it'] = 'Corriger';

View file

@ -1,6 +1,6 @@
# Language: Français # Language: Français
# Module: improve - 0.1.1 # Module: improve - 0.1.1
# Date: 2021-09-12 21:00:21 # Date: 2021-09-14 23:23:55
# Translated with translater 2021.09.02.1 # Translated with translater 2021.09.02.1
msgid "" msgid ""
@ -8,24 +8,34 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: improve 0.1.1\n" "Project-Id-Version: improve 0.1.1\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2021-09-12T21:00:21+00:00\n" "PO-Revision-Date: 2021-09-14T23:23:55+00:00\n"
"Last-Translator: Jean-Christian Denis\n" "Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: inc/class.improve.php:77 #: inc/class.improve.php:142
#: inc/class.improve.php:145
msgid "Begin"
msgstr "Début"
#: inc/class.improve.php:150
msgid "Module path is not writable" msgid "Module path is not writable"
msgstr "Le chemin du module n'est pas accessible en écriture" msgstr "Le chemin du module n'est pas accessible en écriture"
#: inc/class.improve.php:105 #: inc/class.improve.php:181
msgid "File content has been removed: %s by %s" msgid "File content has been removed: %s by %s"
msgstr "Le contenu du fichier a été supprimé : %s par %s" msgstr "Le contenu du fichier a été supprimé : %s par %s"
#: inc/class.improve.php:196
#: inc/class.improve.php:198
msgid "End"
msgstr "Fin"
#: inc/lib.improve.action.dcstore.php:20 #: inc/lib.improve.action.dcstore.php:20
msgid "Fix dcstore.xml" msgid "Store file"
msgstr "Fixer dcstore.xml" msgstr "Fichier de dépôt"
#: inc/lib.improve.action.dcstore.php:21 #: inc/lib.improve.action.dcstore.php:21
msgid "Re-create dcstore.xml file according to _define.php variables" msgid "Re-create dcstore.xml file according to _define.php variables"
@ -52,53 +62,57 @@ msgstr "Par exemple sur github https://github.com/MyGitName/%id%/releases/downlo
msgid "Note on github, you must create a release and join to it the module zip file." msgid "Note on github, you must create a release and join to it the module zip file."
msgstr "Note sur Github, vous devez créer un release et y joindre le fichier zip du module." msgstr "Note sur Github, vous devez créer un release et y joindre le fichier zip du module."
#: inc/lib.improve.action.dcstore.php:70 #: inc/lib.improve.action.dcstore.php:65
msgid "Write dcstore.xml file."
msgstr "Ecrire le fichier dcstore.xml"
#: inc/lib.improve.action.dcstore.php:67
msgid "Failed to write dcstore.xml file" msgid "Failed to write dcstore.xml file"
msgstr "Impossible d'écrire le fichier dcstore.xml" msgstr "Impossible d'écrire le fichier dcstore.xml"
#: inc/lib.improve.action.dcstore.php:88 #: inc/lib.improve.action.dcstore.php:81
msgid "unkow module id" msgid "unkow module id"
msgstr "Id du module inconu" msgstr "Id du module inconu"
#: inc/lib.improve.action.dcstore.php:94 #: inc/lib.improve.action.dcstore.php:87
msgid "unknow module name" msgid "unknow module name"
msgstr "nom du module inconnu" msgstr "nom du module inconnu"
#: inc/lib.improve.action.dcstore.php:100 #: inc/lib.improve.action.dcstore.php:93
msgid "unknow module version" msgid "unknow module version"
msgstr "version du module inconnue" msgstr "version du module inconnue"
#: inc/lib.improve.action.dcstore.php:106 #: inc/lib.improve.action.dcstore.php:99
msgid "unknow module author" msgid "unknow module author"
msgstr "auteur du module inconnu" msgstr "auteur du module inconnu"
#: inc/lib.improve.action.dcstore.php:113 #: inc/lib.improve.action.dcstore.php:106
msgid "unknow module description" msgid "unknow module description"
msgstr "description du module inconnue" msgstr "description du module inconnue"
#: inc/lib.improve.action.dcstore.php:119 #: inc/lib.improve.action.dcstore.php:112
msgid "no repository set in _define.php" msgid "no repository set in _define.php"
msgstr "Aucun dépôt défini dans le fichier _define.php" msgstr "Aucun dépôt défini dans le fichier _define.php"
#: inc/lib.improve.action.dcstore.php:125 #: inc/lib.improve.action.dcstore.php:118
msgid "no zip file pattern set in configuration" msgid "no zip file pattern set in configuration"
msgstr "Pas de modèle de fichier zip présent dans la configuration" msgstr "Pas de modèle de fichier zip présent dans la configuration"
#: inc/lib.improve.action.dcstore.php:142 #: inc/lib.improve.action.dcstore.php:135
msgid "no minimum dotclear version" msgid "no minimum dotclear version"
msgstr "pas de version minimum de Dotclear" msgstr "pas de version minimum de Dotclear"
#: inc/lib.improve.action.dcstore.php:149 #: inc/lib.improve.action.dcstore.php:142
msgid "no details URL" msgid "no details URL"
msgstr "Lien de détail non défini" msgstr "Lien de détail non défini"
#: inc/lib.improve.action.dcstore.php:162 #: inc/lib.improve.action.dcstore.php:155
msgid "no support URL" msgid "no support URL"
msgstr "Lien de support non défini" msgstr "Lien de support non défini"
#: inc/lib.improve.action.gitshields.php:34 #: inc/lib.improve.action.gitshields.php:34
msgid "Fix shields badges" msgid "Shields badges"
msgstr "Fixer les badges shields.io" msgstr "Badges Shields.io"
#: inc/lib.improve.action.gitshields.php:35 #: inc/lib.improve.action.gitshields.php:35
msgid "Add and maintain shields.io badges to the REDAME.md file" msgid "Add and maintain shields.io badges to the REDAME.md file"
@ -124,9 +138,21 @@ msgstr "Inclure le badge Dotaddict"
msgid "If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict." msgid "If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict."
msgstr "Si votre plugin ou theme est sur Dotaddict, vous pouvez ajouter un badge lier à ses détails sur DA." msgstr "Si votre plugin ou theme est sur Dotaddict, vous pouvez ajouter un badge lier à ses détails sur DA."
#: inc/lib.improve.action.gitshields.php:117
msgid "Prepare custom shield info"
msgstr "préparer les informations personnalisées"
#: inc/lib.improve.action.gitshields.php:147
msgid "Write new shield bloc"
msgstr "Ecrire le nouveau bloc Shield"
#: inc/lib.improve.action.gitshields.php:162
msgid "Delete old shield bloc"
msgstr "Effacer l'ancine bloc Shield"
#: inc/lib.improve.action.licensefile.php:29 #: inc/lib.improve.action.licensefile.php:29
msgid "Fix license file" msgid "License file"
msgstr "Fixer le fichier de licence" msgstr "Fichier de licence"
#: inc/lib.improve.action.licensefile.php:30 #: inc/lib.improve.action.licensefile.php:30
msgid "Add or remove full license file to module root" msgid "Add or remove full license file to module root"
@ -165,69 +191,89 @@ msgstr "Version de la licence :"
msgid "Action on file:" msgid "Action on file:"
msgstr "Action sur le fichier :" msgstr "Action sur le fichier :"
#: inc/lib.improve.action.licensefile.php:87 #: inc/lib.improve.action.licensefile.php:84
msgid "no full license type selected" msgid "No full license type selected"
msgstr "Aucun type de licence sélectionné" msgstr "Pas de type de licence seletionné"
#: inc/lib.improve.action.licensefile.php:100 #: inc/lib.improve.action.licensefile.php:97
msgid "failed to load full license" msgid "Failed to load license content"
msgstr "Impossible de charger le fichier de licence" msgstr "Impossible de charger le contenu de la licence"
#: inc/lib.improve.action.licensefile.php:106 #: inc/lib.improve.action.licensefile.php:102
msgid "failed to write full license" msgid "Write new license file \"LICENSE\""
msgstr "Impossible d'écrire le fichier de license" msgstr "Écrire le nouveau fichier \"LICENSE\" de licence"
#: inc/lib.improve.action.licensefile.php:104
msgid "Failed to write new license file"
msgstr "Impossible d'écrire le nouveau fichier de licence"
#: inc/lib.improve.action.licensefile.php:118
msgid "Old license file is not deletable (%s)"
msgstr "L'ancien fichier de licence n'est pas supprimable (%s)"
#: inc/lib.improve.action.licensefile.php:120 #: inc/lib.improve.action.licensefile.php:120
msgid "full license is not deletable (%s)" msgid "Failed to delete old license file (%s)"
msgstr "Le fichier de licence n'est pas supprimable (%s)" msgstr "Impossible de supprimer l'ancien fichier de licence (%s)"
#: inc/lib.improve.action.licensefile.php:123 #: inc/lib.improve.action.licensefile.php:122
msgid "failed to delete full license (%s)" msgid "Delete old license file \"%s\""
msgstr "Impossible de supprimer le fichier de licence (%s)" msgstr "Effacer l'ancien fichier de Licence \"%s\""
#: inc/lib.improve.action.php:20 #: inc/lib.improve.action.php:20
msgid "Fix tabulation" msgid "Tabulations"
msgstr "Fixer les tabulations" msgstr "Tabulations"
#: inc/lib.improve.action.php:21 #: inc/lib.improve.action.php:21
msgid "Replace tabulation by four space in php files" msgid "Replace tabulation by four space in php files"
msgstr "Remplace les tabulation par quatre espaces dans les fichiers php" msgstr "Remplace les tabulation par quatre espaces dans les fichiers php"
#: inc/lib.improve.action.php:53 #: inc/lib.improve.action.php:36
msgid "Fix newline" msgid "Replace tabulation by spaces"
msgstr "Fixer les retours à la ligne" msgstr "Remplacer les tabulations"
#: inc/lib.improve.action.php:54 #: inc/lib.improve.action.php:57
msgid "Newlines"
msgstr "Retour à la ligne"
#: inc/lib.improve.action.php:58
msgid "Replace bad and repetitive and empty newline by single newline in files" msgid "Replace bad and repetitive and empty newline by single newline in files"
msgstr "Remplace les mauvais ou répétitifs retour à la ligne par une seule nouvelle ligne" msgstr "Remplace les mauvais ou répétitifs retour à la ligne par une seule nouvelle ligne"
#: inc/lib.improve.action.php:91 #: inc/lib.improve.action.php:95
msgid "List of files extension to work on:" msgid "List of files extension to work on:"
msgstr "Liste des extensions de fichier à corriger:" msgstr "Liste des extensions de fichier à corriger:"
#: inc/lib.improve.action.php:94 #: inc/lib.improve.action.php:98
msgid "Use comma separated list of extensions without dot, recommand \"php,js,xml,txt,md\"." msgid "Use comma separated list of extensions without dot, recommand \"php,js,xml,txt,md\"."
msgstr "Utiliser une liste d'extensions séparé par des virgules et sans le point, recommandation: \"php,js,xml,txt,md\"." msgstr "Utiliser une liste d'extensions séparé par des virgules et sans le point, recommandation: \"php,js,xml,txt,md\"."
#: inc/lib.improve.action.php:128 #: inc/lib.improve.action.php:122
msgid "Fix end of file" msgid "Replace bad new lines"
msgstr "Fixer les fins de fichiers" msgstr "Remplacer les retours à la ligne"
#: inc/lib.improve.action.php:129 #: inc/lib.improve.action.php:138
msgid "End of files"
msgstr "Fin de fichiers"
#: inc/lib.improve.action.php:139
msgid "Remove php tag and empty lines from end of files" msgid "Remove php tag and empty lines from end of files"
msgstr "Supprimer le tag PHP et els lignes vides de fin de fichiers" msgstr "Supprimer le tag PHP et les lignes vides de fin de fichiers"
#: inc/lib.improve.action.php:153 #: inc/lib.improve.action.php:163
msgid "Add a blank line to the end of file" msgid "Add a blank line to the end of file"
msgstr "Ajouter une ligne vide en fin de fichier" msgstr "Ajouter une ligne vide en fin de fichier"
#: inc/lib.improve.action.php:155 #: inc/lib.improve.action.php:165
msgid "PSR2 must have a blank line, whereas PSR12 must not." msgid "PSR2 must have a blank line, whereas PSR12 must not."
msgstr "PSR2 doit avoir une ligne vide, alors que PSR12 non." msgstr "PSR2 doit avoir une ligne vide, alors que PSR12 non."
#: inc/lib.improve.action.php:180
msgid "Replace end of file"
msgstr "Remplacer les fins de fichiers"
#: inc/lib.improve.action.phpheader.php:47 #: inc/lib.improve.action.phpheader.php:47
msgid "Fix PHP header" msgid "PHP header"
msgstr "Fixer les enêtes php" msgstr "Entête de fichier PHP"
#: inc/lib.improve.action.phpheader.php:48 #: inc/lib.improve.action.phpheader.php:48
msgid "Add or remove phpdoc header bloc from php file" msgid "Add or remove phpdoc header bloc from php file"
@ -269,13 +315,33 @@ msgstr "Contenu du bloc :"
msgid "Do not put structural elements to the begining of lines." msgid "Do not put structural elements to the begining of lines."
msgstr "Ne pas mettre d'élément de structure en début de ligne" msgstr "Ne pas mettre d'élément de structure en début de ligne"
#: inc/lib.improve.action.phpheader.php:165 #: inc/lib.improve.action.phpheader.php:121
msgid "Skip directory"
msgstr "Ignorer le répertoire"
#: inc/lib.improve.action.phpheader.php:167
msgid "bloc is empty" msgid "bloc is empty"
msgstr "le bloc est vide" msgstr "le bloc est vide"
#: inc/lib.improve.action.phpheader.php:194 #: inc/lib.improve.action.phpheader.php:195
msgid "failed to parse bloc" msgid "Prepare header info"
msgstr "impossible de traiter le bloc" msgstr "Préparer les informations d'entête"
#: inc/lib.improve.action.phpheader.php:197
msgid "Failed to parse bloc"
msgstr "Impossible de préparer le bloc"
#: inc/lib.improve.action.phpheader.php:213
msgid "Write new doc bloc content"
msgstr "Ecrire le nouveau contenu de bloc"
#: inc/lib.improve.action.phpheader.php:228
msgid "Delete old doc bloc content"
msgstr "Effacer l'ancien contenu de type phpdoc"
#: inc/lib.improve.action.phpheader.php:243
msgid "Delete old style bloc content"
msgstr "Effacer l'ancien contenu de type ancien"
#: inc/lib.improve.action.zip.php:42 #: inc/lib.improve.action.zip.php:42
msgid "Zip module" msgid "Zip module"
@ -332,14 +398,26 @@ msgstr "Pas défaut tous ces fichiers sont toujours exclu des paquetages : %s"
msgid "Remove comments from files" msgid "Remove comments from files"
msgstr "Retirer les commentaires des fichiers" msgstr "Retirer les commentaires des fichiers"
#: inc/lib.improve.action.zip.php:155 #: inc/lib.improve.action.zip.php:124
msgid "Prepare excluded files \"%s\""
msgstr "Préparer les fichiers à exclure \"%s\""
#: inc/lib.improve.action.zip.php:127
msgid "Prepare comment removal"
msgstr "Préparer le retrait des commentaires"
#: inc/lib.improve.action.zip.php:157
msgid "Destination filename already exists" msgid "Destination filename already exists"
msgstr "Le fichier de destination existe déjà" msgstr "Le fichier de destination existe déjà"
#: inc/lib.improve.action.zip.php:160 #: inc/lib.improve.action.zip.php:162
msgid "Destination path is not writable" msgid "Destination path is not writable"
msgstr "Le répertoire de destination n'est pas accessible en écriture" msgstr "Le répertoire de destination n'est pas accessible en écriture"
#: inc/lib.improve.action.zip.php:186
msgid "Zip module into \"%s\""
msgstr "Zipper le module vers \"%s\""
#: index.php:54 #: index.php:54
msgid "Select a module" msgid "Select a module"
msgstr "Sélectionner un module" msgstr "Sélectionner un module"
@ -352,51 +430,63 @@ msgstr "Aucune action sélectionné"
msgid "No module selected" msgid "No module selected"
msgstr "Aucun module sélectionné" msgstr "Aucun module sélectionné"
#: index.php:87 #: index.php:85
msgid "Fix of %s complete in %s secondes" msgid "Fix of \"%s\" complete in %s secondes with errors"
msgstr "Correction de %s complété en %s secondes" msgstr "Fixe de \"%s\" complété en %s secondes avec des erreurs"
#: index.php:102 #: index.php:87
#: index.php:108 msgid "Fix of \"%s\" complete in %s secondes with warnings"
#: index.php:109 msgstr "Fixe de \"%s\" complété en %s secondes avec des avertissements"
#: index.php:146
#: index.php:89
msgid "Fix of \"%s\" complete in %s secondes"
msgstr "Fixe de \"%s\" complété en %s secondes"
#: index.php:91
msgid "Fix of \"%s\" complete in %s secondes without messages"
msgstr "Fixe de \"%s\" complété en %s secondes sans message"
#: index.php:105
#: index.php:111
#: index.php:112
#: index.php:149
msgid "Themes" msgid "Themes"
msgstr "Thèmes" msgstr "Thèmes"
#: index.php:104 #: index.php:107
#: index.php:174 #: index.php:177
msgid "Configure module" msgid "Configure module"
msgstr "Configurer le module" msgstr "Configurer le module"
#: index.php:127 #: index.php:130
msgid "Configure module \"%s\"" msgid "Configure module \"%s\""
msgstr "Configurer le module \"%s\"" msgstr "Configurer le module \"%s\""
#: index.php:131 #: index.php:134
msgid "Nothing to configure" msgid "Nothing to configure"
msgstr "Rien à configurer" msgstr "Rien à configurer"
#: index.php:140 #: index.php:143
msgid "Unknow module" msgid "Unknow module"
msgstr "Module inconnu" msgstr "Module inconnu"
#: index.php:149 #: index.php:152
msgid "No module to manage" msgid "No module to manage"
msgstr "Aucun module à gérer" msgstr "Aucun module à gérer"
#: index.php:174 #: index.php:177
msgid "Configure action '%s'" msgid "Configure action '%s'"
msgstr "Configurer l'action \"%s\"" msgstr "Configurer l'action \"%s\""
#: index.php:184 #: index.php:187
msgid "Save fields selection as preference" msgid "Save fields selection as preference"
msgstr "Enregistrer la sélection comme préférence" msgstr "Enregistrer la sélection comme préférence"
#: index.php:185 #: index.php:188
msgid "Select a module:" msgid "Select a module:"
msgstr "Sélectionner un module :" msgstr "Sélectionner un module :"
#: index.php:188 #: index.php:191
msgid "Fix it" msgid "Fix it"
msgstr "Corriger" msgstr "Corriger"