Commit e583a4d4 authored by Nicolas Widart's avatar Nicolas Widart

Squashed 'Modules/Core/' changes from dac4ddb..fac6305

fac6305 Rename install commend to asgard
d990488 Changing codeclimate badge
0400c94 Adding a temporary fix for laravel-translatable and baum

git-subtree-dir: Modules/Core
git-subtree-split: fac6305a232afd89bd2e9bf671515a89b99a4ac0
parent e5b410c6
...@@ -13,14 +13,14 @@ class InstallCommand extends Command ...@@ -13,14 +13,14 @@ class InstallCommand extends Command
* *
* @var string * @var string
*/ */
protected $name = 'platform:install'; protected $name = 'asgard:install';
/** /**
* The console command description. * The console command description.
* *
* @var string * @var string
*/ */
protected $description = 'Install the Platform CMS'; protected $description = 'Install Asgard CMS';
/** /**
* @var UserRepository * @var UserRepository
......
<?php namespace Modules\Core\Internationalisation;
trait Translatable
{
use \Dimsav\Translatable\Translatable;
public function save(array $options = array())
{
$tempTranslations = $this->translations;
if ($this->exists)
{
if (count($this->getDirty()) > 0)
{
// If $this->exists and dirty, parent::save() has to return true. If not,
// an error has occurred. Therefore we shouldn't save the translations.
if (parent::save($options))
{
$this->translations = $tempTranslations;
return $this->saveTranslations();
}
return false;
}
else
{
// If $this->exists and not dirty, parent::save() skips saving and returns
// false. So we have to save the translations
$this->translations = $tempTranslations;
return $this->saveTranslations();
}
}
elseif (parent::save($options))
{
// We save the translations only if the instance is saved in the database.
$this->translations = $tempTranslations;
return $this->saveTranslations();
}
return false;
}
}
...@@ -102,7 +102,7 @@ class CoreServiceProvider extends ServiceProvider ...@@ -102,7 +102,7 @@ class CoreServiceProvider extends ServiceProvider
*/ */
private function registerInstallCommand() private function registerInstallCommand()
{ {
$this->app->bindShared('command.platform.install', function($app) { $this->app->bindShared('command.asgard.install', function($app) {
return new InstallCommand( return new InstallCommand(
$app['Modules\User\Repositories\UserRepository'], $app['Modules\User\Repositories\UserRepository'],
$app['files'] $app['files']
...@@ -110,7 +110,7 @@ class CoreServiceProvider extends ServiceProvider ...@@ -110,7 +110,7 @@ class CoreServiceProvider extends ServiceProvider
}); });
$this->commands( $this->commands(
'command.platform.install' 'command.asgard.install'
); );
} }
} }
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/57e26b38-6275-4608-96e2-44047aaed5c2/mini.png)](https://insight.sensiolabs.com/projects/57e26b38-6275-4608-96e2-44047aaed5c2) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/57e26b38-6275-4608-96e2-44047aaed5c2/mini.png)](https://insight.sensiolabs.com/projects/57e26b38-6275-4608-96e2-44047aaed5c2)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AsgardCms/Core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AsgardCms/Core/?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AsgardCms/Core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AsgardCms/Core/?branch=master)
[![Code Climate](https://codeclimate.com/github/AsgardCms/Core/badges/gpa.svg)](https://codeclimate.com/github/AsgardCms/Core)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment