-
Notifications
You must be signed in to change notification settings - Fork 428
Expand file tree
/
Copy pathIncludePackageAutoloader.php
More file actions
59 lines (48 loc) · 1.26 KB
/
IncludePackageAutoloader.php
File metadata and controls
59 lines (48 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace EE\Bootstrap;
use EE;
/**
* Class IncludePackageAutoloader.
*
* Loads the package autoloader that includes all the external packages.
*
* @package EE\Bootstrap
*/
final class IncludePackageAutoloader extends AutoloaderStep {
/**
* Get the autoloader paths to scan for an autoloader.
*
* @return string[]|false Array of strings with autoloader paths, or false
* to skip.
*/
protected function get_autoloader_paths() {
if ( $this->state->getValue( BootstrapState::IS_PROTECTED_COMMAND, $fallback = false ) ) {
return false;
}
$runner = new RunnerInstance();
//$skip_packages = $runner()->config['skip-packages'];
// if ( true === $skip_packages ) {
// \EE::debug( 'Skipped loading packages.', 'bootstrap' );
// return false;
// }
$autoloader_path = $runner()->get_packages_dir_path() . 'vendor/autoload.php';
if ( is_readable( $autoloader_path ) ) {
EE::debug(
'Loading packages from: ' . $autoloader_path,
'bootstrap'
);
return array(
$autoloader_path,
);
}
return false;
}
/**
* Handle the failure to find an autoloader.
*
* @return void
*/
protected function handle_failure() {
EE::debug( 'No package autoload found to load.', 'bootstrap' );
}
}