From 497fc7a299f9e4f4ea3af20899e878b919ff305b Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Tue, 25 Dec 2012 11:32:20 +0400 Subject: [PATCH 1/7] added method ProjectionChain::getList --- main/Criteria/Projections/ProjectionChain.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/Criteria/Projections/ProjectionChain.class.php b/main/Criteria/Projections/ProjectionChain.class.php index b9c0c8e4c3..e35a6779a0 100644 --- a/main/Criteria/Projections/ProjectionChain.class.php +++ b/main/Criteria/Projections/ProjectionChain.class.php @@ -16,6 +16,11 @@ final class ProjectionChain implements ObjectProjection { private $list = array(); + public function getList() + { + return $this->list; + } + /** * @return ProjectionChain **/ From 150a1afc9037c4da77a8cea5f0bc2e5c4e8e7f2e Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Thu, 13 Dec 2012 14:36:30 +0400 Subject: [PATCH 2/7] update global.inc.php.tpl, now tmp dir depends from USER --- global.inc.php.tpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/global.inc.php.tpl b/global.inc.php.tpl index 6b41db5178..04dcee7137 100644 --- a/global.inc.php.tpl +++ b/global.inc.php.tpl @@ -26,9 +26,13 @@ // overridable constant, don't forget for trailing slash // also you may consider using /dev/shm/ for cache purposes if (!defined('ONPHP_TEMP_PATH')) + $tempSuffix = 'onPHP'; + if (isset($_SERVER['USER'])) { + $tempSuffix .= '-'.$_SERVER['USER']; + } define( 'ONPHP_TEMP_PATH', - sys_get_temp_dir().DIRECTORY_SEPARATOR.'onPHP'.DIRECTORY_SEPARATOR + sys_get_temp_dir().DIRECTORY_SEPARATOR.$tempSuffix.DIRECTORY_SEPARATOR ); // system settings From 7b135447d18cc6febc8f3c1629ef46ac9112b724 Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Tue, 11 Dec 2012 19:35:44 +0400 Subject: [PATCH 3/7] Model::get will throw MissingElementException --- main/Flow/Model.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/Flow/Model.class.php b/main/Flow/Model.class.php index 1cc503f044..87b1f5c267 100644 --- a/main/Flow/Model.class.php +++ b/main/Flow/Model.class.php @@ -56,6 +56,9 @@ public function set($name, $var) public function get($name) { + if (!$this->has($name)) + throw new MissingElementException('Unknown var "'.$name.'"'); + return $this->vars[$name]; } From fb85fe1cb06399d31da5c49f41c9f464d30d209b Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Wed, 28 Nov 2012 17:55:38 +0400 Subject: [PATCH 4/7] update for best correct work of FormUtils::object2form --- main/Base/AbstractProtoClass.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/Base/AbstractProtoClass.class.php b/main/Base/AbstractProtoClass.class.php index d3fb26b9be..ddcdbd1fff 100644 --- a/main/Base/AbstractProtoClass.class.php +++ b/main/Base/AbstractProtoClass.class.php @@ -267,6 +267,11 @@ public function importPrimitive( $property = $this->getPropertyByName($path); $getter = $property->getGetter(); + if ($path == 'id' && $prm instanceof PrimitiveIdentifier) { + $form->importValue($prm->getName(), $object); + return $object; + } + if ( !$property->isFormless() && ($property->getFetchStrategyId() == FetchStrategy::LAZY) From 79f5e29390ada0811d0fe33d3d06850c055567e8 Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Mon, 26 Nov 2012 11:45:50 +0400 Subject: [PATCH 5/7] added method IdentifiablePrimitive::isScalar --- core/Form/Primitives/IdentifiablePrimitive.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/Form/Primitives/IdentifiablePrimitive.class.php b/core/Form/Primitives/IdentifiablePrimitive.class.php index 66a39cd876..99d14657e6 100644 --- a/core/Form/Primitives/IdentifiablePrimitive.class.php +++ b/core/Form/Primitives/IdentifiablePrimitive.class.php @@ -67,6 +67,11 @@ public function setScalar($orly = false) return $this; } + public function isScalar() + { + return $this->scalar; + } + /** * @throws WrongArgumentException * @return IdentifiablePrimitive From 273fdc544985d939da666b580df7ddee23c139d5 Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Mon, 12 Nov 2012 17:19:49 +0400 Subject: [PATCH 6/7] update CallbackLogicalObject Conflicts: core/Logic/CallbackLogicalObject.class.php nsConverter/src/AddUtils/CallbackLogicalObjectSuccess.class.php --- core/Logic/CallbackLogicalObject.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/Logic/CallbackLogicalObject.class.php b/core/Logic/CallbackLogicalObject.class.php index 969d419630..11b18c9d8b 100644 --- a/core/Logic/CallbackLogicalObject.class.php +++ b/core/Logic/CallbackLogicalObject.class.php @@ -11,7 +11,7 @@ /** * Wrapper around given childs of LogicalObject with custom logic-glue's. - * + * * @ingroup Logic **/ class CallbackLogicalObject implements LogicalObject @@ -26,16 +26,17 @@ class CallbackLogicalObject implements LogicalObject * @param Closure $callback * @return CallbackLogicalObject */ - static public function create(Closure $callback) + static public function create($callback) { - return new self($callback); + return new static($callback); } /** * @param Closure $callback */ - public function __construct(Closure $callback) + public function __construct($callback) { + Assert::isTrue(is_callable($callback, true), 'callback must be callable'); $this->callback = $callback; } @@ -45,12 +46,12 @@ public function __construct(Closure $callback) */ public function toBoolean(Form $form) { - return (bool)$this->callback->__invoke($form); + return call_user_func($this->callback, $form); } /** * @param Dialect $dialect - * @throws UnimplementedFeatureException + * @throws UnimplementedFeatureException */ public function toDialectString(Dialect $dialect) { From 2d540c1b08afda1c34e4b0d917a46908809bdcb4 Mon Sep 17 00:00:00 2001 From: AlexeyDsov Date: Tue, 6 Nov 2012 13:33:53 +0400 Subject: [PATCH 7/7] added Assert to build.php Conflicts: meta/bin/build.php --- meta/bin/build.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/bin/build.php b/meta/bin/build.php index 497a2fb842..d32337f732 100755 --- a/meta/bin/build.php +++ b/meta/bin/build.php @@ -51,6 +51,8 @@ function init() ONPHP_META_PATTERNS, ONPHP_META_TYPES, )); + + Assert::isTrue(defined('PATH_CLASSES'), 'constant PATH_CLASSES must be defined'); if (!defined('ONPHP_META_DAO_DIR')) define( @@ -340,4 +342,4 @@ function stop($message = null) } $out->getOutput()->resetAll(); - $out->newLine(); \ No newline at end of file + $out->newLine();