mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
update
This commit is contained in:
parent
093ac611b7
commit
28a9f2392d
3 changed files with 14 additions and 5 deletions
|
@ -36,7 +36,7 @@ class CreateDailyFullHostingSubscriptionsBackup extends Command
|
|||
public function handle()
|
||||
{
|
||||
// Find Hosting Subscriptions
|
||||
$findHostingSubscriptions = HostingSubscription::limit(1)->get();
|
||||
$findHostingSubscriptions = HostingSubscription::all();
|
||||
if ($findHostingSubscriptions->count() > 0) {
|
||||
foreach ($findHostingSubscriptions as $hostingSubscription) {
|
||||
|
||||
|
|
|
@ -4,6 +4,15 @@ namespace App;
|
|||
|
||||
class Helpers
|
||||
{
|
||||
public static function extractZip($tarFile, $extractPath)
|
||||
{
|
||||
shell_exec('mkdir -p ' . $extractPath);
|
||||
|
||||
$exec = shell_exec('unzip -o ' . $tarFile . ' -d ' . $extractPath);
|
||||
|
||||
return $exec;
|
||||
}
|
||||
|
||||
public static function extractTar($tarFile, $extractPath)
|
||||
{
|
||||
shell_exec('mkdir -p ' . $extractPath);
|
||||
|
|
|
@ -87,14 +87,14 @@ class HostingSubscriptionBackupTest extends ActionTestCase
|
|||
|
||||
$getFilesize = filesize($findBackup->file_path);
|
||||
$this->assertGreaterThan(0, $getFilesize);
|
||||
$this->assertSame(Helpers::checkPathSize($findBackup->path), $findBackup->size);
|
||||
$this->assertSame($getFilesize, $findBackup->size);
|
||||
|
||||
Helpers::extractTar($findBackup->file_path, $findBackup->path . '/unit-test');
|
||||
Helpers::extractZip($findBackup->file_path, $findBackup->path . '/unit-test');
|
||||
//
|
||||
// dd($chs);
|
||||
$findDatabase = Database::where('id', $chs['databaseId'])->first();
|
||||
|
||||
$extractedDatabase = $findBackup->path . '/unit-test/' . $findDatabase->database_name_prefix . $findDatabase->database_name . '.sql';
|
||||
$extractedDatabase = $findBackup->path . '/unit-test/databases/' . $findDatabase->database_name_prefix . $findDatabase->database_name . '.sql';
|
||||
|
||||
$this->assertTrue(file_exists($extractedDatabase));
|
||||
$extractedDatabaseContent = file_get_contents($extractedDatabase);
|
||||
$this->assertNotEmpty($extractedDatabaseContent);
|
||||
|
|
Loading…
Reference in a new issue