Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5c9198
commit c998d82
Showing
7 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "knowfox/drupal7", | ||
"description": "Import the Drupal7 blog from https://olav.net .", | ||
"type": "library", | ||
"require": { | ||
"illuminate/support": "^5.5" | ||
}, | ||
"license": "GPL v3", | ||
"authors": [ | ||
{ | ||
"name": "Olav Schettler", | ||
"email": "olav@schettler.net" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"autoload": { | ||
"psr-4": { | ||
"Knowfox\\Drupal7\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Knowfox\\Drupal7\\ServiceProvider" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Knowfox\Drupal7\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Http\Exceptions\HttpResponseException; | ||
use Illuminate\Support\Facades\Config; | ||
use GuzzleHttp\Client as GuzzleClient; | ||
use GuzzleHttp\Cookie\CookieJar; | ||
use Knowfox\Entangle\Models\ImportedEvent; | ||
use Knowfox\Entangle\Models\ImportedUser; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
|
||
class ImportDrupal7 extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'drupal7:import'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Import Drupal7 nodes from a MySQL database'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() { | ||
$this->info("Importing from database " . env('DB_D7_DATABASE') . '...'); | ||
$this->info('Done.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Knowfox\Drupal7\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class ImportedNode extends Model | ||
{ | ||
protected $connection = 'd7'; | ||
protected $table = 'node'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Knowfox\Drupal7; | ||
|
||
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider; | ||
use Knowfox\Drupal7\Commands\ImportDrupal7; | ||
|
||
class ServiceProvider extends IlluminateServiceProvider | ||
{ | ||
protected function mergeConfigRecursiveFrom($path, $key) | ||
{ | ||
$config = $this->app['config']->get($key, []); | ||
$this->app['config']->set($key, array_merge_recursive(require $path, $config)); | ||
} | ||
|
||
public function boot() | ||
{ | ||
if ($this->app->runningInConsole()) { | ||
$this->commands([ | ||
ImportDrupal7::class, | ||
]); | ||
} | ||
} | ||
|
||
public function register() | ||
{ | ||
} | ||
} |