Use aliases when migrating data. Fixes #2240
This commit is contained in:
@@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Integrations\Core;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
|
||||
/**
|
||||
* This is the core system class.
|
||||
@@ -22,6 +23,25 @@ use CachetHQ\Cachet\Models\Incident;
|
||||
*/
|
||||
class System implements SystemContract
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new system instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entire system status.
|
||||
*
|
||||
@@ -80,4 +100,16 @@ class System implements SystemContract
|
||||
{
|
||||
return CACHET_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the table prefix.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTablePrefix()
|
||||
{
|
||||
$driver = $this->config->get('database.default');
|
||||
|
||||
return $this->config->get("database.connections.{$driver}.prefix");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user