Skip to content

Commit 8f473bf

Browse files
authored
Merge pull request #1489 from phalcon/4.0.x
4.0.5
2 parents a6d8e8a + 94d96c9 commit 8f473bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+215
-169
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
> Questions should go to https://forum.phalconphp.com
1+
> Questions should go to https://forum.phalcon.io
22
> Documentation issues should go to https://github.com/phalcon/docs/issues
33
44
### Expected and Actual Behavior
@@ -23,5 +23,4 @@
2323
* PHP Version: (`php -v`)
2424
* Operating System:
2525
* Server: Nginx | Apache | Other
26-
* Other related info (Database, table schema):
27-
26+
* Other related info (Database, table schema):

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [4.0.5](https://github.com/phalcon/cphalcon/releases/tag/v4.0.5) (2021-03-14)
2+
## Fixed
3+
- Fixed model creation failure in webtools due to wrong variable mutation [#1415](https://github.com/phalcon/phalcon-devtools/issues/1415)
4+
- Fixed config path detection to platform independent [#1426](https://github.com/phalcon/phalcon-devtools/issues/1426)
5+
6+
17
# [4.0.4](https://github.com/phalcon/cphalcon/releases/tag/v4.0.4) (2021-03-11)
28
## Added
39
- Added support for PHP `7.4` [#1482](https://github.com/phalcon/phalcon-devtools/pull/1482)

bootstrap/autoload.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if (!extension_loaded('phalcon')) {
1515
throw new Exception(
1616
"Phalcon extension isn't installed, follow these instructions to install it: " .
17-
'https://docs.phalconphp.com/en/latest/installation'
17+
'https://docs.phalcon.io/en/latest/installation'
1818
);
1919
}
2020

@@ -87,11 +87,6 @@
8787
*/
8888
defined('HOSTNAME') || define('HOSTNAME', explode('.', gethostname())[0]);
8989

90-
/**
91-
* @const ADMIN_LTE_VERSION The AdminLTE version.
92-
*/
93-
defined('ADMIN_LTE_VERSION') || define('ADMIN_LTE_VERSION', '2.3.6');
94-
9590
/**
9691
* Register the Composer autoloader (if any)
9792
*/

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@
5252
},
5353
"autoload-dev": {
5454
"psr-4": {
55-
"Phalcon\\Test\\": "tests/unit",
56-
"Phalcon\\Test\\Models\\": "tests/_data/models",
57-
"Phalcon\\Test\\Module\\": "tests/_support/Module"
55+
"Phalcon\\DevTools\\Tests\\Acceptance\\": "tests/acceptance/",
56+
"Phalcon\\DevTools\\Tests\\Console\\": "tests/console/",
57+
"Phalcon\\DevTools\\Tests\\Functional\\": "tests/functional/",
58+
"Phalcon\\DevTools\\Tests\\Unit\\": "tests/unit/",
59+
"Phalcon\\DevTools\\Tests\\Support\\Module\\": "tests/_support/Module"
5860
},
5961
"files": [
6062
"tests/_support/helpers.php"

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phalcon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ check_install(){
110110
printf "\n"
111111
printf "\nIn case of problems: "
112112
printf "${YELLOW}https://github.com/phalcon/phalcon-devtools/issues${NC} "
113-
printf "\n and: ${YELLOW}https://forum.phalconphp.com${NC}"
113+
printf "\n and: ${YELLOW}https://forum.phalcon.io${NC}"
114114
printf "\n"
115115

116116
check_bash

src/Builder/Component/Model.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ public function build(): void
139139

140140
$adapterName = 'Phalcon\Db\Adapter\Pdo\\' . $adapter;
141141
unset($configArray['adapter']);
142-
if (isset($configArray['options'])) {
143-
$configArray = $configArray['options'];
144-
}
142+
145143
/** @var AbstractPdo $db */
146144
$db = new $adapterName($configArray);
147145

src/Builder/Path.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,32 @@ public function getConfig($type = null): Config
4343
$type = isset($types[$type]) ? $type : 'ini';
4444

4545
foreach (['app/config/', 'config/', 'apps/config/', 'apps/frontend/config/'] as $configPath) {
46-
if ('ini' == $type && file_exists($this->rootPath . $configPath . 'config.ini')) {
46+
if ('ini' === $type && file_exists($this->rootPath . $configPath . 'config.ini')) {
4747
return new ConfigIni($this->rootPath . $configPath . 'config.ini');
48-
} else {
49-
if (file_exists($this->rootPath . $configPath. 'config.php')) {
50-
$config = include($this->rootPath . $configPath . 'config.php');
51-
if (is_array($config)) {
52-
$config = new Config($config);
53-
}
54-
55-
return $config;
48+
}
49+
if (file_exists($this->rootPath . $configPath. 'config.php')) {
50+
$config = include($this->rootPath . $configPath . 'config.php');
51+
if (is_array($config)) {
52+
$config = new Config($config);
5653
}
54+
55+
return $config;
5756
}
5857
}
5958

6059
$directory = new RecursiveDirectoryIterator('.');
6160
$iterator = new RecursiveIteratorIterator($directory);
6261
foreach ($iterator as $f) {
63-
if (preg_match('/\/config\.php$/i', $f->getPathName())) {
62+
if (false !== strpos($f->getPathName(), 'config.php')) {
6463
$config = include $f->getPathName();
6564
if (is_array($config)) {
6665
$config = new Config($config);
6766
}
6867

6968
return $config;
70-
} else {
71-
if (preg_match('/config\.ini$/i', $f->getPathName())) {
72-
return new ConfigIni($f->getPathName());
73-
}
69+
}
70+
if (false !== strpos($f->getPathName(), 'config.ini')) {
71+
return new ConfigIni($f->getPathName());
7472
}
7573
}
7674

src/Options/OptionsAware.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ class OptionsAware implements FactoryOptions
3030
/**
3131
* @param array $options
3232
*/
33-
public function __construct(array $options = null)
33+
public function __construct(array $options = [])
3434
{
35-
if (!empty($options)) {
36-
$this->options = $options;
37-
}
35+
$this->options = $options;
3836
}
3937

4038
/**
@@ -110,7 +108,7 @@ public function getOptions(): array
110108
public function getOption($key)
111109
{
112110
if (!isset($this->options[$key])) {
113-
throw new InvalidArgumentException("Option " . $key . " has't been defined");
111+
throw new InvalidArgumentException("Option " . $key . " hasn't been defined");
114112
}
115113

116114
return $this->options[$key];

src/Providers/AnnotationsProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AnnotationsProvider implements ServiceProviderInterface
3131
public function register(DiInterface $di): void
3232
{
3333
$di->setShared($this->providerName, function () {
34-
return new AnnotationsMemory;
34+
return new AnnotationsMemory();
3535
});
3636
}
3737
}

0 commit comments

Comments
 (0)