From 353c13d9b69cf590c1320294248194bf1636906f Mon Sep 17 00:00:00 2001 From: JN-Jones Date: Fri, 22 May 2015 12:37:06 +0200 Subject: [PATCH 01/10] Improve caching, fix some minor issues and fix #148 --- app/Database/Collections/TreeCollection.php | 57 +++ app/Database/Models/AbstractCachingModel.php | 10 +- app/Database/Models/Conversation.php | 2 +- app/Database/Models/ConversationMessage.php | 2 +- app/Database/Models/Forum.php | 50 +- app/Database/Models/Permission.php | 2 +- app/Database/Models/Poll.php | 2 +- app/Database/Models/PollVote.php | 2 +- app/Database/Models/Post.php | 2 +- app/Database/Models/ProfileField.php | 2 +- app/Database/Models/ProfileFieldGroup.php | 2 +- app/Database/Models/ProfileFieldOption.php | 2 +- app/Database/Models/Role.php | 59 ++- app/Database/Models/Search.php | 2 +- app/Database/Models/Topic.php | 2 +- app/Database/Models/User.php | 4 +- app/Database/Models/UserProfileField.php | 2 +- app/Permissions/PermissionChecker.php | 6 +- .../Traits/InheritPermissionableTrait.php | 4 + app/Presenters/User.php | 7 +- app/Services/Registrar.php | 2 +- app/Twig/Extensions/ParseDateHelper.php | 6 +- composer.json | 1 - composer.lock | 471 ++++++++---------- 24 files changed, 404 insertions(+), 297 deletions(-) create mode 100644 app/Database/Collections/TreeCollection.php diff --git a/app/Database/Collections/TreeCollection.php b/app/Database/Collections/TreeCollection.php new file mode 100644 index 00000000..97beb366 --- /dev/null +++ b/app/Database/Collections/TreeCollection.php @@ -0,0 +1,57 @@ +isEmpty()) { + return $this; + } + $groupedChildren = $this->groupBy('parent_id'); + /** @var Model $node */ + foreach ($this->items as $node) { + if (!isset($node->parent)) { + $node->setRelation('parent', null); + } + $children = $groupedChildren->get($node->getKey(), []); + /** @var Model $child */ + foreach ($children as $child) { + $child->setRelation('parent', $node); + } + $node->setRelation('children', Collection::make($children)); + } + + return $this; + } + + /** + * Build tree from node list. Each item will have set children relation. + * + * @return Collection + */ + public function toTree() + { + $this->linkNodes(); + return $this; + } +} diff --git a/app/Database/Models/AbstractCachingModel.php b/app/Database/Models/AbstractCachingModel.php index 897d2835..c6dba2a4 100644 --- a/app/Database/Models/AbstractCachingModel.php +++ b/app/Database/Models/AbstractCachingModel.php @@ -25,7 +25,7 @@ public function save(array $options = array()) $saved = parent::save($options); if ($saved) { - static::$models[$this->getKey()] = $this; + static::$models[get_class($this)][$this->getKey()] = $this; } return $saved; @@ -37,7 +37,7 @@ public function save(array $options = array()) public function delete() { parent::delete(); - unset(static::$models[$this->getKey()]); + unset(static::$models[get_class($this)][$this->getKey()]); } /** @@ -49,10 +49,10 @@ public static function find($id, $columns = array('*')) return parent::find($id, $columns); } - if (!isset(static::$models[$id])) { - static::$models[$id] = parent::find($id); + if (!isset(static::$models[get_called_class()][$id])) { + static::$models[get_called_class()][$id] = parent::find($id); } - return static::$models[$id]; + return static::$models[get_called_class()][$id]; } } diff --git a/app/Database/Models/Conversation.php b/app/Database/Models/Conversation.php index 252516b1..7e57681f 100644 --- a/app/Database/Models/Conversation.php +++ b/app/Database/Models/Conversation.php @@ -20,7 +20,7 @@ * @property ConversationMessage lastMessage * @property Collection participants */ -class Conversation extends Model implements HasPresenter +class Conversation extends AbstractCachingModel implements HasPresenter { /** * The database table used by the model. diff --git a/app/Database/Models/ConversationMessage.php b/app/Database/Models/ConversationMessage.php index 0a87565a..671e5ec2 100644 --- a/app/Database/Models/ConversationMessage.php +++ b/app/Database/Models/ConversationMessage.php @@ -22,7 +22,7 @@ * @property Conversation conversation * @property User author */ -class ConversationMessage extends Model implements HasPresenter +class ConversationMessage extends AbstractCachingModel implements HasPresenter { /** * The database table used by the model. diff --git a/app/Database/Models/Forum.php b/app/Database/Models/Forum.php index 672d5a69..e9d796ef 100644 --- a/app/Database/Models/Forum.php +++ b/app/Database/Models/Forum.php @@ -12,20 +12,13 @@ use MyBB\Core\Permissions\Interfaces\InheritPermissionInterface; use MyBB\Core\Permissions\Traits\InheritPermissionableTrait; -use Kalnoy\Nestedset\Node; use McCool\LaravelAutoPresenter\HasPresenter; +use MyBB\Core\Database\Collections\TreeCollection; -class Forum extends Node implements HasPresenter, InheritPermissionInterface +class Forum extends AbstractCachingModel implements HasPresenter, InheritPermissionInterface { use InheritPermissionableTrait; - /** - * Nested set column IDs. - */ - const LFT = 'left_id'; - const RGT = 'right_id'; - const PARENT_ID = 'parent_id'; - // @codingStandardsIgnoreStart /** * Indicates if the model should be timestamped. @@ -65,6 +58,18 @@ public function getPresenterClass() return 'MyBB\Core\Presenters\Forum'; } + /** + * @return InheritPermissionableTrait + */ + public function getParent() + { + if ($this->parent_id === null) { + return null; + } + + return $this->find($this->parent_id); + } + /** * A forum contains many threads. * @@ -104,4 +109,31 @@ public function lastPostAuthor() { return $this->hasOne('MyBB\\Core\\Database\\Models\\User', 'id', 'last_post_user_id'); } + + /** + * Relation to the parent. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function parent() + { + return $this->belongsTo(get_class($this), 'parent_id'); + } + /** + * Relation to children. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function children() + { + return $this->hasMany(get_class($this), 'parent_id'); + } + + /** + * {@inheritdoc} + */ + public function newCollection(array $models = array()) + { + return new TreeCollection($models); + } } diff --git a/app/Database/Models/Permission.php b/app/Database/Models/Permission.php index 9874d75b..3f580ea1 100644 --- a/app/Database/Models/Permission.php +++ b/app/Database/Models/Permission.php @@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Model; -class Permission extends Model +class Permission extends AbstractCachingModel { /** diff --git a/app/Database/Models/Poll.php b/app/Database/Models/Poll.php index 939e5ece..912ddb42 100644 --- a/app/Database/Models/Poll.php +++ b/app/Database/Models/Poll.php @@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model; use McCool\LaravelAutoPresenter\HasPresenter; -class Poll extends Model implements HasPresenter +class Poll extends AbstractCachingModel implements HasPresenter { // @codingStandardsIgnoreStart diff --git a/app/Database/Models/PollVote.php b/app/Database/Models/PollVote.php index 5cef44f5..6590b1f6 100644 --- a/app/Database/Models/PollVote.php +++ b/app/Database/Models/PollVote.php @@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Model; -class PollVote extends Model +class PollVote extends AbstractCachingModel { // @codingStandardsIgnoreStart diff --git a/app/Database/Models/Post.php b/app/Database/Models/Post.php index 0ee39fde..96340c13 100644 --- a/app/Database/Models/Post.php +++ b/app/Database/Models/Post.php @@ -15,7 +15,7 @@ use McCool\LaravelAutoPresenter\HasPresenter; use MyBB\Core\Likes\Traits\LikeableTrait; -class Post extends Model implements HasPresenter +class Post extends AbstractCachingModel implements HasPresenter { use SoftDeletes; use LikeableTrait; diff --git a/app/Database/Models/ProfileField.php b/app/Database/Models/ProfileField.php index b6b98b04..3de10afb 100644 --- a/app/Database/Models/ProfileField.php +++ b/app/Database/Models/ProfileField.php @@ -17,7 +17,7 @@ * @property string validation_rules * @property string name */ -class ProfileField extends Model implements HasPresenter +class ProfileField extends AbstractCachingModel implements HasPresenter { /** * @var string diff --git a/app/Database/Models/ProfileFieldGroup.php b/app/Database/Models/ProfileFieldGroup.php index 2fa209be..b09f763d 100644 --- a/app/Database/Models/ProfileFieldGroup.php +++ b/app/Database/Models/ProfileFieldGroup.php @@ -14,7 +14,7 @@ /** * @property int id */ -class ProfileFieldGroup extends Model implements HasPresenter +class ProfileFieldGroup extends AbstractCachingModel implements HasPresenter { const ABOUT_YOU = 'about-you'; const CONTACT_DETAILS = 'contact-details'; diff --git a/app/Database/Models/ProfileFieldOption.php b/app/Database/Models/ProfileFieldOption.php index 22c8dee3..8be8e354 100644 --- a/app/Database/Models/ProfileFieldOption.php +++ b/app/Database/Models/ProfileFieldOption.php @@ -15,7 +15,7 @@ * @property string name * @property string value */ -class ProfileFieldOption extends Model +class ProfileFieldOption extends AbstractCachingModel { /** * @var string diff --git a/app/Database/Models/Role.php b/app/Database/Models/Role.php index c0da4ad3..8d202c8c 100644 --- a/app/Database/Models/Role.php +++ b/app/Database/Models/Role.php @@ -8,10 +8,12 @@ namespace MyBB\Core\Database\Models; -use Illuminate\Database\Eloquent\Model; - -class Role extends Model +class Role extends AbstractCachingModel { + /** + * @var array + */ + protected static $slugCache; /** * The database table used by the model. @@ -35,4 +37,55 @@ public function permissions() { return $this->belongsToMany('MyBB\Core\Database\Models\Permission'); } + + /** + * @param string $slug + * + * @return Role + */ + public static function whereSlug($slug) + { + if (!isset(static::$slugCache[$slug])) { + static::$slugCache[$slug] = static::where('role_slug', '=', $slug)->first(); + } +//dd(static::$slugCache); + return static::$slugCache[$slug]; + } + + /** + * {@inheritdoc} + */ + public function save(array $options = array()) + { + $saved = parent::save($options); + + if ($saved) { + static::$slugCache[$this->role_slug] = $this; + } + + return $saved; + } + + /** + * {@inheritdoc} + */ + public function delete() + { + parent::delete(); + unset(static::$slugCache[$this->role_slug]); + } + + /** + * {@inheritdoc} + */ + public static function find($id, $columns = array('*')) + { + $model = parent::find($id, $columns); + + if ($columns == array('*')) { + static::$slugCache[$model->role_slug] = $model; + } + + return $model; + } } diff --git a/app/Database/Models/Search.php b/app/Database/Models/Search.php index 1cd5981e..9d5f087b 100644 --- a/app/Database/Models/Search.php +++ b/app/Database/Models/Search.php @@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Model; -class Search extends Model +class Search extends AbstractCachingModel { // @codingStandardsIgnoreStart diff --git a/app/Database/Models/Topic.php b/app/Database/Models/Topic.php index dcb1ba42..cf1e15dc 100644 --- a/app/Database/Models/Topic.php +++ b/app/Database/Models/Topic.php @@ -14,7 +14,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use McCool\LaravelAutoPresenter\HasPresenter; -class Topic extends Model implements HasPresenter +class Topic extends AbstractCachingModel implements HasPresenter { use SoftDeletes; diff --git a/app/Database/Models/User.php b/app/Database/Models/User.php index 1df449ae..de037cff 100644 --- a/app/Database/Models/User.php +++ b/app/Database/Models/User.php @@ -20,7 +20,7 @@ /** * @property string id */ -class User extends Model implements AuthenticatableContract, CanResetPasswordContract, HasPresenter, PermissionInterface +class User extends AbstractCachingModel implements AuthenticatableContract, CanResetPasswordContract, HasPresenter, PermissionInterface { use Authenticatable; use CanResetPassword; @@ -109,7 +109,7 @@ public function displayRole() if ($this->displayRole == null) { // Do we have a guest? if ($this->id <= 0) { - $this->displayRole = Role::where('role_slug', 'guest')->first(); + $this->displayRole = Role::whereSlug('guest'); } else { $this->displayRole = $this->roles->whereLoose('pivot.is_display', true)->first(); } diff --git a/app/Database/Models/UserProfileField.php b/app/Database/Models/UserProfileField.php index d9f52113..456482a3 100644 --- a/app/Database/Models/UserProfileField.php +++ b/app/Database/Models/UserProfileField.php @@ -13,7 +13,7 @@ /** * @property string value */ -class UserProfileField extends Model +class UserProfileField extends AbstractCachingModel { /** * @var string diff --git a/app/Permissions/PermissionChecker.php b/app/Permissions/PermissionChecker.php index c7171aad..4d79f0e0 100644 --- a/app/Permissions/PermissionChecker.php +++ b/app/Permissions/PermissionChecker.php @@ -163,13 +163,13 @@ public function hasPermission($content, $contentID, $permission, User $user = nu if ($roles->count() == 0) { if ($user->exists) { // User saved? Something is wrong, attach the registered role - $registeredRole = Role::where('role_slug', '=', 'user')->first(); + $registeredRole = Role::whereSlug('user'); $user->roles()->attach($registeredRole->id, ['is_display' => 1]); $roles = [$registeredRole]; } else { // Guest if ($this->guestRole == null) { - $this->guestRole = Role::where('role_slug', '=', 'guest')->first(); + $this->guestRole = Role::whereSlug('guest'); } $roles = [$this->guestRole]; } @@ -285,7 +285,7 @@ public function getPermissionForRole(Role $role, $permission, $content = null, $ */ private function hasCache(Role $role, $permission, $content, $contentID) { - return $this->getCache($role, $permission, $content, $contentID) != null; + return $this->getCache($role, $permission, $content, $contentID) !== null; } /** diff --git a/app/Permissions/Traits/InheritPermissionableTrait.php b/app/Permissions/Traits/InheritPermissionableTrait.php index 8db427eb..ff58649c 100644 --- a/app/Permissions/Traits/InheritPermissionableTrait.php +++ b/app/Permissions/Traits/InheritPermissionableTrait.php @@ -21,6 +21,10 @@ trait InheritPermissionableTrait */ public function getParent() { + if ($this->parent_id === null) { + return null; + } + return $this->parent; } diff --git a/app/Presenters/User.php b/app/Presenters/User.php index 5bd35e44..9af77884 100644 --- a/app/Presenters/User.php +++ b/app/Presenters/User.php @@ -226,8 +226,13 @@ public function isOnline() return false; } + $lastVisit = $this->wrappedObject->last_visit; + if(is_string($lastVisit)) { + $lastVisit = new \DateTime($lastVisit); + } + // This user isn't online - if (new \DateTime($this->wrappedObject->last_visit) < new \DateTime("{$minutes} minutes ago")) { + if ($lastVisit < new \DateTime("{$minutes} minutes ago")) { return false; } diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php index 9d64bbc1..0692802c 100644 --- a/app/Services/Registrar.php +++ b/app/Services/Registrar.php @@ -59,7 +59,7 @@ public function create(array $data) 'password' => bcrypt($data['password']), ]); - $user->roles()->attach(Role::where('role_slug', '=', 'user')->pluck('id'), ['is_display' => true]); + $user->roles()->attach(Role::whereSlug('user')->id, ['is_display' => true]); return $user; } diff --git a/app/Twig/Extensions/ParseDateHelper.php b/app/Twig/Extensions/ParseDateHelper.php index 01bd93cb..cf60a530 100644 --- a/app/Twig/Extensions/ParseDateHelper.php +++ b/app/Twig/Extensions/ParseDateHelper.php @@ -158,8 +158,12 @@ private function getDateObject($date) return $date; } + if($date instanceof \DateTime) { + $date = $date->format('d.m.Y H:i:s'); + } + // If it's a valid date format or a DateTime object we can simply call the constructor - if (is_int($date) || @strtotime($date) !== false || $date == null || $date instanceof \DateTime) { + if (is_int($date) || @strtotime($date) !== false || $date == null) { $date = new TransDate($date); } else { throw new DateInvalidObjectException; diff --git a/composer.json b/composer.json index 7a7afd50..e6ffaa57 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,6 @@ "laravel/framework": "~5.0", "rcrowe/twigbridge": "~0.7", "mccool/laravel-auto-presenter": "~3.0@beta", - "kalnoy/nestedset": "~2.0", "laravelcollective/html": "~5.0", "mybb/auth": "dev-master", "mybb/parser": "dev-master", diff --git a/composer.lock b/composer.lock index 3445697d..d12a0b68 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "27dcab108e50a317c5f04a1e8a7df189", + "hash": "40997cc117a192551442d516f2956ebd", "packages": [ { "name": "classpreloader/classpreloader", @@ -1003,64 +1003,18 @@ ], "time": "2015-03-11 20:06:43" }, - { - "name": "kalnoy/nestedset", - "version": "v2.4.2", - "source": { - "type": "git", - "url": "https://github.com/lazychaser/laravel-nestedset.git", - "reference": "186c4fcc863dbfbb0fab744253da70f589b60cec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/186c4fcc863dbfbb0fab744253da70f589b60cec", - "reference": "186c4fcc863dbfbb0fab744253da70f589b60cec", - "shasum": "" - }, - "require": { - "illuminate/database": ">=4.1,<5.1.0", - "illuminate/events": ">=4.1,<5.1.0", - "illuminate/support": ">=4.1,<5.1.0", - "php": ">=5.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Kalnoy\\Nestedset\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexander Kalnoy", - "email": "lazychaser@gmail.com" - } - ], - "description": "Nested Set Model for Laravel 4", - "keywords": [ - "database", - "hierarchy", - "laravel", - "nested sets", - "nsm" - ], - "time": "2015-03-29 18:44:32" - }, { "name": "laravel/framework", - "version": "v5.0.28", + "version": "v5.0.31", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "06a09429322cf53e5bd4587db1060f02a291562e" + "reference": "db0a7400465df159ba8c6eaa954f97f50bc19687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/06a09429322cf53e5bd4587db1060f02a291562e", - "reference": "06a09429322cf53e5bd4587db1060f02a291562e", + "url": "https://api.github.com/repos/laravel/framework/zipball/db0a7400465df159ba8c6eaa954f97f50bc19687", + "reference": "db0a7400465df159ba8c6eaa954f97f50bc19687", "shasum": "" }, "require": { @@ -1173,20 +1127,20 @@ "framework", "laravel" ], - "time": "2015-04-21 01:44:32" + "time": "2015-05-11 22:15:00" }, { "name": "laravelcollective/html", - "version": "v5.0.2", + "version": "v5.0.4", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "9af203053815cb12c9b8307e8367153c84fdd4b7" + "reference": "c55fda58b1a9a1b58bd04f97e0fb9ebc238a0a94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/9af203053815cb12c9b8307e8367153c84fdd4b7", - "reference": "9af203053815cb12c9b8307e8367153c84fdd4b7", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/c55fda58b1a9a1b58bd04f97e0fb9ebc238a0a94", + "reference": "c55fda58b1a9a1b58bd04f97e0fb9ebc238a0a94", "shasum": "" }, "require": { @@ -1223,7 +1177,7 @@ "email": "adam@laravelcollective.com" } ], - "time": "2015-03-10 15:59:48" + "time": "2015-05-06 14:23:37" }, { "name": "league/commonmark", @@ -1432,16 +1386,16 @@ }, { "name": "mccool/laravel-auto-presenter", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/ShawnMcCool/laravel-auto-presenter.git", - "reference": "fbde239dd9b3c9145e5f281fd585623181013b80" + "url": "https://github.com/laravel-auto-presenter/laravel-auto-presenter.git", + "reference": "846eee0565bf84d911c1d2cad81e707ec9ac2e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ShawnMcCool/laravel-auto-presenter/zipball/fbde239dd9b3c9145e5f281fd585623181013b80", - "reference": "fbde239dd9b3c9145e5f281fd585623181013b80", + "url": "https://api.github.com/repos/laravel-auto-presenter/laravel-auto-presenter/zipball/846eee0565bf84d911c1d2cad81e707ec9ac2e9c", + "reference": "846eee0565bf84d911c1d2cad81e707ec9ac2e9c", "shasum": "" }, "require": { @@ -1454,7 +1408,6 @@ "php": ">=5.5.0" }, "require-dev": { - "fabpot/php-cs-fixer": "~1.2", "graham-campbell/testbench": "~2.0" }, "type": "library", @@ -1489,7 +1442,7 @@ "lpm", "presenter" ], - "time": "2015-02-04 19:20:36" + "time": "2015-05-18 10:21:57" }, { "name": "monolog/monolog", @@ -1642,18 +1595,18 @@ "source": { "type": "git", "url": "git@github.com:mybb/Auth.git", - "reference": "7e58dca92aacf51c189d0fcdd738ff825dbee1b1" + "reference": "f446d175db8fbbef689fd9af9a189b116e047759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mybb/Auth/zipball/7e58dca92aacf51c189d0fcdd738ff825dbee1b1", - "reference": "7e58dca92aacf51c189d0fcdd738ff825dbee1b1", + "url": "https://api.github.com/repos/mybb/Auth/zipball/f446d175db8fbbef689fd9af9a189b116e047759", + "reference": "f446d175db8fbbef689fd9af9a189b116e047759", "shasum": "" }, "require": { - "illuminate/auth": "~5.0", - "illuminate/hashing": "~5.0", - "illuminate/support": "~5.0" + "illuminate/auth": "5.0.*|5.1.*", + "illuminate/hashing": "5.0.*|5.1.*", + "illuminate/support": "5.0.*|5.1.*" }, "type": "library", "autoload": { @@ -1662,7 +1615,7 @@ } }, "license": [ - "LGPL3" + "BSD-3" ], "description": "The authentication system used by MyBB 2", "keywords": [ @@ -1674,7 +1627,7 @@ "source": "https://github.com/mybb/Auth/tree/master", "issues": "https://github.com/mybb/Auth/issues" }, - "time": "2015-04-22 10:35:06" + "time": "2015-05-12 13:27:55" }, { "name": "mybb/gravatar", @@ -1723,18 +1676,18 @@ "source": { "type": "git", "url": "git@github.com:mybb/Parser.git", - "reference": "4cbff9a1f0da1e282015d13aaca07c25a7f199b7" + "reference": "d64364a9bd19da37824f6c9766b044d142ac4974" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mybb/Parser/zipball/4cbff9a1f0da1e282015d13aaca07c25a7f199b7", - "reference": "4cbff9a1f0da1e282015d13aaca07c25a7f199b7", + "url": "https://api.github.com/repos/mybb/Parser/zipball/d64364a9bd19da37824f6c9766b044d142ac4974", + "reference": "d64364a9bd19da37824f6c9766b044d142ac4974", "shasum": "" }, "require": { "ezyang/htmlpurifier": "~4.6", - "illuminate/database": "~5.0", - "illuminate/support": "~5.0", + "illuminate/database": "5.0.*|5.1.*", + "illuminate/support": "5.0.*|5.1.*", "league/commonmark": "0.6.*@dev" }, "type": "library", @@ -1744,7 +1697,7 @@ } }, "license": [ - "LGPL3" + "BSD-3" ], "description": "The parser used by MyBB 2. Supports BBCode, Markdown and HTML", "keywords": [ @@ -1756,7 +1709,7 @@ "source": "https://github.com/mybb/Parser/tree/master", "issues": "https://github.com/mybb/Parser/issues" }, - "time": "2015-04-22 10:38:44" + "time": "2015-05-12 13:30:28" }, { "name": "mybb/settings", @@ -1764,20 +1717,20 @@ "source": { "type": "git", "url": "git@github.com:mybb/Settings.git", - "reference": "bde7a8f6b59ef07787f7dd6845e7cca698c1db9d" + "reference": "6fb2970fae628ee2435d8ed5611ed3f18bdc8b4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mybb/Settings/zipball/bde7a8f6b59ef07787f7dd6845e7cca698c1db9d", - "reference": "bde7a8f6b59ef07787f7dd6845e7cca698c1db9d", + "url": "https://api.github.com/repos/mybb/Settings/zipball/6fb2970fae628ee2435d8ed5611ed3f18bdc8b4d", + "reference": "6fb2970fae628ee2435d8ed5611ed3f18bdc8b4d", "shasum": "" }, "require": { - "illuminate/auth": "~5.0", - "illuminate/cache": "~5.0", - "illuminate/config": "~5.0", - "illuminate/database": "~5.0", - "illuminate/support": "~5.0", + "illuminate/auth": "5.0.*|5.1.*", + "illuminate/cache": "5.0.*|5.1.*", + "illuminate/config": "5.0.*|5.1.*", + "illuminate/database": "5.0.*|5.1.*", + "illuminate/support": "5.0.*|5.1.*", "php": ">=5.4.0" }, "type": "library", @@ -1787,7 +1740,7 @@ } }, "license": [ - "MIT" + "BSD-3" ], "authors": [ { @@ -1800,7 +1753,7 @@ "source": "https://github.com/mybb/Settings/tree/master", "issues": "https://github.com/mybb/Settings/issues" }, - "time": "2015-04-22 10:41:23" + "time": "2015-05-12 13:30:55" }, { "name": "nesbot/carbon", @@ -1850,16 +1803,16 @@ }, { "name": "nikic/php-parser", - "version": "v1.2.2", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "08f97eb4efa029e2fafb6d8c98b71731bf0cf621" + "reference": "dff239267fd1befa1cd40430c9ed12591aa720ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/08f97eb4efa029e2fafb6d8c98b71731bf0cf621", - "reference": "08f97eb4efa029e2fafb6d8c98b71731bf0cf621", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dff239267fd1befa1cd40430c9ed12591aa720ca", + "reference": "dff239267fd1befa1cd40430c9ed12591aa720ca", "shasum": "" }, "require": { @@ -1869,7 +1822,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1891,7 +1844,7 @@ "parser", "php" ], - "time": "2015-04-03 14:33:59" + "time": "2015-05-02 15:40:40" }, { "name": "psr/log", @@ -2004,21 +1957,21 @@ }, { "name": "rcrowe/twigbridge", - "version": "v0.7.0", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/rcrowe/TwigBridge.git", - "reference": "458f875e142e9ff1a34917454998b1b0f24b8b95" + "reference": "838d9c4f1c2306dddf7609daeb6ad6429249b242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/458f875e142e9ff1a34917454998b1b0f24b8b95", - "reference": "458f875e142e9ff1a34917454998b1b0f24b8b95", + "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/838d9c4f1c2306dddf7609daeb6ad6429249b242", + "reference": "838d9c4f1c2306dddf7609daeb6ad6429249b242", "shasum": "" }, "require": { - "illuminate/support": "5.0.*", - "illuminate/view": "5.0.*", + "illuminate/support": "5.0.*|5.1.*", + "illuminate/view": "5.0.*|5.1.*", "php": ">=5.4.0", "twig/twig": "~1.15" }, @@ -2064,7 +2017,7 @@ "laravel", "twig" ], - "time": "2015-03-17 11:29:29" + "time": "2015-05-17 16:02:25" }, { "name": "swiftmailer/swiftmailer", @@ -2120,17 +2073,17 @@ }, { "name": "symfony/console", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667" + "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/5b91dc4ed5eb08553f57f6df04c4730a73992667", - "reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667", + "url": "https://api.github.com/repos/symfony/Console/zipball/ebc5679854aa24ed7d65062e9e3ab0b18a917272", + "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272", "shasum": "" }, "require": { @@ -2163,32 +2116,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Console Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/debug", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Debug", "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "d49a46a20a8f0544aedac54466750ad787d3d3e3" + "reference": "ad4511a8fddce7ec163b513ba39a30ea4f32c9e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/d49a46a20a8f0544aedac54466750ad787d3d3e3", - "reference": "d49a46a20a8f0544aedac54466750ad787d3d3e3", + "url": "https://api.github.com/repos/symfony/Debug/zipball/ad4511a8fddce7ec163b513ba39a30ea4f32c9e7", + "reference": "ad4511a8fddce7ec163b513ba39a30ea4f32c9e7", "shasum": "" }, "require": { @@ -2224,32 +2177,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Debug Component", - "homepage": "http://symfony.com", - "time": "2015-03-22 16:55:57" + "homepage": "https://symfony.com", + "time": "2015-05-08 13:17:44" }, { "name": "symfony/event-dispatcher", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" + "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", - "reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/672593bc4b0043a0acf91903bb75a1c82d8f2e02", + "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02", "shasum": "" }, "require": { @@ -2283,32 +2236,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com", - "time": "2015-03-13 17:37:22" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/filesystem", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "4983964b3693e4f13449cb3800c64a9112c301b4" + "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/4983964b3693e4f13449cb3800c64a9112c301b4", - "reference": "4983964b3693e4f13449cb3800c64a9112c301b4", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/f73904bd2dae525c42ea1f0340c7c98480ecacde", + "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde", "shasum": "" }, "require": { @@ -2333,32 +2286,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Filesystem Component", - "homepage": "http://symfony.com", - "time": "2015-03-22 16:55:57" + "homepage": "https://symfony.com", + "time": "2015-05-08 00:09:07" }, { "name": "symfony/finder", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Finder", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "5dbe2e73a580618f5b4880fda93406eed25de251" + "reference": "704c64c8b12c8882640d5c0330a8414b1e06dc99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/5dbe2e73a580618f5b4880fda93406eed25de251", - "reference": "5dbe2e73a580618f5b4880fda93406eed25de251", + "url": "https://api.github.com/repos/symfony/Finder/zipball/704c64c8b12c8882640d5c0330a8414b1e06dc99", + "reference": "704c64c8b12c8882640d5c0330a8414b1e06dc99", "shasum": "" }, "require": { @@ -2383,32 +2336,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Finder Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/http-foundation", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "8a6337233f08f7520de97f4ffd6f00e947d892f9" + "reference": "8a0d00980ef9f6b47ddbf24bdfbf70fead760816" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8a6337233f08f7520de97f4ffd6f00e947d892f9", - "reference": "8a6337233f08f7520de97f4ffd6f00e947d892f9", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8a0d00980ef9f6b47ddbf24bdfbf70fead760816", + "reference": "8a0d00980ef9f6b47ddbf24bdfbf70fead760816", "shasum": "" }, "require": { @@ -2437,32 +2390,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony HttpFoundation Component", - "homepage": "http://symfony.com", - "time": "2015-04-01 16:50:12" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/http-kernel", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "3829cacfe21eaf3f73604a62d79183d1f6e792c4" + "reference": "2010194de0a57731af9404c7f97fd300db98b7a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/3829cacfe21eaf3f73604a62d79183d1f6e792c4", - "reference": "3829cacfe21eaf3f73604a62d79183d1f6e792c4", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/2010194de0a57731af9404c7f97fd300db98b7a3", + "reference": "2010194de0a57731af9404c7f97fd300db98b7a3", "shasum": "" }, "require": { @@ -2515,32 +2468,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony HttpKernel Component", - "homepage": "http://symfony.com", - "time": "2015-04-01 16:55:26" + "homepage": "https://symfony.com", + "time": "2015-05-11 01:58:49" }, { "name": "symfony/process", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552" + "reference": "9f3c4baaf840ed849e1b1f7bfd5ae246e8509562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/a8bebaec1a9dc6cde53e0250e32917579b0be552", - "reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552", + "url": "https://api.github.com/repos/symfony/Process/zipball/9f3c4baaf840ed849e1b1f7bfd5ae246e8509562", + "reference": "9f3c4baaf840ed849e1b1f7bfd5ae246e8509562", "shasum": "" }, "require": { @@ -2565,32 +2518,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Process Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/routing", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Routing", "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "4e173a645b63ff60a124f3741b4f15feebd908fa" + "reference": "1455ec537940f7428ea6aa9411f3c4bca69413a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/4e173a645b63ff60a124f3741b4f15feebd908fa", - "reference": "4e173a645b63ff60a124f3741b4f15feebd908fa", + "url": "https://api.github.com/repos/symfony/Routing/zipball/1455ec537940f7428ea6aa9411f3c4bca69413a0", + "reference": "1455ec537940f7428ea6aa9411f3c4bca69413a0", "shasum": "" }, "require": { @@ -2628,28 +2581,28 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Routing Component", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "router", "routing", "uri", "url" ], - "time": "2015-03-30 15:54:10" + "time": "2015-05-02 15:18:45" }, { "name": "symfony/security-core", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Security/Core", "source": { "type": "git", @@ -2713,17 +2666,17 @@ }, { "name": "symfony/translation", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Translation", "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af" + "reference": "398e0eedcb89243ad34a10d079a4b6ea4c0b61ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/bd939f05cdaca128f4ddbae1b447d6f0203b60af", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af", + "url": "https://api.github.com/repos/symfony/Translation/zipball/398e0eedcb89243ad34a10d079a4b6ea4c0b61ff", + "reference": "398e0eedcb89243ad34a10d079a4b6ea4c0b61ff", "shasum": "" }, "require": { @@ -2757,32 +2710,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Translation Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-05 16:51:00" }, { "name": "symfony/var-dumper", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/VarDumper", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "aafae00236e147568832de3c65ccb94cfc836278" + "reference": "89eec96645fb44af4a454a26c74c72ba6311f5bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/aafae00236e147568832de3c65ccb94cfc836278", - "reference": "aafae00236e147568832de3c65ccb94cfc836278", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89eec96645fb44af4a454a26c74c72ba6311f5bc", + "reference": "89eec96645fb44af4a454a26c74c72ba6311f5bc", "shasum": "" }, "require": { @@ -2813,22 +2766,22 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "debug", "dump" ], - "time": "2015-03-31 08:12:29" + "time": "2015-05-01 14:14:24" }, { "name": "twig/twig", @@ -3054,12 +3007,12 @@ "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "9e212ed7f598929d491563d01d221155e358a2a3" + "reference": "3640cf6a43976edd3e508e00588b19680e9c50bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/9e212ed7f598929d491563d01d221155e358a2a3", - "reference": "9e212ed7f598929d491563d01d221155e358a2a3", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/3640cf6a43976edd3e508e00588b19680e9c50bd", + "reference": "3640cf6a43976edd3e508e00588b19680e9c50bd", "shasum": "" }, "require": { @@ -3104,21 +3057,21 @@ "email": "fabien@symfony.com" } ], - "description": "A script to automatically fix Symfony Coding Standard", - "time": "2015-04-22 08:14:17" + "description": "A tool to automatically fix PHP code style", + "time": "2015-05-19 06:43:29" }, { "name": "hamcrest/hamcrest-php", - "version": "v1.2.1", + "version": "v1.2.2", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "ac50c470531243944f977b8de75be0b684a9cb51" + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/ac50c470531243944f977b8de75be0b684a9cb51", - "reference": "ac50c470531243944f977b8de75be0b684a9cb51", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", "shasum": "" }, "require": { @@ -3150,7 +3103,7 @@ "keywords": [ "test" ], - "time": "2015-01-20 19:34:09" + "time": "2015-05-11 14:41:42" }, { "name": "league/climate", @@ -3485,16 +3438,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.4.0", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5" + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", - "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", "shasum": "" }, "require": { @@ -3541,7 +3494,7 @@ "spy", "stub" ], - "time": "2015-03-27 19:31:25" + "time": "2015-04-27 22:15:08" }, { "name": "phpunit/php-code-coverage", @@ -3791,16 +3744,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.6.4", + "version": "4.6.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "163232991e652e6efed2f8470326fffa61e848e2" + "reference": "3afe303d873a4d64c62ef84de491b97b006fbdac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", - "reference": "163232991e652e6efed2f8470326fffa61e848e2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3afe303d873a4d64c62ef84de491b97b006fbdac", + "reference": "3afe303d873a4d64c62ef84de491b97b006fbdac", "shasum": "" }, "require": { @@ -3859,7 +3812,7 @@ "testing", "xunit" ], - "time": "2015-04-11 05:23:21" + "time": "2015-04-29 15:18:52" }, { "name": "phpunit/phpunit-mock-objects", @@ -4342,16 +4295,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.3.1", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1" + "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1", - "reference": "f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e96d8579fbed0c95ecf2a0501ec4f307a4aa6404", + "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404", "shasum": "" }, "require": { @@ -4412,21 +4365,21 @@ "phpcs", "standards" ], - "time": "2015-04-23 03:40:59" + "time": "2015-04-28 23:28:20" }, { "name": "symfony/stopwatch", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "5f196e84b5640424a166d2ce9cca161ce1e9d912" + "reference": "b470f87c69837cb71115f1fa720388bb19b63635" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/5f196e84b5640424a166d2ce9cca161ce1e9d912", - "reference": "5f196e84b5640424a166d2ce9cca161ce1e9d912", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b470f87c69837cb71115f1fa720388bb19b63635", + "reference": "b470f87c69837cb71115f1fa720388bb19b63635", "shasum": "" }, "require": { @@ -4451,32 +4404,32 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Stopwatch Component", - "homepage": "http://symfony.com", - "time": "2015-03-22 16:55:57" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" }, { "name": "symfony/yaml", - "version": "v2.6.6", + "version": "v2.6.7", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "174f009ed36379a801109955fc5a71a49fe62dd4" + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", - "reference": "174f009ed36379a801109955fc5a71a49fe62dd4", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/f157ab074e453ecd4c0fa775f721f6e67a99d9e2", + "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2", "shasum": "" }, "require": { @@ -4501,18 +4454,18 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-02 15:18:45" } ], "aliases": [], From bf8d877c84ad226a63e0f6e7e88ba4648d8df920 Mon Sep 17 00:00:00 2001 From: JN-Jones Date: Fri, 22 May 2015 12:54:28 +0200 Subject: [PATCH 02/10] Fix some more queries --- .../Eloquent/ConversationRepository.php | 31 +++++++++++-------- app/Presenters/Poll.php | 6 ++-- resources/views/polls/show.twig | 2 +- resources/views/topic/polls.twig | 4 +-- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/Database/Repositories/Eloquent/ConversationRepository.php b/app/Database/Repositories/Eloquent/ConversationRepository.php index aeb995d9..e6922ace 100644 --- a/app/Database/Repositories/Eloquent/ConversationRepository.php +++ b/app/Database/Repositories/Eloquent/ConversationRepository.php @@ -48,6 +48,11 @@ class ConversationRepository implements ConversationRepositoryInterface */ private $settings; + /** + * @var Collection[] + */ + private $unreadCache; + /** * @param Conversation $conversationModel * @param DatabaseManager $dbManager @@ -106,23 +111,23 @@ public function getForUser(User $user) */ public function getUnreadForUser(User $user) { - // TODO: this is a big query, should probably be cached (at least for the request) - /** @var Collection $conversations */ - $conversations = $this->conversationModel - ->join('conversation_users', function ($join) use ($user) { - $join->on('conversation_users.conversation_id', '=', 'conversations.id'); - $join->where('conversation_users.user_id', '=', $user->id); - }) - ->join('conversation_messages', 'conversation_messages.id', '=', 'conversations.last_message_id') + if(!isset($this->unreadCache[$user->id])) { + /** @var Collection $conversations */ + $this->unreadCache[$user->id] = $this->conversationModel + ->join('conversation_users', function ($join) use ($user) { + $join->on('conversation_users.conversation_id', '=', 'conversations.id'); + $join->where('conversation_users.user_id', '=', $user->id); + }) + ->join('conversation_messages', 'conversation_messages.id', '=', 'conversations.last_message_id') // ->where(function ($query) { // $query->where('conversation_messages.created_at', '>', 'conversation_users.last_read') // ->orWhere('conversation_users.last_read', null); // }) - ->where('conversation_users.ignores', false) - ->orderBy('conversation_messages.created_at', 'desc') - ->get(['conversations.*', 'conversation_messages.created_at', 'conversation_users.last_read']); - - return $conversations->filter(function ($conversation) { + ->where('conversation_users.ignores', false) + ->orderBy('conversation_messages.created_at', 'desc') + ->get(['conversations.*', 'conversation_messages.created_at', 'conversation_users.last_read']); + } + return $this->unreadCache[$user->id]->filter(function ($conversation) { if ($conversation->last_read == null) { return true; } diff --git a/app/Presenters/Poll.php b/app/Presenters/Poll.php index 32168fed..f5624455 100644 --- a/app/Presenters/Poll.php +++ b/app/Presenters/Poll.php @@ -134,8 +134,10 @@ public function myVote() $this->guard->user(), $this->wrappedObject ); - } else { - $this->cache['myVote'] = null; + } + + if ($this->cache['myVote'] === null) { + $this->cache['myVote'] = false; } } diff --git a/resources/views/polls/show.twig b/resources/views/polls/show.twig index 6e65f2b4..b386e9e2 100644 --- a/resources/views/polls/show.twig +++ b/resources/views/polls/show.twig @@ -19,7 +19,7 @@