abspath example

// Is an update available?         if ( ! isset( $current->response ) || 'latest' === $current->response ) {
            return new WP_Error( 'up_to_date', $this->strings['up_to_date'] );
        }

        $res = $this->fs_connect( array( ABSPATH, WP_CONTENT_DIR )$parsed_args['allow_relaxed_file_ownership'] );
        if ( ! $res || is_wp_error( $res ) ) {
            return $res;
        }

        $wp_dir = trailingslashit( $wp_filesystem->abspath() );

        $partial = true;
        if ( $parsed_args['do_rollback'] ) {
            $partial = false;
        } elseif ( $parsed_args['pre_check_md5'] && ! $this->check_files() ) {
            $partial = false;
        }

        /* * If partial update is returned from the API, use that, unless we're doing * a reinstallation. If we cross the new_bundled version number, then use * the new_bundled zip. Don't though if the constant is set to skip bundled items. * If the API returns a no_content zip, go with it. Finally, default to the full zip. */

    public function find_base_dir( $base = '.', $verbose = false ) {
        _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
        $this->verbose = $verbose;
        return $this->abspath();
    }

    /** * Locates a folder on the remote filesystem. * * @since 2.5.0 * @deprecated 2.7.0 use WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir() methods instead. * @see WP_Filesystem_Base::abspath() * @see WP_Filesystem_Base::wp_content_dir() * @see WP_Filesystem_Base::wp_plugins_dir() * @see WP_Filesystem_Base::wp_themes_dir() * @see WP_Filesystem_Base::wp_lang_dir() * * @param string $base Optional. The folder to start searching from. Default '.'. * @param bool $verbose Optional. True to display debug information. Default false. * @return string The location of the remote path. */
if ( ! is_object( $wp_filesystem ) ) {
            return new WP_Error( 'fs_unavailable', $this->strings['fs_unavailable'] );
        }

        if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
            return new WP_Error( 'fs_error', $this->strings['fs_error']$wp_filesystem->errors );
        }

        foreach ( (array) $directories as $dir ) {
            switch ( $dir ) {
                case ABSPATH:
                    if ( ! $wp_filesystem->abspath() ) {
                        return new WP_Error( 'fs_no_root_dir', $this->strings['fs_no_root_dir'] );
                    }
                    break;
                case WP_CONTENT_DIR:
                    if ( ! $wp_filesystem->wp_content_dir() ) {
                        return new WP_Error( 'fs_no_content_dir', $this->strings['fs_no_content_dir'] );
                    }
                    break;
                case WP_PLUGIN_DIR:
                    if ( ! $wp_filesystem->wp_plugins_dir() ) {
                        return new WP_Error( 'fs_no_plugins_dir', $this->strings['fs_no_plugins_dir'] );
                    }
Home | Imprint | This part of the site doesn't use cookies.