Kaydet (Commit) e62ee0af authored tarafından mertcelen's avatar mertcelen

Correct foreign key function added.

Package installation parameter change reverted.
üst 25fd0704
...@@ -12,14 +12,15 @@ use App\Models\AdminNotification; ...@@ -12,14 +12,15 @@ use App\Models\AdminNotification;
class ExtensionDependenciesJob implements ShouldQueue class ExtensionDependenciesJob implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $extension,$dependencies; private $extension;
private $dependencies;
/** /**
* Create a new job instance. * Create a new job instance.
* *
* @return void * @return void
*/ */
public function __construct($extension,$dependencies = "") public function __construct($extension, $dependencies = "")
{ {
$this->extension = $extension; $this->extension = $extension;
$this->dependencies = $dependencies; $this->dependencies = $dependencies;
...@@ -37,16 +38,16 @@ class ExtensionDependenciesJob implements ShouldQueue ...@@ -37,16 +38,16 @@ class ExtensionDependenciesJob implements ShouldQueue
{ {
$package = $this->dependencies; $package = $this->dependencies;
$tmp = "/tmp/" . str_random(16); $tmp = "/tmp/" . str_random(16);
$installCommand = "if [ -z '\$(find /var/cache/apt/pkgcache.bin -mmin -60)' ]; then sudo apt-get update; fi;DEBIAN_FRONTEND=noninteractive sudo apt-get install -o Dpkg::Use-Pty=0 -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' $package -qqy --allow >" . $tmp . " 2>&1"; $installCommand = "if [ -z '\$(find /var/cache/apt/pkgcache.bin -mmin -60)' ]; then sudo apt-get update; fi;DEBIAN_FRONTEND=noninteractive sudo apt-get install -o Dpkg::Use-Pty=0 -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' $package -qqy --force-yes >" . $tmp . " 2>&1";
rootSystem()->runCommand($installCommand); rootSystem()->runCommand($installCommand);
$checkCommand = "dpkg --get-selections | grep -v deinstall | awk '{print $1}' | grep -xE '" . str_replace(" ","|", $package) ."'"; $checkCommand = "dpkg --get-selections | grep -v deinstall | awk '{print $1}' | grep -xE '" . str_replace(" ", "|", $package) ."'";
$installed = rootSystem()->runCommand($checkCommand); $installed = rootSystem()->runCommand($checkCommand);
$dep = explode(" ",$this->dependencies); $dep = explode(" ", $this->dependencies);
sort($dep); sort($dep);
$installed = explode("\n",trim($installed)); $installed = explode("\n", trim($installed));
sort($installed); sort($installed);
if ($dep == $installed){ if ($dep == $installed) {
$this->extension->update([ $this->extension->update([
"status" => "1" "status" => "1"
]); ]);
...@@ -61,7 +62,7 @@ class ExtensionDependenciesJob implements ShouldQueue ...@@ -61,7 +62,7 @@ class ExtensionDependenciesJob implements ShouldQueue
" eklentisinin bağımlılıkları başarıyla yüklendi, hemen kullanmaya başlayabilirsiniz.", " eklentisinin bağımlılıkları başarıyla yüklendi, hemen kullanmaya başlayabilirsiniz.",
"level" => 3, "level" => 3,
]); ]);
}else{ } else {
AdminNotification::create([ AdminNotification::create([
"title" => "title" =>
$this->extension->display_name . " eklentisi kurulamadı!", $this->extension->display_name . " eklentisi kurulamadı!",
......
...@@ -14,7 +14,7 @@ class DeleteForeignFromPermissionsTable extends Migration ...@@ -14,7 +14,7 @@ class DeleteForeignFromPermissionsTable extends Migration
public function up() public function up()
{ {
Schema::table('permissions', function (Blueprint $table) { Schema::table('permissions', function (Blueprint $table) {
$table->removeForeignKey('permissions_morph_id_foreign'); $table->dropForeign('permissions_morph_id_foreign');
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment