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 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) { 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 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) 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 **/ 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]; } 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();