private function createDirectory($directory, $entry_name = NULL)
	{
		$directory = str_replace(DIRECTORY_SEPARATOR, '/', $directory);
		$directory = str_replace('\\', '/', $directory);
		$directory = str_replace('/',  '/', $directory);
		$directory = rtrim($directory, '/\\' . DIRECTORY_SEPARATOR);

		if (!file_exists($directory)) {
			$this->createDirectory(
				pathinfo($directory, PATHINFO_DIRNAME),
				$entry_name
			);

			if (!mkdir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, failure while creating requisite directory "%s"',
					$directory
				));
			}

		} else {
			if (!is_dir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite path "%s" exists, but is not a directory',
					$directory
				));
			}

			if (!is_writable($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite directory "%s" is not writable',
					$directory
				));
			}
		}

		$this->map($directory, $entry_name);
	}
private function createDirectory($directory, $entry_name = NULL)
	{
		$directory = str_replace(DIRECTORY_SEPARATOR, '/', $directory);
		$directory = str_replace('\\', '/', $directory);
		$directory = str_replace('/',  '/', $directory);
		$directory = rtrim($directory, '/\\' . DIRECTORY_SEPARATOR);

		if (!file_exists($directory)) {
			$this->createDirectory(
				pathinfo($directory, PATHINFO_DIRNAME),
				$entry_name
			);

			if (!mkdir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, failure while creating requisite directory "%s"',
					$directory
				));
			}

		} else {
			if (!is_dir($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite path "%s" exists, but is not a directory',
					$directory
				));
			}

			if (!is_writable($directory)) {
				throw new \Exception(sprintf(
					'Cannot install, requisite directory "%s" is not writable',
					$directory
				));
			}
		}

		$this->map($directory, $entry_name);
	}
private function createDirectory ( $ directory , $ entry_name = NULL ) { $ directory = str_replace ( DIRECTORY_SEPARATOR , '/' , $ directory ) ; $ directory = str_replace ( '\\' , '/' , $ directory ) ; $ directory = str_replace ( '/' , '/' , $ directory ) ; $ directory = rtrim ( $ directory , '/\\' . DIRECTORY_SEPARATOR ) ; if ( ! file_exists ( $ directory ) ) { $ this -> createDirectory ( pathinfo ( $ directory , PATHINFO_DIRNAME ) , $ entry_name ) ; if ( ! mkdir ( $ directory ) ) { throw new \ Exception ( sprintf ( 'Cannot install, failure while creating requisite directory "%s"' , $ directory ) ) ; } } else { if ( ! is_dir ( $ directory ) ) { throw new \ Exception ( sprintf ( 'Cannot install, requisite path "%s" exists, but is not a directory' , $ directory ) ) ; } if ( ! is_writable ( $ directory ) ) { throw new \ Exception ( sprintf ( 'Cannot install, requisite directory "%s" is not writable' , $ directory ) ) ; } } $ this -> map ( $ directory , $ entry_name ) ; }
Attempts to create a directory and make sure it's writable while mapping
any created directories.

@param string $directory The directory to try and create
@param string $entry_name The entry name to map under
@return void
Attempts to create a directory and make sure it s writable while mapping any created directories .