# assistant/0.3.1/backend/src/System/Plugin.php

Assistant – Every Day Productivity Apps, version 0.3.1. 75 lines.

- Page: https://pluginprobe.com/plugins/assistant/0.3.1/code/backend/src/System/Plugin.php
- Raw: https://pluginprobe.com/plugins/assistant/0.3.1/raw/backend/src/System/Plugin.php
- Modified: 2020-03-25T19:33:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/assistant/0.3.1/code/backend/src/System/Plugin.php#L10-L20`.

```php
<?php

namespace FL\Assistant\System;

use FL\Assistant\Providers\CloudServiceProvider;
use FL\Assistant\Providers\DataServiceProvider;
use FL\Assistant\Providers\HooksServiceProvider;
use FL\Assistant\Providers\RestServiceProvider;
use FL\Assistant\Providers\ViewServiceProvider;
use FL\Assistant\System\Util\PhpVersionCheck;
use FL\Assistant\Providers\PostTypeServiceProvider;

// Alias the injector - its our DI container.
use FL\Assistant\System\Container\Injector as Container;
use FL\Assistant\System\Util\Psr4Autoloader;

/**
 * Class Plugin
 * @package FL\Assistant\Core
 */
class Plugin {

	/**
	 * @var Container
	 */
	protected $container;

	/**
	 * Providers are registered in the order they are listed here
	 * @var array
	 */
	public $providers = [
		ViewServiceProvider::class,
		DataServiceProvider::class,
		PostTypeServiceProvider::class,
		HooksServiceProvider::class,
		RestServiceProvider::class,
		CloudServiceProvider::class,
	];

	/**
	 * Plugin constructor.
	 *
	 * @param $pluginFile
	 *
	 * @throws \FL\Assistant\System\Container\InjectionException
	 */
	public function __construct( $plugin_file ) {
		$this->check_minimum_php_requirements();

		$this->register_providers();

		// notify assistant was loaded
		do_action( 'fl_assistant_loaded' );
	}

	/**
	 *
	 */
	public function check_minimum_php_requirements() {
		$php_version_check = new PhpVersionCheck();
		$php_version_check->check();
	}

	public function register_providers() {
		$this->container = new Container();
		foreach ( $this->providers as $provider_class ) {
			$provider = $this->container->make( $provider_class, [ $this->container ] );
			$this->container->execute( [ $provider, 'bootstrap' ] );
		}
	}

}


```
