You are here

public function PhpRequireLoader::load in Libraries API 8.3

Loads a PHP file.

Parameters

string $file: The absolute file path to the PHP file.

Overrides PhpFileLoaderInterface::load

File

src/ExternalLibrary/PhpFile/PhpRequireLoader.php, line 15

Class

PhpRequireLoader
Provides a PHP file loader using PHP's require_once.

Namespace

Drupal\libraries\ExternalLibrary\PhpFile

Code

public function load($file) {

  // @todo Because libraries cannot be loaded twice it should be possible to
  //   use 'require' instead of 'require_once'.

  /** @noinspection PhpIncludeInspection */
  require_once $file;
}