load() public static method

Loads the class definition specified by $class. Looks through the list of libraries defined in $_configurations, which are added through lithium\core\Libraries::add().
See also: lithium\core\Libraries::add()
See also: lithium\core\Libraries::path()
public static load ( string $class, boolean $require = false ) : void
$class string The fully-namespaced (where applicable) name of the class to load.
$require boolean Specifies whether the class must be loaded or considered an exception. Defaults to `false`.
return void
Esempio n. 1
0
 /**
  * Tests the loading of libraries
  */
 public function testLibraryLoad()
 {
     $expected = 'Failed to load class `SomeInvalidLibrary` from path ``.';
     $this->assertException($expected, function () {
         Libraries::load('SomeInvalidLibrary', true);
     });
 }
Esempio n. 2
0
 /**
  * Tests the loading of libraries
  *
  * @return void
  */
 public function testLibraryLoad()
 {
     $this->expectException('Failed to load class `SomeInvalidLibrary` from path ``.');
     Libraries::load('SomeInvalidLibrary', true);
 }
 /**
  * Tests the loading of libraries
  *
  * @return void
  */
 public function testLibraryLoad()
 {
     $this->expectException('Failed to load SomeInvalidLibrary from ');
     Libraries::load('SomeInvalidLibrary', true);
 }