for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Connect plugin for Craft CMS 3.x
*
* Allows you to connect to external databases and perform db queries
* @link https://nystudio107.com/
* @copyright Copyright (c) 2018 nystudio107
*/
namespace nystudio107\connect;
use nystudio107\connect\models\Settings;
use nystudio107\connect\variables\ConnectVariable;
use Craft;
use craft\base\Plugin;
use craft\web\twig\variables\CraftVariable;
use yii\base\Event;
* Class Connect
* @author nystudio107
* @package Connect
* @since 1.0.0
class Connect extends Plugin
{
// Static Properties
// =========================================================================
* @var Connect
public static $plugin;
// Public Properties
* @var string
public $schemaVersion = '1.0.0';
// Public Methods
* @inheritdoc
public function init()
parent::init();
self::$plugin = $this;
Event::on(
CraftVariable::class,
CraftVariable::EVENT_INIT,
function (Event $event) {
/** @var CraftVariable $variable */
$variable = $event->sender;
$variable->set('connect', ConnectVariable::class);
}
);
Craft::info(
Craft::t(
'connect',
'{name} plugin loaded',
['name' => $this->name]
),
__METHOD__
// Protected Methods
protected function createSettingsModel()
return new Settings();