Removed need for strict typing

This commit is contained in:
Marcin Kurczewski 2013-11-13 22:14:32 +01:00
parent 70a4b46cf1
commit 8cd457848c
3 changed files with 4 additions and 4 deletions

View file

@ -564,10 +564,10 @@ class PostController
if (!$this->context->loggedIn)
throw new SimpleException('Not logged in');
$p = R::findOne('post_score', 'post_id = ? AND user_id = ?', [$id, $this->context->user->id]);
$p = R::findOne('postscore', 'post_id = ? AND user_id = ?', [$post->id, $this->context->user->id]);
if (!$p)
{
$p = R::dispense('post_score');
$p = R::dispense('postscore');
$p->post = $post;
$p->user = $this->context->user;
}
@ -648,7 +648,7 @@ class PostController
if ($fav->user->id == $this->context->user->id)
$favorite = true;
$s = R::findOne('post_score', 'post_id = ? AND user_id = ?', [$post->id, $this->context->user->id]);
$s = R::findOne('postscore', 'post_id = ? AND user_id = ?', [$post->id, $this->context->user->id]);
if ($s)
$score = intval($s->score);
}

View file

@ -0,0 +1 @@
ALTER TABLE post_score RENAME TO postscore

View file

@ -48,7 +48,6 @@ $config = configFactory();
R::setup('sqlite:' . $config->main->dbPath);
R::freeze(true);
R::dependencies(['tag' => ['post'], 'favoritee' => ['post', 'user'], 'comment' => ['post', 'user']]);
R::setStrictTyping(false);
//wire models
\Chibi\AutoLoader::init([__DIR__ . '/../' . $config->chibi->userCodeDir, __DIR__]);