Set config file root directory

@param  string $rootDir
@return $this
@throws InvalidArgumentException if root dir is unknown
@access public
@api
437859
public function setRootDir(/*# string */ $rootDir)
    {
        $dir = realpath($rootDir);

        if (false === $dir) {
            throw new InvalidArgumentException(
                Message::get(Message::CONFIG_ROOT_INVALID, $rootDir),
                Message::CONFIG_ROOT_INVALID
            );
        }

        $this->root_dir = $dir . \DIRECTORY_SEPARATOR;

        return $this;
    }
323325
public function setDocumentRoot($path)
    {
        if (file_exists($path)) {
            $this->document_root = realpath($path);
        } elseif (file_exists(DirectoryHelper::slashDirname($this->getRootDirectory()) . $path)) {
            $this->document_root = DirectoryHelper::slashDirname($this->getRootDirectory()) . $path;
        } else {
            throw new \InvalidArgumentException(
                sprintf('Document root path "%s" doesn\'t exist!', $path)
            );
        }
        return $this;
    }
1298791
public function getConfigDir()
    {
        if (null === $this->configDir) {
            $this->configDir = $this->getRootDir() . '/app/config/';
        }

        return($this->configDir);
    }
345134
public function setDocRoot($docRoot)
    {
        if (empty($docRoot) || ! file_exists($docRoot) || ! is_dir($docRoot)) {
            throw new \InvalidArgumentException(
                'The document root set is not a valid directory.'
            );
        }
        $this->docRoot = rtrim($docRoot, '/');
    }
409494
public function setRootDirectory($rootDir)
    {
        if ($this->started) {
            throw new LogicException('Puli is already started');
        }

        Assert::nullOrDirectory($rootDir);

        $this->rootDir = $rootDir ? Path::canonicalize($rootDir) : null;
    }
900314
public function setDirectory()
    {
        $pos = strrpos($this->dirPath, DIRECTORY_SEPARATOR);
        $this->directory = substr($this->dirPath, $pos + 1);
    }
869871
protected function loadConfiguration(InputInterface $input, $rootDir)
    {
        $coverallsYmlPath = $input->getOption('config');

        $ymlPath = $this->rootDir . DIRECTORY_SEPARATOR . $coverallsYmlPath;
        $configurator = new Configurator();

        return $configurator
            ->load($ymlPath, $rootDir, $input)
            ->setDryRun($input->getOption('dry-run'))
            ->setExcludeNoStatementsUnlessFalse($input->getOption('exclude-no-stmt'))
            ->setVerbose($input->getOption('verbose'))
            ->setEnv($input->getOption('env'));
    }
922588
public function setDir($dir)
    {
        if (in_array($dir, Direction::asArray(), true) === true) {
            $this->dir = $dir;
        } else {
            $msg = "The 'dir' argument must be a value from the Direction enumeration.";
            throw new InvalidArgumentException($msg);
        }
    }
681704
public function addLocalDirectory($directory, $recursive = false)
    {
        if (!file_exists($directory) || !is_dir($directory)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'The directory "%s" does not exists.',
                $directory
            ));
        }

        if ($recursive) {
            $iterator = new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator($directory)
            );
        } else {
            $iterator = new \DirectoryIterator($directory);
        }

        foreach ($iterator as $fileinfo) {
            if (!$fileinfo->isFile()) {
                continue;
            }
            
            $extension = $fileinfo->getExtension();
            if ($extension != 'js') {
                continue;
            }

            $this->addLocalFile($fileinfo->getPathname());
        }

        return $this;
    }
1318872
public function setRootDirectory($path)
    {
        if (@file_exists($path) && is_dir($path)) {
            $this->_root_dir = $path;
        } else {
            throw new InvalidArgumentException(
                sprintf('Root package directory "%s" not found !', $path)
            );
        }
        return $this;
    }
187512
public  function start(String $fileName = 'upload', String $rootDir = NULL) : Bool
    {
        $fileName = $this->settings['source'] ?? $fileName;
        $rootDir  = $this->settings['target'] ?? $rootDir ?? $this->uploadDirectory;

        if( ! is_dir($rootDir) ) 
        {
            mkdir($rootDir);
        }

        $extensions = $this->_separator('extensions');
        $mimes      = $this->_separator('mimes');

        $this->file = $fileName;
        $encryption = $this->settings['prefix']      ?? '';
        $name       = $_FILES[$fileName]['name']     ?? NULL;
        $source     = $_FILES[$fileName]['tmp_name'] ?? NULL;
        $root       = Base::suffix($rootDir, '/');     

        if( is_array($name) )
        {
            for( $index = 0; $index < count($name); $index++ )
            {
                $this->_upload($rootDir, $root, $source[$index], $name[$index], $extensions, $mimes, $encryption);
            }

            $return = true;
        }
        else
        {
            $return = $this->_upload($rootDir, $root, $source, $name, $extensions, $mimes, $encryption);
        }

        $this->_default();

        return $return;
    }
1011264
public function configDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->configDir = rtrim($path, '/');

        return $this;
    }
1063899
public function setCacheDirectory($directory)
    {
        if (!is_dir($directory)) {
            $this->createDirectory($directory);
        }

        if (!is_writable($directory)) {
            throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
        }

        $this->cacheDirectory = $directory;

        return $this;
    }
602556
private function createClientDefinition ($rootDir)
    {
        $bugsnagClient = new Definition(Client::class, [
            $this->configuration->getApiKey(),
        ]);
        $bugsnagClient->setFactory([Client::class, "make"]);
        $bugsnagClient->setPublic(false);

        // strip root dir from logs
        $rootDir = dirname($rootDir);
        $bugsnagClient->addMethodCall("setProjectRoot", [$rootDir]);
        $bugsnagClient->addMethodCall("setStripPath", [$rootDir]);
        $bugsnagClient->addMethodCall("setFilters", [['clientIp']]);

        return $bugsnagClient;
    }
798987
public function configureIniStore( $configDir=null)
    {
        $this->configDir = $configDir                                           // case 1)
            ? $configDir
            : ( isset($_ENV['BOTK_CONFIGDIR'])                                    // case 2
                ? $_ENV['BOTK_CONFIGDIR'] 
                : (dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . '/configs')
               ); // case 3
                
        return $this;
    }
456483
public static function setRootPath(string $root)
    {
        $mode = static::mode();
        $path = "{$root}/{$mode}";

        if (! file_exists($path)) {
            throw new InvalidArgumentException("'{$path}' not exists");
        }

        static::$root = realpath($root);
        static::$path = realpath($path);

        unset($mode, $path);
    }
429314
public function setDirectory($directory)
    {
        Assert::stringNotEmpty($directory, 'The factory directory must be a non-empty string. Got: %s');

        $this->directory = Path::canonicalize($directory);

        return $this;
    }