Skip to content

Commit cfc65f7

Browse files
committed
Fix pb in UIntrospection (closure_dump)
1 parent ac11ff1 commit cfc65f7

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unrelease]
88
- Nothing
9+
## [2.3.2] 2019-10-28
10+
### Added
11+
- bulk queries in `DAO` class
12+
- `DAO::toAdd($instance)`
13+
- `DAO::toUpdate($instance)`
14+
- `DAO::toDelete($instance)`
15+
- `DAO::flush()`
16+
- Composer create-project
17+
```
18+
composer create-project phpmv/ubiquity-project {projectName}
19+
```
20+
### Changed
21+
- `MicroTemplateEngine` optimization (cache)
22+
### Added
923
## [2.3.1] 2019-09-25
1024
### Added
1125
- `workerman` server

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- Scaffolding
2222
- Console Admin interface (Devtools)
2323
- Assets & themes management (since 2.1.0, on a [proposal](https://github.com/phpMv/ubiquity/issues/11) from [@Gildonei](https://github.com/gildonei))
24-
- Managed servers: fpm/fastcgi with Apache or nginX, Swoole, PHP-PM with ReactPHP (Dev only)
24+
- Managed servers: fpm/fastcgi with Apache or nginX, [Workerman](https://github.com/walkor/Workerman), [Swoole](https://github.com/swoole/swoole-src), [PHP-PM](https://github.com/php-pm/php-pm) with ReactPHP (Dev only)
2525

2626
# Upgrade
2727
If Ubiquity devtools are already globally installed, and you want to upgrade to the lastest stable version:

src/Ubiquity/core/Framework.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Ubiquity\utils\http\USession;
2222

2323
class Framework {
24-
public const version = '2.3.1';
24+
public const version = '2.3.2';
2525

2626
public static function getVersion() {
2727
return self::version;

src/Ubiquity/orm/DAO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static function getOne($className, $condition, $included = true, $paramet
134134
* @return object the instance loaded or null if not found
135135
*/
136136
public static function getById($className, $keyValues, $included = true, $useCache = NULL) {
137-
return self::_getOne ( self::getDb ( $className ), $className, self::getConditionParser ( $className, $keyValues ), $included, $useCache );
137+
return self::_getOne ( self::getDatabase ( self::$modelsDatabase [$className] ?? 'default'), $className, self::getConditionParser ( $className, $keyValues ), $included, $useCache );
138138
}
139139

140140
protected static function getConditionParser($className, $keyValues): ConditionParser {

src/Ubiquity/orm/parser/ConditionParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function setKeyValues($values) {
5858
} else {
5959
$this->params = [ ];
6060
foreach ( $values as $val ) {
61-
$this->addParams ( $val );
61+
$this->params [$val] = true;
6262
}
6363
}
6464
}

src/Ubiquity/utils/base/UIntrospection.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* This class is part of Ubiquity
88
*
99
* @author jcheron <[email protected]>
10-
* @version 1.0.5
10+
* @version 1.0.6
1111
*
1212
*/
1313
class UIntrospection {
@@ -34,7 +34,7 @@ public static function getLoadedViews(\ReflectionMethod $r, $lines) {
3434
if (isset ( $matches [1] )) {
3535
$result = array_merge ( $result, $matches [1] );
3636
}
37-
if (strpos ( $code, '$this->loadDefaultView' ) !== false || strpos ( $code, '$this->jquery->renderDefaultView' ) !== false) {
37+
if (\strpos ( $code, '$this->loadDefaultView' ) !== false || strpos ( $code, '$this->jquery->renderDefaultView' ) !== false) {
3838
$result [] = $r->getDeclaringClass ()->getShortName () . '/' . $r->getName () . '.html';
3939
}
4040
return $result;
@@ -80,7 +80,8 @@ public static function closure_dump(\Closure $c) {
8080
$sLine = $r->getStartLine ();
8181
$eLine = $r->getEndLine ();
8282
if ($eLine === $sLine) {
83-
$str .= \strstr ( \strstr ( $lines [$sLine - 1], "{" ), "}", true ) . "}";
83+
$match = \strstr ( $lines [$sLine - 1], "function" );
84+
$str .= \strstr ( \strstr ( $match, "{" ), "}", true ) . "}";
8485
} else {
8586
$str .= \strrchr ( $lines [$sLine - 1], "{" );
8687
for($l = $sLine; $l < $eLine - 1; $l ++) {

0 commit comments

Comments
 (0)