Skip to content

Instantly share code, notes, and snippets.

@nickstewart95
Last active June 8, 2020 23:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nickstewart95/7f3b0279accd751d7bde2f0b40a48dc8 to your computer and use it in GitHub Desktop.
<?php
namespace Sample;
use \Illuminate\Database\Capsule\Manager as Capsule;
class Loader {
public function init() {
$this->initEloquent();
$this->initActions();
$this->initFilters();
}
protected function initEloquent() {
$params = [
'driver' => 'mysql',
'database' => '',
'username' => '',
'password' => '',
'host' => '',
'prefix' => 'wp_',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
];
$capsule = new Capsule();
$capsule->addConnection($params, 'default');
$capsule->setAsGlobal();
$capsule->bootEloquent();
}
protected function initActions() {
}
protected function initFilters() {
}
public function activatePlugin() {
}
public function deactivatePlugin() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment