add modifier \u in phpheader
This commit is contained in:
parent
ae12e53215
commit
f9ba34adc1
3 changed files with 21 additions and 15 deletions
|
@ -1,5 +1,6 @@
|
||||||
0.0.2
|
0.0.2
|
||||||
- [ ] add global config for file size limit
|
- [ ] add global config for file size limit
|
||||||
|
- [x] add modifier _first upper case_ : _\u_ in bloc content
|
||||||
|
|
||||||
0.0.1
|
0.0.1
|
||||||
- First pre-release
|
- First pre-release
|
|
@ -5,7 +5,7 @@
|
||||||
**improve** is a plugin for the open-source
|
**improve** is a plugin for the open-source
|
||||||
web publishing software called Dotclear.
|
web publishing software called Dotclear.
|
||||||
|
|
||||||
It helps dev to clean up his plugin or theme before publishing its code.
|
It helps dev to clean up plugin or theme before publishing code.
|
||||||
|
|
||||||
* Open to third party plugin
|
* Open to third party plugin
|
||||||
* Easy and fast to use
|
* Easy and fast to use
|
||||||
|
|
|
@ -156,20 +156,25 @@ class ImproveActionPhpheader extends ImproveAction
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->bloc = str_replace(
|
$this->bloc = preg_replace_callback(
|
||||||
$this->bloc_wildcards,
|
// use \u in bloc content for first_upper_case
|
||||||
[
|
'/(\\\u([a-z]{1}))/',
|
||||||
date('Y'),
|
function($str) { return ucfirst($str[2]); },
|
||||||
$this->module['id'],
|
str_replace(
|
||||||
$this->module['name'],
|
$this->bloc_wildcards,
|
||||||
$this->module['author'],
|
[
|
||||||
$this->module['type'],
|
date('Y'),
|
||||||
$this->core->auth->getInfo('user_cn'),
|
$this->module['id'],
|
||||||
$this->core->auth->getinfo('user_name'),
|
$this->module['name'],
|
||||||
$this->core->auth->getInfo('user_email'),
|
$this->module['author'],
|
||||||
$this->core->auth->getInfo('user_url')
|
$this->module['type'],
|
||||||
],
|
$this->core->auth->getInfo('user_cn'),
|
||||||
$bloc
|
$this->core->auth->getinfo('user_name'),
|
||||||
|
$this->core->auth->getInfo('user_email'),
|
||||||
|
$this->core->auth->getInfo('user_url')
|
||||||
|
],
|
||||||
|
$bloc
|
||||||
|
)
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
self::notice(__('failed to parse bloc'));
|
self::notice(__('failed to parse bloc'));
|
||||||
|
|
Loading…
Reference in a new issue