1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Fix regression where .env file was being deleted erroneously (#3515)

* Fixes for tests

* Fixes for self updates
This commit is contained in:
David Bomba 2020-03-23 07:45:16 +11:00 committed by GitHub
parent 54f3701cd5
commit c8e3c7ae68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 15 deletions

View File

@ -41,16 +41,6 @@ class ArtisanUpgrade extends Command
public function handle()
{
set_time_limit(0);
// Composer\Factory::getHomeDir() method
// needs COMPOSER_HOME environment variable set
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
// call `composer install` command programmatically
$input = new ArrayInput(array('command' => 'install'));
$application = new Application();
//$application->setAutoExit(false); // prevent `$application->run` method from exitting the script
$application->run($input);
try {
Artisan::call('migrate');
@ -69,5 +59,13 @@ class ArtisanUpgrade extends Command
} catch (Exception $e) {
\Log::error("I wasn't able to restart the queue");
}
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
$input = new ArrayInput(array('command' => 'install'));
$application = new Application();
//$application->setAutoExit(false); // prevent `$application->run` method from exitting the script
$application->run($input);
}
}

View File

@ -196,7 +196,7 @@ class CompanyGateway extends BaseModel
*/
public function getPublishableKey() :string
{
return $this->getConfigField('publishable_key');
return $this->getConfigField('publishableKey');
}
/**

View File

@ -59,7 +59,7 @@ class StripePaymentDriver extends BasePaymentDriver
*/
public function init() :void
{
Stripe::setApiKey($this->company_gateway->getConfigField('23_apiKey'));
Stripe::setApiKey($this->company_gateway->getConfigField('apiKey'));
}
/**

View File

@ -64,7 +64,7 @@ class Ninja
$data = trim(CurlUtils::post('https://license.invoiceninja.com/api/check', $data));
$data = json_decode($data);
if ($data->message == sha1(config('ninja.license'))) {
if ($data && property_exists($data, 'message') && $data->message == sha1(config('ninja.license'))) {
return false;
} else {
return true;

View File

@ -55,7 +55,6 @@ class SystemHealth
'dbs' => self::dbCheck(),
'mail' => self::testMailServer(),
'env_writable' => self::checkEnvWritable(),
'env_exists'
];
}
@ -122,6 +121,7 @@ class SystemHealth
private static function checkEnvWritable()
{
return @fopen(base_path().'/.env', 'w');
return is_writable(base_path().'/.env');
//return @fopen(base_path().'/.env', 'w');
}
}