Table prefixes not being added to indexes (#597)
* Enabled prefixes on any created indexes (multi-site install in single db) * Formatting * Check if enum label is looking for a translation * Return value * Fix view namespace across modules
This commit is contained in:
@@ -46,7 +46,12 @@ abstract class Enum
|
||||
final public static function label($value)
|
||||
{
|
||||
if (isset(static::$labels[$value])) {
|
||||
return trans(static::$labels[$value]);
|
||||
$val = static::$labels[$value];
|
||||
if (strpos($val, '.') !== false) {
|
||||
return trans($val);
|
||||
}
|
||||
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,14 @@ return [
|
||||
'username' => env('DB_USERNAME', ''),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
//'unix_socket' => env('DB_SOCKET', ''),
|
||||
'prefix' => env('DB_PREFIX', ''),
|
||||
'timezone' => '+00:00',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'strict' => false,
|
||||
'engine' => null,
|
||||
'options' => [
|
||||
'prefix' => env('DB_PREFIX', ''),
|
||||
'prefix_indexes' => true,
|
||||
'timezone' => '+00:00',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'strict' => false,
|
||||
'engine' => null,
|
||||
'options' => [
|
||||
PDO::ATTR_EMULATE_PREPARES => env('DB_EMULATE_PREPARES', false),
|
||||
//PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
],
|
||||
@@ -27,22 +28,25 @@ return [
|
||||
],
|
||||
],
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path('db.sqlite'),
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path('db.sqlite'),
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
'testing' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path('testing.sqlite'),
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path('testing.sqlite'),
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
'memory' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
'timezone' => '+00:00',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
@@ -36,6 +36,18 @@ class ImporterController extends Controller
|
||||
return view('importer::step1-configure');
|
||||
}
|
||||
|
||||
protected function testDb(Request $request)
|
||||
{
|
||||
$this->dbSvc->checkDbConnection(
|
||||
$request->post('db_conn'),
|
||||
$request->post('db_host'),
|
||||
$request->post('db_port'),
|
||||
$request->post('db_name'),
|
||||
$request->post('db_user'),
|
||||
$request->post('db_pass')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the database connection
|
||||
*
|
||||
@@ -49,14 +61,7 @@ class ImporterController extends Controller
|
||||
$message = 'Database connection looks good!';
|
||||
|
||||
try {
|
||||
$this->dbSvc->checkDbConnection(
|
||||
$request->post('db_conn'),
|
||||
$request->post('db_host'),
|
||||
$request->post('db_port'),
|
||||
$request->post('db_name'),
|
||||
$request->post('db_user'),
|
||||
$request->post('db_pass')
|
||||
);
|
||||
$this->testDb($request);
|
||||
} catch (\Exception $e) {
|
||||
$status = 'danger';
|
||||
$message = 'Failed! '.$e->getMessage();
|
||||
@@ -78,6 +83,8 @@ class ImporterController extends Controller
|
||||
public function config(Request $request)
|
||||
{
|
||||
try {
|
||||
$this->testDb($request);
|
||||
|
||||
// Save the credentials to use later
|
||||
$this->importerSvc->saveCredentialsFromRequest($request);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>@yield('title') - importer</title>
|
||||
<title>@yield('title') - installer</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/>
|
||||
|
||||
@@ -35,35 +35,29 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-toggleable-md" style="background: #067ec1;">
|
||||
<div class="container" style="width: 85%!important;">
|
||||
<div class="navbar-translate">
|
||||
<p class="navbar-brand text-white" data-placement="bottom" target="_blank">
|
||||
<a href="{{ url('/') }}">
|
||||
<img src="{{ public_asset('/assets/img/logo_blue_bg.svg') }}" width="135px" style=""/>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="justify-content-center" id="navigation" style="margin-left: 50px; color: white; font-size: 20px;">
|
||||
@yield('title')
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- End Navbar -->
|
||||
{{--<div class="clearfix" style="height: 25px;"></div>--}}
|
||||
<div class="wrapper">
|
||||
<div class="clear"></div>
|
||||
<div class="container" style="width: 50%">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('importer::flash.message')
|
||||
@yield('content')
|
||||
<body class="login-page" style="background: #067ec1;">
|
||||
<div class="page-header clear-filter">
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 ml-auto mr-auto content-center">
|
||||
<div class="p-10" style="padding: 10px 0;">
|
||||
<img src="{{ public_asset('/assets/img/logo_blue_bg.svg') }}" width="135px" style="" alt=""/>
|
||||
</div>
|
||||
<div class="card card-login card-plain" style="background: #FFF">
|
||||
<div class="card-header text-center">
|
||||
<h3 class="card-title title">@yield('title')</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<hr />
|
||||
@include('importer::flash.message')
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix" style="height: 200px;"></div>
|
||||
</div>
|
||||
|
||||
{{--<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>--}}
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
@section('content')
|
||||
<div style="align-content: center;">
|
||||
{{ Form::open(['route' => 'importer.config', 'method' => 'POST']) }}
|
||||
<table class="table" width="25%">
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h4>IMPORTANT NOTES</h4>
|
||||
@@ -24,25 +23,12 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><h4>Site Config</h4>
|
||||
<p>Enter the database information for your legacy (v2 or v5) database</p>
|
||||
<td colspan="2">
|
||||
<h4>Database Config</h4>
|
||||
<p>Enter the database information for your legacy phpVMS installation</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Admin Email</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{{ Form::input('text', 'email', '', ['class' => 'form-control']) }}
|
||||
<p>The admin's email address, the password for this will be reset</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><h4>Database Config</h4></td>
|
||||
</tr>
|
||||
|
||||
<tbody id="mysql_settings">
|
||||
<tr>
|
||||
<td>Database Host</td>
|
||||
|
||||
@@ -62,7 +62,6 @@ class ImporterService extends Service
|
||||
public function saveCredentialsFromRequest(Request $request)
|
||||
{
|
||||
$creds = [
|
||||
'admin_email' => $request->post('email'),
|
||||
'host' => $request->post('db_host'),
|
||||
'port' => $request->post('db_port'),
|
||||
'name' => $request->post('db_name'),
|
||||
|
||||
@@ -64,18 +64,6 @@
|
||||
<div class="card card-login card-plain" style="background: #FFF">
|
||||
<div class="card-header text-center">
|
||||
<h3 class="card-title title">@yield('title')</h3>
|
||||
|
||||
{{--<div class="text-large">
|
||||
<a href="#" onclick="return false;" class="btn btn-neutral btn-facebook btn-icon btn-round">
|
||||
<i class="now-ui-icons design_bullet-list-02"></i>
|
||||
</a>
|
||||
<a href="#" onclick="return false;" class="btn btn-neutral btn-twitter btn-icon btn-lg btn-round">
|
||||
<i class="now-ui-icons users_single-02"></i>
|
||||
</a>
|
||||
<a href="#" onclick="return false;" class="btn btn-neutral btn-google btn-icon btn-round">
|
||||
<i class="now-ui-icons users_single-02"></i>
|
||||
</a>
|
||||
</div>--}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<hr />
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><h4>php extensions</h4></td>
|
||||
<td colspan="2"><h4>PHP Extensions</h4></td>
|
||||
</tr>
|
||||
@foreach($extensions as $ext)
|
||||
<tr>
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h4>directory permissions</h4>
|
||||
<h4>Directory Permissions</h4>
|
||||
<p>Make sure these directories have read and write permissions</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -28,7 +28,10 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><h4>Database Config</h4></td>
|
||||
<td colspan="2">
|
||||
<h4>Database Config</h4>
|
||||
<p>Enter the target database information</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>@yield('title') - updater</title>
|
||||
<title>@yield('title') - installer</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/>
|
||||
|
||||
@@ -35,35 +35,29 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-toggleable-md" style="background: #067ec1;">
|
||||
<div class="container" style="width: 85%!important;">
|
||||
<div class="navbar-translate">
|
||||
<p class="navbar-brand text-white" data-placement="bottom" target="_blank">
|
||||
<a href="{{ url('/') }}">
|
||||
<img src="{{ public_asset('/assets/img/logo_blue_bg.svg') }}" width="135px" style=""/>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="justify-content-center" id="navigation" style="margin-left: 50px; color: white; font-size: 20px;">
|
||||
@yield('title')
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- End Navbar -->
|
||||
{{--<div class="clearfix" style="height: 25px;"></div>--}}
|
||||
<div class="wrapper">
|
||||
<div class="clear"></div>
|
||||
<div class="container" style="width: 50%">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('installer::flash.message')
|
||||
@yield('content')
|
||||
<body class="login-page" style="background: #067ec1;">
|
||||
<div class="page-header clear-filter">
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 ml-auto mr-auto content-center">
|
||||
<div class="p-10" style="padding: 10px 0;">
|
||||
<img src="{{ public_asset('/assets/img/logo_blue_bg.svg') }}" width="135px" style="" alt=""/>
|
||||
</div>
|
||||
<div class="card card-login card-plain" style="background: #FFF">
|
||||
<div class="card-header text-center">
|
||||
<h3 class="card-title title">@yield('title')</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<hr />
|
||||
@include('updater::flash.message')
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix" style="height: 200px;"></div>
|
||||
</div>
|
||||
|
||||
{{--<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>--}}
|
||||
|
||||
@@ -64,12 +64,13 @@ return [
|
||||
'default' => env('DB_CONNECTION', '$DB_CONN$'),
|
||||
'connections' => [
|
||||
'mysql' => [
|
||||
'host' => env('DB_HOST', '$DB_HOST$'),
|
||||
'port' => $DB_PORT$,
|
||||
'database' => '$DB_NAME$',
|
||||
'username' => '$DB_USER$',
|
||||
'password' => '$DB_PASS$',
|
||||
'prefix' => '$DB_PREFIX$',
|
||||
'host' => env('DB_HOST', '$DB_HOST$'),
|
||||
'port' => $DB_PORT$,
|
||||
'database' => '$DB_NAME$',
|
||||
'username' => '$DB_USER$',
|
||||
'password' => '$DB_PASS$',
|
||||
'prefix' => '$DB_PREFIX$',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user