Fixed issue with production database config not being used

This commit is contained in:
Hillel Coren 2015-02-08 20:04:36 +02:00
parent 65eb8c540c
commit dd718387ed
3 changed files with 8 additions and 5 deletions

View File

@ -59,19 +59,19 @@ class AppController extends BaseController
return Redirect::to('/setup')->withInput();
}
$content = "<?php return 'production';";
$content = "<?php return 'development';";
$fp = fopen(base_path()."/bootstrap/environment.php", 'w');
fwrite($fp, $content);
fclose($fp);
$configDir = app_path().'/config/production';
$configDir = app_path().'/config/development';
if (!file_exists($configDir)) {
mkdir($configDir);
}
foreach (['app' => $app, 'database' => $database, 'mail' => $mail] as $key => $config) {
$content = '<?php return '.var_export($config, true).';';
$fp = fopen(app_path()."/config/production/{$key}.php", 'w');
$fp = fopen(app_path()."/config/development/{$key}.php", 'w');
fwrite($fp, $content);
fclose($fp);
}

View File

@ -372,7 +372,10 @@ class InvoiceRepository
$clone->balance = $invoice->amount;
// if the invoice prefix is diff than quote prefix, use the same number for the invoice
if (($account->invoice_number_prefix || $account->quote_number_prefix) && $account->invoice_number_prefix != $account->quote_number_prefix) {
if (($account->invoice_number_prefix || $account->quote_number_prefix)
&& $account->invoice_number_prefix != $account->quote_number_prefix
&& $account->share_counter) {
$invoiceNumber = $invoice->invoice_number;
if (strpos($invoiceNumber, $account->quote_number_prefix) === 0) {
$invoiceNumber = substr($invoiceNumber, strlen($account->quote_number_prefix));

View File

@ -1,4 +1,4 @@
<?php
return 'production';
return 'development';