Components_Pear_Environment::setSourceDirectory PHP Method

setSourceDirectory() public method

Set the path to the source directory.
public setSourceDirectory ( &$options ) : null
return null
    public function setSourceDirectory(&$options)
    {
        if (empty($options['sourcepath'])) {
            $options['sourcepath'] = $options['destination'] . '/distribution/source';
            if (!file_exists($options['sourcepath'])) {
                if (!empty($options['build_distribution'])) {
                    mkdir($options['sourcepath'], 0777, true);
                } else {
                    unset($options['sourcepath']);
                }
            }
        }
        if (!empty($options['sourcepath'])) {
            if (!file_exists($options['sourcepath'])) {
                throw new Components_Exception(sprintf('The path to the source directory (%s) does not exist!', $options['sourcepath']));
            }
            $this->_source_directory = $options['sourcepath'];
        }
    }