Changeset View
Changeset View
Standalone View
Standalone View
src/init/lib/PhutilBootloader.php
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | public function getAllLibraries() { | ||||
return array_keys($this->registeredLibraries); | return array_keys($this->registeredLibraries); | ||||
} | } | ||||
public function loadLibrarySource($library, $source) { | public function loadLibrarySource($library, $source) { | ||||
$path = $this->getLibraryRoot($library).'/'.$source; | $path = $this->getLibraryRoot($library).'/'.$source; | ||||
$this->executeInclude($path); | $this->executeInclude($path); | ||||
} | } | ||||
public function loadLibrary($path) { | |||||
$this->executeInclude($path.'/__phutil_library_init__.php'); | |||||
} | |||||
private function executeInclude($path) { | private function executeInclude($path) { | ||||
// Include the source using `include_once`, but convert any warnings or | // Include the source using `include_once`, but convert any warnings or | ||||
// recoverable errors into exceptions. | // recoverable errors into exceptions. | ||||
// Some messages, including "Declaration of X should be compatible with Y", | // Some messages, including "Declaration of X should be compatible with Y", | ||||
// do not cause `include_once` to return an error code. Use | // do not cause `include_once` to return an error code. Use | ||||
// error_get_last() to make sure we're catching everything in every PHP | // error_get_last() to make sure we're catching everything in every PHP | ||||
// version. | // version. | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |