public function addPath($name, $value, $must_exists = false, $must_be_writable = false)
    {
        $config = $this->getContainer()->get('config');
        if ($must_exists) {
            $realpath = $this->getAbsolutePath($value);
            if (!empty($realpath)) {
                $value = $realpath;
            } else {
                DirectoryHelper::ensureExists($value);
                if (!file_exists($value)) {
                    $this->addBootError(
                        sprintf('Directory "%s" defined as an application path doesn\'t exist and can\'t be created!', $value)
                    );
/*
                    throw new RuntimeException(
                        sprintf('Directory "%s" defined as an application path doesn\'t exist and can\'t be created!', $value)
                    );
*/
                }
            }
        }
        if ($must_be_writable && !is_writable($value)) {
           $this->addBootError(
                sprintf('Directory "%s" must be writable! (%s)', $value, $name)
            );
/*
            throw new RuntimeException(
                sprintf('Directory "%s" must be writable!', $value)
            );
*/
        }
        $config->getRegistry()
            ->loadStack('paths')
            ->setEntry($name, $value)
            ->saveStack('paths', true);
        return $this;
    }
public function addPath($name, $value, $must_exists = false, $must_be_writable = false)
    {
        $config = $this->getContainer()->get('config');
        if ($must_exists) {
            $realpath = $this->getAbsolutePath($value);
            if (!empty($realpath)) {
                $value = $realpath;
            } else {
                DirectoryHelper::ensureExists($value);
                if (!file_exists($value)) {
                    $this->addBootError(
                        sprintf('Directory "%s" defined as an application path doesn\'t exist and can\'t be created!', $value)
                    );
/*
                    throw new RuntimeException(
                        sprintf('Directory "%s" defined as an application path doesn\'t exist and can\'t be created!', $value)
                    );
*/
                }
            }
        }
        if ($must_be_writable && !is_writable($value)) {
           $this->addBootError(
                sprintf('Directory "%s" must be writable! (%s)', $value, $name)
            );
/*
            throw new RuntimeException(
                sprintf('Directory "%s" must be writable!', $value)
            );
*/
        }
        $config->getRegistry()
            ->loadStack('paths')
            ->setEntry($name, $value)
            ->saveStack('paths', true);
        return $this;
    }
public function addPath ( $ name , $ value , $ must_exists = false , $ must_be_writable = false ) { $ config = $ this -> getContainer ( ) -> get ( 'config' ) ; if ( $ must_exists ) { $ realpath = $ this -> getAbsolutePath ( $ value ) ; if ( ! empty ( $ realpath ) ) { $ value = $ realpath ; } else { DirectoryHelper :: ensureExists ( $ value ) ; if ( ! file_exists ( $ value ) ) { $ this -> addBootError ( sprintf ( 'Directory "%s" defined as an application path doesn\'t exist and can\'t be created!' , $ value ) ) ; /*
                    throw new RuntimeException(
                        sprintf('Directory "%s" defined as an application path doesn\'t exist and can\'t be created!', $value)
                    );
*/ } } } if ( $ must_be_writable && ! is_writable ( $ value ) ) { $ this -> addBootError ( sprintf ( 'Directory "%s" must be writable! (%s)' , $ value , $ name ) ) ; /*
            throw new RuntimeException(
                sprintf('Directory "%s" must be writable!', $value)
            );
*/ } $ config -> getRegistry ( ) -> loadStack ( 'paths' ) -> setEntry ( $ name , $ value ) -> saveStack ( 'paths' , true ) ; return $ this ; }
References a path value

@param string $name              The path reference
@param string $value             The path value
@param bool $must_exists         Check if concerned path exists
@param bool $must_be_writable    Check if concerned path is writable
@return self

@throws RuntimeException if the path does not exists and `$must_exists` is true
@throws ErrorException if the concerned path is not writable while it was required
References a path value