Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
endeveit committed Jan 22, 2014
2 parents 1b68d40 + c4fe239 commit 488a421
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Library/Phalcon/Session/Adapter/Memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ public function gc()
*/
public function getOption($key)
{
if (isset($this->options[$key])) {
return $this->options[$key];
$options = $this->getOptions();
if (isset($options[$key])) {
return $options[$key];
}

return null;
Expand Down
8 changes: 5 additions & 3 deletions Library/Phalcon/Test/ModelTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,17 @@ public function emptyTable($table)
* Disables FOREIGN_KEY_CHECKS and truncates database table
*
* @param string $table table name
*
* @return bool result of truncate operation
*/
public function truncateTable($table)
{
/* @var $db \Phalcon\Db\Adapter\Pdo\Mysql */
$db = $this->getDI()->get('db');
$db->query("SET FOREIGN_KEY_CHECKS = 0");
$success = $db->query("TRUNCATE TABLE `$table`");
$db->query("SET FOREIGN_KEY_CHECKS = 1");

$db->execute("SET FOREIGN_KEY_CHECKS = 0");
$success = $db->execute("TRUNCATE TABLE `$table`");
$db->execute("SET FOREIGN_KEY_CHECKS = 1");

return $success;
}
Expand Down

0 comments on commit 488a421

Please sign in to comment.