Various small improvements
This commit is contained in:
parent
9a9872fe8e
commit
b6468ca215
2 changed files with 5 additions and 4 deletions
|
@ -8,7 +8,7 @@ if (is_file(__DIR__ . '/vendor/autoload.php')) {
|
|||
// composer dependency package
|
||||
require_once(__DIR__ . '/../../../vendor/autoload.php');
|
||||
} else {
|
||||
die("Cannot find `vendor/autoload.php`. Run `composer install`.");
|
||||
die("Cannot find 'vendor/autoload.php'. Run `composer install`.");
|
||||
}
|
||||
|
||||
// instance Pico
|
||||
|
|
|
@ -131,7 +131,7 @@ class Pico
|
|||
/**
|
||||
* List of loaded plugins using the current API version
|
||||
*
|
||||
* @var object[]
|
||||
* @var PicoPluginInterface[]
|
||||
*/
|
||||
protected $nativePlugins = array();
|
||||
|
||||
|
@ -661,6 +661,7 @@ class Pico
|
|||
}
|
||||
|
||||
$className = get_class($plugin);
|
||||
|
||||
if (!($plugin instanceof PicoPluginInterface)) {
|
||||
throw new RuntimeException(
|
||||
"Unable to load plugin '" . $className . "': "
|
||||
|
@ -676,7 +677,7 @@ class Pico
|
|||
|
||||
// trigger onPluginManuallyLoaded event
|
||||
// the event is also called on the newly loaded plugin, allowing you to distinguish manual and auto loading
|
||||
$this->triggerEvent('onPluginManuallyLoaded', array($this->plugins[$className]));
|
||||
$this->triggerEvent('onPluginManuallyLoaded', array($plugin));
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
|
@ -2192,7 +2193,7 @@ class Pico
|
|||
public function getAbsolutePath($path)
|
||||
{
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
if (preg_match('/^([a-zA-Z]:\\\\|\\\\\\\\)/', $path) !== 1) {
|
||||
if (preg_match('/^(?>[a-zA-Z]:\\\\|\\\\\\\\)/', $path) !== 1) {
|
||||
$path = $this->getRootDir() . $path;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue