mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Fixing greedy regexp in project task.
This commit is contained in:
parent
d4cdc118d2
commit
30c7b954ec
1 changed files with 2 additions and 2 deletions
|
@ -316,8 +316,8 @@ class ProjectTask extends Shell {
|
||||||
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
|
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
|
||||||
$File = new File($path . 'core.php');
|
$File = new File($path . 'core.php');
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('%([/\s]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) {
|
if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) {
|
||||||
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.prefixes\', array(\''.$name.'\'));', $contents);
|
$result = str_replace($match[0], "\n" . 'Configure::write(\'Routing.prefixes\', array(\''.$name.'\'));', $contents);
|
||||||
if ($File->write($result)) {
|
if ($File->write($result)) {
|
||||||
Configure::write('Routing.prefixes', array($name));
|
Configure::write('Routing.prefixes', array($name));
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue