original_string: public function buildPath()
  	{
  		$slugs = func_get_args();
  
  		if ( is_array( $slugs[0] ) )
  			$slugs = $slugs[0];
  
  		if ( count( $slugs ) == 0 )
  			return $this->basePath;
  
  		if ( Str::startsWith( $slugs[0], '__' ) )
  		{
  			$key = substr( $slugs[0], 2 );
  			if ( $key == 'base' )
  				$slugs[0] = $this->basePath;
  			else if ( array_key_exists( $key, $this->paths ) )
  			{
  				$paths = $this->paths[$key];
  				if ( is_array( $paths ) )
  				{
  					unset( $slugs[0] );
  					foreach ( array_reverse( $paths ) as $slug )
  						$slugs = Arr::prepend( $slugs, $slug );
  				}
  				else
  					$slugs[0] = $paths;
  			}
  			else
  				throw new FrameworkException( "Path [" . $key . "] is not set" );
  
  			return $this->buildPath( $slugs );
  		}
  		else if ( !Str::startsWith( $slugs[0], '/' ) )
  			$slugs = Arr::prepend( $slugs, $this->basePath );
  
  		$dir = strpos( end( $slugs ), '.' ) !== false ? implode( DIRECTORY_SEPARATOR, array_slice( $slugs, 0, count( $slugs ) - 1 ) ) : implode( DIRECTORY_SEPARATOR, $slugs );
  
  		if ( !file_exists( $dir ) )
  			if ( !mkdir( $dir, 0755, true ) )
  				throw new FrameworkException( "The directory [" . $dir . "] does not exist and we failed to create it" );
  
  		return implode( DIRECTORY_SEPARATOR, $slugs );
  	}
code: public function buildPath()
  	{
  		$slugs = func_get_args();
  
  		if ( is_array( $slugs[0] ) )
  			$slugs = $slugs[0];
  
  		if ( count( $slugs ) == 0 )
  			return $this->basePath;
  
  		if ( Str::startsWith( $slugs[0], '__' ) )
  		{
  			$key = substr( $slugs[0], 2 );
  			if ( $key == 'base' )
  				$slugs[0] = $this->basePath;
  			else if ( array_key_exists( $key, $this->paths ) )
  			{
  				$paths = $this->paths[$key];
  				if ( is_array( $paths ) )
  				{
  					unset( $slugs[0] );
  					foreach ( array_reverse( $paths ) as $slug )
  						$slugs = Arr::prepend( $slugs, $slug );
  				}
  				else
  					$slugs[0] = $paths;
  			}
  			else
  				throw new FrameworkException( "Path [" . $key . "] is not set" );
  
  			return $this->buildPath( $slugs );
  		}
  		else if ( !Str::startsWith( $slugs[0], '/' ) )
  			$slugs = Arr::prepend( $slugs, $this->basePath );
  
  		$dir = strpos( end( $slugs ), '.' ) !== false ? implode( DIRECTORY_SEPARATOR, array_slice( $slugs, 0, count( $slugs ) - 1 ) ) : implode( DIRECTORY_SEPARATOR, $slugs );
  
  		if ( !file_exists( $dir ) )
  			if ( !mkdir( $dir, 0755, true ) )
  				throw new FrameworkException( "The directory [" . $dir . "] does not exist and we failed to create it" );
  
  		return implode( DIRECTORY_SEPARATOR, $slugs );
  	}
code_tokens: public function buildPath ( ) { $ slugs = func_get_args ( ) ; if ( is_array ( $ slugs [ 0 ] ) ) $ slugs = $ slugs [ 0 ] ; if ( count ( $ slugs ) == 0 ) return $ this -> basePath ; if ( Str :: startsWith ( $ slugs [ 0 ] , '__' ) ) { $ key = substr ( $ slugs [ 0 ] , 2 ) ; if ( $ key == 'base' ) $ slugs [ 0 ] = $ this -> basePath ; else if ( array_key_exists ( $ key , $ this -> paths ) ) { $ paths = $ this -> paths [ $ key ] ; if ( is_array ( $ paths ) ) { unset ( $ slugs [ 0 ] ) ; foreach ( array_reverse ( $ paths ) as $ slug ) $ slugs = Arr :: prepend ( $ slugs , $ slug ) ; } else $ slugs [ 0 ] = $ paths ; } else throw new FrameworkException ( "Path [" . $ key . "] is not set" ) ; return $ this -> buildPath ( $ slugs ) ; } else if ( ! Str :: startsWith ( $ slugs [ 0 ] , '/' ) ) $ slugs = Arr :: prepend ( $ slugs , $ this -> basePath ) ; $ dir = strpos ( end ( $ slugs ) , '.' ) !== false ? implode ( DIRECTORY_SEPARATOR , array_slice ( $ slugs , 0 , count ( $ slugs ) - 1 ) ) : implode ( DIRECTORY_SEPARATOR , $ slugs ) ; if ( ! file_exists ( $ dir ) ) if ( ! mkdir ( $ dir , 0755 , true ) ) throw new FrameworkException ( "The directory [" . $ dir . "] does not exist and we failed to create it" ) ; return implode ( DIRECTORY_SEPARATOR , $ slugs ) ; }
docstring: Append args to the base path
  
  @return string
  
  @throws FrameworkException
docstring_tokens: Append args to the base path