mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Import Demo Categories From Remote Source
This commit is contained in:
parent
6de876353d
commit
0ca1b71cef
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
<?php namespace Visiosoft\CatsModule;
|
<?php namespace Visiosoft\CatsModule;
|
||||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||||
|
use Chumper\Zipper\Zipper;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Visiosoft\CatsModule\Category\CategorySeeder;
|
use Visiosoft\CatsModule\Category\CategorySeeder;
|
||||||
@ -13,10 +14,20 @@ class CatsModuleSeeder extends Seeder
|
|||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$this->call(CategorySeeder::class);
|
$this->call(CategorySeeder::class);
|
||||||
|
|
||||||
|
//Download demo SQL
|
||||||
|
file_put_contents(__DIR__."/categories.sql", fopen("http://ilandemo.vebze.com/categories.sql", 'r'));
|
||||||
|
file_put_contents(__DIR__."/categoryTransEn.sql", fopen("http://ilandemo.vebze.com/categoryTransEn.sql", 'r'));
|
||||||
|
//Download demo Files and Extract to Files
|
||||||
|
file_put_contents("category-files.zip", fopen("http://ilandemo.vebze.com/category-files.zip", 'r'));
|
||||||
|
$zipper = new Zipper();
|
||||||
|
$zipper->make('category-files.zip')->folder('category-files')->extractTo(base_path().'/public/app/default/files-module/local/images/');
|
||||||
|
$zipper->close();
|
||||||
|
|
||||||
$this->call(PlaceholderforsearchSeeder::class);
|
$this->call(PlaceholderforsearchSeeder::class);
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
DB::unprepared(file_get_contents(__DIR__.'/Category/categories.sql'));
|
DB::unprepared(file_get_contents(__DIR__.'/categories.sql'));
|
||||||
DB::unprepared(file_get_contents(__DIR__.'/Category/categoryTransEn.sql'));
|
DB::unprepared(file_get_contents(__DIR__.'/categoryTransEn.sql'));
|
||||||
Model::reguard();
|
Model::reguard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user