Require plugins based on an array of paths

@param $path
184698
public static function loadFromPath($path)
	{
		// on test do not load plugins
		if(self::isUnableToRunPlugins())
		{
			return;
		}

		if (!file_exists($path))
		{
			throw new InvalidArgumentException("The path [{$path}] doesn't exist to load plugins.");
		}

		$plugins = require $path;

		foreach ($plugins as $plugin)
		{
			if (array_key_exists($plugin, self::$lookup))
			{
				$plugin = __DIR__ . DS . self::$lookup[$plugin];
			}

			if (file_exists($plugin))
			{
				require_once $plugin;
			}
		}

	}
894988
protected function makeDirectory($path)
    {
        if (! $this->fileHelper->exists($path)) {
            $this->fileHelper->makeDirectory($path, 0777, true, true);
        }
    }
498336
public function setPath(string $path)
    {
        $this->path = $path;
        
        // update path to templates and preload list of templates.
        $this->contentPath = $this->path . DIR_CONTENT_BASENAME;
        $this->templatesPath = $this->contentPath . DIR_TEMPLATES_BASENAME;
        
        $this->templates = File::listFilesRecursively($this->templatesPath, false, EXT_PART, EXT_PAGE);
    }
504090
private function ensureDirectoryExists($path)
    {
        if (!isset($this->resources[$path])) {
            // Recursively initialize parent directories
            if ($path !== '/') {
                $this->ensureDirectoryExists(Path::getDirectory($path));
            }

            $this->resources[$path] = new GenericResource($path);
            $this->resources[$path]->attachTo($this);

            return;
        }
    }
1334355
public static function load($path)
    {
        if (is_dir($path)) {
            foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
                $filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
                if (is_readable($filePath)) {
                    foreach (parse_ini_file($filePath) as $envKey => $envValue) {
                        putenv($envKey . '=' . $envValue);
                    }
                }
            }
        } else {
            throw new BaseException('Your path does not directory.');
        }
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
1145820
public static function load($path = BASE_DIR) {
        $librariesDir = dirname(dirname($path)) . DS . 'libraries';
        foreach (glob($librariesDir . DS . "*.php") as $filename) {
            require_once $filename;
        }
    }
234811
public function amInMuPluginPath($path)
    {
        $this->amInPath($this->config['mu-plugins'] . DIRECTORY_SEPARATOR . Utils::unleadslashit($path));
    }
1366965
public function addPath($path)
    {
        $paths = (array) $path;
        foreach ($paths as $path) {
            $this->paths[] = rtrim($path, "\\/") . DIRECTORY_SEPARATOR;
        }
    }
871884
public function load(string $path, string ...$paths): void
    {
        array_unshift($paths, $path);
        foreach ($paths as $path) {
            if (!is_readable($path) || is_dir($path) || ($contents = parse_ini_file($path, false)) === false) {
                throw new InvalidArgumentException("{$path} is not a readable file.");
            }
            $this->populate($contents);
        }
    }
530670
public function addExcludePaths(array $paths) : void
    {
        $this->excludePaths = array_unique(array_merge($this->excludePaths, $paths));
    }
463613
protected function loadFile($path)
    {
        $composerJson = $this->fileData($path);

        return (null === $composerJson) ? null : (array) \json_decode($composerJson, true);
    }
405513
public function autodiscover($path)
    {
        if (!is_array($path)) {
            $path = (array) $path;
        }

        foreach ($path as $apps_dir) {

            if (is_dir($apps_dir)) {

                if (($dh = opendir($apps_dir)) !== false) {

                    while (($name = readdir($dh)) !== false) {

                        if ($name{0} == '.' || $name == 'Core' || is_file($apps_dir . '/' . $name)) {
                            continue;
                        }

                        $app = $this->getAppInstance($name);
                    }

                    closedir($dh);
                }
            }
        }
    }
861387
public function requireFiles($path, array $files)
    {
        foreach ($files as $file) {
            $this->files->requireOnce($path .DS .$file .'.php');
        }
    }
63090
protected function loadPath($path)
    {
        $controllers = self::readdir($path);
        if(count($controllers)){
            foreach($controllers as $controller){
                $this->loadRoute($controller);
            }
        }
    }
438966
public function requireDirectory($path = null)
    {
        if ( ! is_null($path))
        {
            return $this->directory($path)->requireDirectory();
        }

        if ($iterator = $this->iterateDirectory($this->path))
        {
            return $this->processRequire($iterator);
        }

        return $this;
    }
1169902
protected function loadDefinitions($path)
    {
        if (file_exists($path)) {

            include $path;

            if (!empty($config['notification_definitions'])) {
                $this->notifications = array_merge($this->notifications, $config['notification_definitions']);
            }
        }
    }