Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/Form/Primitives/IdentifiablePrimitive.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public function setScalar($orly = false)
return $this;
}

public function isScalar()
{
return $this->scalar;
}

/**
* @throws WrongArgumentException
* @return IdentifiablePrimitive
Expand Down
13 changes: 7 additions & 6 deletions core/Logic/CallbackLogicalObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* Wrapper around given childs of LogicalObject with custom logic-glue's.
*
*
* @ingroup Logic
**/
class CallbackLogicalObject implements LogicalObject
Expand All @@ -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;
}

Expand All @@ -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)
{
Expand Down
6 changes: 5 additions & 1 deletion global.inc.php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То есть мне теперь во всех проектах, где есть http авторизация, нужно будет в своем конфиге задавать ONPHP_TEMP_PATH ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Игорь, при http auth имя пользователя попадет в PHP_AUTH_USER

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А, ну да )

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На всякий случай добавлю для примера что оно скорее всего будет /tmp/onPHP-www-data/ в случае использования веб сервера.


// system settings
Expand Down
5 changes: 5 additions & 0 deletions main/Base/AbstractProtoClass.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

знакомая тема, натыкались

if (
!$property->isFormless()
&& ($property->getFetchStrategyId() == FetchStrategy::LAZY)
Expand Down
5 changes: 5 additions & 0 deletions main/Criteria/Projections/ProjectionChain.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ final class ProjectionChain implements ObjectProjection
{
private $list = array();

public function getList()
{
return $this->list;
}

/**
* @return ProjectionChain
**/
Expand Down
3 changes: 3 additions & 0 deletions main/Flow/Model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
4 changes: 3 additions & 1 deletion meta/bin/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -340,4 +342,4 @@ function stop($message = null)
}

$out->getOutput()->resetAll();
$out->newLine();
$out->newLine();