Load intents from path.

@param string $path
426391
protected function load(string $path): void
    {
        $namespace = $this->app->getNamespace();

        /** @var SplFileInfo[] $files */
        $files = (new Finder)->in($path)->files();

        foreach ($files as $file) {
            $file = $namespace.str_replace(
                    ['/', '.php'],
                    ['\\', ''],
                    Str::after($file->getPathname(), app_path().DIRECTORY_SEPARATOR)
                );

            if (is_subclass_of($file, Intent::class) && !(new ReflectionClass($file))->isAbstract()) {
                $this->app['conversation']->registerIntent($file);
            }
        }
    }
738354
private function loadConfigurationFiles($path)
    {
        $this->configPath = $path;

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $this->set($fileKey, require $path);
        }

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $envConfig = require $path;

            foreach ($envConfig as $envKey => $value) {
                $this->set($fileKey.'.'.$envKey, $value);
            }
        }
    }
699694
protected function loadSymfonyRoutes($path)
    {
        if ($this->routes === null) {
            $loader = new YamlFileLoader(new FileLocator(array(dirname($path))));
            $loader->setDefaults(array('_module' => $this->getName()));

            $routesCollection = $loader->load(pathinfo($path, PATHINFO_FILENAME) . '.' . pathinfo($path, PATHINFO_EXTENSION));
            $this->routes     = $routesCollection;
        }

        return $this->routes;
    }
263387
public function Start($path)
    {
        if(!is_dir($path))
            return;

        $path = rtrim($path, "/\\") . "/";

        $elements = scandir($path);

        foreach($elements as $file_name)
        {
            if(is_file($path . $file_name))
            {
                $file_parts = explode(".", $file_name, 2);

                if(count($file_parts) < 2)
                    continue;

                $class_name = $file_parts[0];
                $class_name_ns = "Peg\Lib\\Plugins\\$class_name";
                $file_extension = $file_parts[1];

                if($file_extension == "php")
                {
                    include($path . $file_name);

                    if(in_array($class_name_ns, get_declared_classes()))
                    {
                        $this->plugins[$class_name] = new $class_name_ns;

                        $this->plugins[$class_name]->name = $class_name;

                        $this->plugins[$class_name]->path = $path . $file_name;

                        $this->plugins[$class_name]->OnInit();
                    }
                }
            }
        }
    }
1253676
public function load($path)
    {
        $key = $this->getCacheKey($path);

        if (isset($this->data[$key])) {
            return $this->data[$key];
        }

        return null;
    }
92841
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)
        );
        $paths = array_map('strval', iterator_to_array($iterator));
        uasort($paths, 'strnatcasecmp');

        $features = array();

        foreach ($paths as $path) {
            $path = (string) $path;
            $loader = $this->gherkin->resolveLoader($path);

            if (null !== $loader) {
                $features = array_merge($features, $loader->load($path));
            }
        }

        return $features;
    }
1041431
public function load(string $path) : self
    {
        if (pathinfo($path, PATHINFO_EXTENSION) == 'yml') {
            $this->config = array_replace_recursive($this->config, yaml_parse_file($path));
        } else {
            $this->config = array_replace_recursive($this->config, require $path);
        }

        return $this;
    }
736624
private function loadFile(string $path)
    {
        if (!file_exists($path)) {
            throw new Exception('Configuration file "' . $path . '" is not found');
        }

        if (!is_readable($path)) {
            throw new Exception('Configuration file "' . $path . '" is not readable');
        }

        // Include file
        $content = include $path;

        if (!\is_array($content)) {
            throw new Exception("Passed file \"$path\" is not array");
        }

        return $content;
    }
70129
public static function appendPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_push(self::$_paths, $path);
        }
    }
227390
public function setPath(string $path)
    {
        $info = pathinfo($path);

        $this->setLocation($info["dirname"] ?? "");
        $this->setName($info["filename"] ?? "");
    }
461918
protected function loadPath($path) {
        if (directory_exists($path)) {
            return $this->loadDirectory($path);
        } else if (file_exists($path)) {
            return $this->loadFile($path);
        }

        return [];
    }
556144
private function _runParse( $path = NULL )
    {
        $startLevels  = $this->_getRealLevel( $this->_rootPath );
        $endLevels    = $startLevels + $this->levels;
        $currentLevel = 0;

        if ( NULL !== $path )
        {
            $this->_dirs[ ] = $path;
        }

        do
        {
            $dir          = array_shift( $this->_dirs );
            $currentLevel = $this->_getRealLevel( $dir );

            if ( $currentLevel < $endLevels )
            {
                $this->_parse( $dir );
            }
        } while ( count( $this->_dirs ) > 0 );
    }
585284
private function process($path)
    {
        $loader = $this->delegatingLoaderFactory->create($this->containerBuilder, $path);

        $servicesFile = 'services.' . $this->servicesFormat;
        $servicesTestFile = 'services_test.' . $this->servicesFormat;

        if ($this->filesystem->exists($path . '/' . $servicesFile)) {
            $loader->load($servicesFile);
        }

        if ($this->isTestEnvironment && $this->filesystem->exists($path . '/' . $servicesTestFile)) {
            $loader->load($servicesTestFile);
        }
    }
268048
public function load($path)
    {
        $tests = $this->getTests($path);
        foreach ($tests as $test) {
            $this->context->setFile($test);
            include $test;
        }
    }
530241
private function scanDir($path)
    {
        if(!is_dir($path)) return;

        /* @var \Symfony\Component\Finder\SplFileInfo $spl */
        $finder = $this->createFinder();

        $rootSPL = new DirectoryResource($path);
        $rootResource = new DirectoryResource($rootSPL);
        $rootResource = $this->createTrackedObject($rootResource);

        $this->add($rootResource);

        foreach($finder->in($path) as $spl)
        {
            if($spl->isFile()){
                $resource = new FileResource($spl);
            }else{
                $resource = new DirectoryResource($spl);
            }
            $trackedResource = $this->createTrackedObject($resource);
            $this->add($trackedResource);
        }
    }
578599
private function loadFromFile($path)
    {
        if ( ! is_file($path)) {
            return;
        }
        
        $config = require_once $path;
        
        if (is_array($config)) {
            $this->config = $config;
        }
    }
164803
private function LoadFromPHP($path)
    {
        $this->definitions_path = rtrim($path, "/\\") . "/";
        $this->import_type = Type::PHP;
        
        // This variable is used by the php definition files to reference
        // this object and populate it with elements.
        $symbols =& $this->symbols;
        
        if(file_exists($this->definitions_path . "constants.php"))
        {
            $this->SendMessage(t("Loading constants.php"));
            include($this->definitions_path . "constants.php");
        }
        
        if(file_exists($this->definitions_path . "enumerations.php"))
        {
            $this->SendMessage(t("Loading enumerations.php"));
            include($this->definitions_path . "enumerations.php");
        }
        
        if(file_exists($this->definitions_path . "type_definitions.php"))
        {
            $this->SendMessage(t("Loading type_definitions.php"));
            include($this->definitions_path . "type_definitions.php");
        }
        
        if(file_exists($this->definitions_path . "variables.php"))
        {
            $this->SendMessage(t("Loading variables.php"));
            include($this->definitions_path . "variables.php");
        }
        
        if(file_exists($this->definitions_path . "functions.php"))
        {
            $this->SendMessage(t("Loading functions.php"));
            include($this->definitions_path . "functions.php");
        }
        
        if(file_exists($this->definitions_path . "classes.php"))
        {
            $this->SendMessage(t("Loading classes.php"));
            include($this->definitions_path . "classes.php");
        }
    }