public/wordpress/wp-content/plugins/backupbuddy/classes/remote_api.php
/* _getFilePathByType()
	 *
	 * Calculates root directory to store the specified type in. Contains trailing slash. Dies if unknown file type specified in params.
	 *
	 * @param	string		$type		File type/location name to store in. Valid values: backup, media, plugin, theme.
	 *
	 */
_getFilePathByType()
Calculates root directory to store the specified type in. Contains trailing slash. Dies if unknown file type specified in params.

@param       string          $type           File type/location name to store in. Valid values: backup, media, plugin, theme.
_getFilePathByType () Calculates root directory to store the specified type in . Contains trailing slash . Dies if unknown file type specified in params . @param string $type File type / location name to store in . Valid values : backup media plugin theme .
private static function _getFilePathByType( $type ) {
		if ( 'backup' == $type ) {
			$rootDir = backupbuddy_core::getBackupDirectory(); 
			pb_backupbuddy::anti_directory_browsing( $rootDir, $die = false );
		} elseif ( 'media' == $type ) {
			$wp_upload_dir = wp_upload_dir();
			$rootDir = $wp_upload_dir['basedir'] . '/';
			unset( $wp_upload_dir );
		} elseif ( 'plugin' == $type ) {
			$rootDir = wp_normalize_path( WP_PLUGIN_DIR ) . '/';
		} elseif ( 'theme' == $type ) {
			$rootDir = get_template_directory() . '/';
		} elseif ( 'childTheme' == $type ) {
			$rootDir = get_stylesheet_directory() . '/';
		} elseif( 'test' == $type ) {
			$rootDir = backupbuddy_core::getTempDirectory();
		} elseif( 'extra' == $type ) {
			$rootDir = ABSPATH; 
		} else {
			$error = 'Error #84934984. You must specify a sendfile type: Unknown file type `' . htmlentities( $type ) . '`.';
			pb_backupbuddy::status( 'error', $error );
			error_log( 'BackupBuddy API error: ' . $error );
			self::_reply( array( 'success' => false, 'error' => $message ) );
		}
		return $rootDir;
	}
private static function _getFilePathByType ( $ type ) { if ( 'backup' == $ type ) { $ rootDir = backupbuddy_core :: getBackupDirectory ( ) ; pb_backupbuddy :: anti_directory_browsing ( $ rootDir , $ die = false ) ; } elseif ( 'media' == $ type ) { $ wp_upload_dir = wp_upload_dir ( ) ; $ rootDir = $ wp_upload_dir [ 'basedir' ] . '/' ; unset ( $ wp_upload_dir ) ; } elseif ( 'plugin' == $ type ) { $ rootDir = wp_normalize_path ( WP_PLUGIN_DIR ) . '/' ; } elseif ( 'theme' == $ type ) { $ rootDir = get_template_directory ( ) . '/' ; } elseif ( 'childTheme' == $ type ) { $ rootDir = get_stylesheet_directory ( ) . '/' ; } elseif ( 'test' == $ type ) { $ rootDir = backupbuddy_core :: getTempDirectory ( ) ; } elseif ( 'extra' == $ type ) { $ rootDir = ABSPATH ; } else { $ error = 'Error #84934984. You must specify a sendfile type: Unknown file type `' . htmlentities ( $ type ) . '`.' ; pb_backupbuddy :: status ( 'error' , $ error ) ; error_log ( 'BackupBuddy API error: ' . $ error ) ; self :: _reply ( array ( 'success' => false , 'error' => $ message ) ) ; } return $ rootDir ; }
_getFilePathByType()
 Calculates root directory to store the specified type in.
_getFilePathByType () Calculates root directory to store the specified type in .
// Include trailing slash. // includes trailing slash. //error_log( 'rootDir: ' . $rootDir );