@param array|string  $path     A path or array of paths to add to the list of plugin paths.
@param bool          $prepend  Whether or not to add this path to the beginning of the list.

@return $this
346558
public function addPluginPath($path, $prepend = false)
  {
    $paths = (is_array($path)) ? $path : array($path);

    foreach ( $paths as $pluginPath )
    {
      if ( $realPluginPath = realpath( $pluginPath ) )
      {
        if ( $prepend )
        {
          array_unshift( $this->pluginPaths, $realPluginPath );
        }
        else
        {
          $this->pluginPaths[] = $realPluginPath;
        }
      }
    }

    return $this;
  }
351412
public function before_path($path) {
        if ($this->path_is_grouped($path) and !isset($this->currentdata[$path])) {
            // If the grouped element itself does not contain any final tags,
            // we would not get any chunk data for it. So we add an artificial
            // empty data chunk here that will be eventually replaced with
            // real data later in {@link self::postprocess_chunk()}.
            $this->currentdata[$path] = array(
                'path' => $path,
                'level' => substr_count($path, '/') + 1,
                'tags' => array(),
            );
        }
        if (!$this->grouped_parent_exists($path)) {
            parent::before_path($path);
        }
    }
1162503
public function assertPathBeginsWith($path)
    {
        $actualPath = parse_url($this->driver->getCurrentURL(), PHP_URL_PATH) ?? '';

        PHPUnit::assertStringStartsWith(
            $path, $actualPath,
            "Actual path [{$actualPath}] does not begin with expected path [{$path}]."
        );

        return $this;
    }
1276177
public static function add_namespaces(array $namespaces, $prepend = false)
	{
		if ( ! $prepend)
		{
			static::$namespaces = array_merge(static::$namespaces, $namespaces);
		}
		else
		{
			static::$namespaces = $namespaces + static::$namespaces;
		}
	}
695146
public static function registerPrefix($prefix, $path, $reset = false, $prepend = false)
    {
        $addPath = function () use ($prefix, $path, $reset, $prepend) {
            foreach ([
                         LoaderFactory::LIBRARIES_LEGACY,
                         LoaderFactory::LIBRARIES_JOOMLA,
                         LoaderFactory::LIBRARIES_CMS
                     ] as $overridePathPart) {
                if (preg_match('/' . preg_quote($overridePathPart, '/') . '$/', $path)) {
                    foreach (array_reverse(self::$instance->overridePaths) as $overridePath) {
                        $path = $overridePath . DIRECTORY_SEPARATOR . $overridePathPart;
                        if (is_dir($path)) {
                            parent::registerPrefix($prefix, $path, $reset, $prepend);
                        }
                    }
                    break;
                }
            }
        };

        if (!$prepend) {
            $addPath();
        }

        parent::registerPrefix($prefix, $path, $reset, $prepend);

        if ($prepend) {
            $addPath();
        }
    }
60399
public function addHeader ($string, $prepend = false)
		{
			if ($prepend) {
				$this->prependHeader($string);
			} else {
				$this->headers[] = $string;
			}
		}
393414
public function registerPath($namespace, $path, $prepend = false)
    {
        $namespace = Normalizer::ns($namespace, true);
        $index     = substr($namespace, 0, 4);

        $this->indexes[$index] = true;

        $path = Normalizer::path($path, true);

        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        if ($prepend) {
            array_unshift($this->paths[$namespace], $path);

            return $this;
        }
        array_push($this->paths[$namespace], $path);

        return $this;
    }
796236
function addPath($path, $prepend = false)
    {
        $this->write(tap($this->read(), function (&$config) use ($path, $prepend) {
            $method = $prepend ? 'prepend' : 'push';

            $config['paths'] = collect($config['paths'])->{$method}($path)->unique()->all();
        }));
    }
585815
protected static function append($path)
	{

		if (is_dir($path))
		{

			$env = (is_admin()) ? 'admin' : 'front';

			// from common path
			static::requireFiles($path);

			// from environment path
			static::requireFiles($path."/{$env}");


			return true;

		}

		return false;

	}
767848
public function addPath($path)
    {
        $trimmed = rtrim($path, '/');
        if (!in_array($trimmed, $this->paths)) {
            $this->paths[] = $trimmed;
        }
        return $this;
    }
906019
public function prependAll($prepended)
    {
        foreach ($this->storage as &$path) {
            $path->prepend($prepended);
        }

        return $this;
    }
1357156
public function add($prefix, $dir, $prepend = false)
    {
        $prefix = trim($prefix, '\\') . '\\';
        $dir = rtrim($dir, DIRECTORY_SEPARATOR) . '/';

        if (isset($this->prefixes[$prefix]) === false) {
            $this->prefixes[$prefix] = [];
        }

        if ($prepend) {
            array_unshift($this->prefixes[$prefix], $dir);
        } else {
            array_push($this->prefixes[$prefix], $dir);
        }

        return $this;
    }
946813
public function addMessages(array $messages, $prepend = false)
    {
        if ($prepend) {
            $messages = array_reverse($messages);
        }

        foreach ($messages as $message) {
            $this->addMessage($message, $prepend);
        }

        return $this;
    }
697416
public function prependLocation($location)
    {
        if ($location && !in_array($location, $this->paths)) {
            array_unshift($this->paths, $location);
        }

        return $this;
    }
605392
private function addTwigPath($path, array $options = [])
    {
        if ($path === 'templates' && $this->pathAdded) {
            return;
        }

        $app = $this->getContainer();

        $position = isset($options['position']) ? $options['position'] : 'append';
        $namespace = isset($options['namespace']) ? $options['namespace'] : FilesystemLoader::MAIN_NAMESPACE;

        $dir = $this->getBaseDirectory()->getDir($path);
        if (!$dir->exists()) {
            return;
        }
        try {
            if ($position === 'prepend') {
                $app['twig.loader.bolt_filesystem']->prependDir($dir, $namespace);
            } else {
                $app['twig.loader.bolt_filesystem']->addDir($dir, $namespace);
            }
        } catch (LoaderError $e) {
            $app['logger.system']->critical(sprintf('%s was unable to add the Twig path %s. %s', $this->getName(), $path, $e->getMessage()), ['event' => 'exception', 'exception' => $e]);
        }
    }
1025062
public function PrependExternal ($path = '', $async = FALSE, $defer = FALSE, $doNotMinify = FALSE) {
		return $this->Prepend($path, $async, $defer, $doNotMinify, TRUE);
	}
1109869
public function prepend($path) {
		$path = $this->normalizePath($path);
		
		$this->inputFiles->unshift($path);
		
		return $this;
	}