Skip to content

Commit

Permalink
Merge branch '2.0.x' of https://github.com/phalcon/cphalcon into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Jun 5, 2015
2 parents fc8b331 + 5519b17 commit e4c390d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion phalcon/db/dialect.zep
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ abstract class Dialect implements DialectInterface
/**
* Transforms an intermediate representation for a expression into a database system valid expression
*/
public function getSqlExpression(array! expression, var escapeChar = null) -> string
public function getSqlExpression(array! expression, string escapeChar = null) -> string
{
var type;

Expand Down
9 changes: 8 additions & 1 deletion phalcon/mvc/model.zep
Original file line number Diff line number Diff line change
Expand Up @@ -4244,7 +4244,7 @@ abstract class Model implements ModelInterface, ResultInterface, InjectionAwareI
public static function setup(array! options) -> void
{
var disableEvents, columnRenaming, notNullValidations,
exceptionOnFailedSave, phqlLiterals, virtualForeignKeys;
exceptionOnFailedSave, phqlLiterals, virtualForeignKeys, lateStateBinding;

/**
* Enables/Disables globally the internal events
Expand Down Expand Up @@ -4287,6 +4287,13 @@ abstract class Model implements ModelInterface, ResultInterface, InjectionAwareI
if fetch phqlLiterals, options["phqlLiterals"] {
globals_set("orm.enable_literals", phqlLiterals);
}

/**
* Enables/Disables late state binding on model hydration
*/
if fetch lateStateBinding, options["lateStateBinding"] {
globals_set("orm.late_state_binding", lateStateBinding);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion phalcon/mvc/model/criteria.zep
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ class Criteria implements CriteriaInterface, InjectionAwareInterface
public function execute() -> <ResultsetInterface>
{
var model;
let model = this->_model;
let model = this->getModelName();
if typeof model != "string" {
throw new Exception("Model name must be string");
}
Expand Down
9 changes: 8 additions & 1 deletion phalcon/security.zep
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ class Security implements InjectionAwareInterface
}

break;

case self::CRYPT_SHA512:
let saltBytes = this->getSaltBytes(8);
if typeof saltBytes != "string" {
throw new Exception("Unable to get random bytes for the salt");
}
return crypt(password, "$" . variant . "$" . saltBytes);

break;
case self::CRYPT_DEFAULT:
case self::CRYPT_BLOWFISH:
case self::CRYPT_BLOWFISH_X:
Expand Down

0 comments on commit e4c390d

Please sign in to comment.