Download the PHP package popphp/pop-storage without Composer

On this page you can find all versions of the php package popphp/pop-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pop-storage

pop-storage

Build Status Coverage Status

Join the chat at https://popphp.slack.com Join the chat at https://discord.gg/TZjgT74U7E

Overview

pop-storage is a storage component that provides interchangeable adapters to easily manage and switch between different storage resources. Supported storage adapters are:

NOTE: The use of enterprise storage solutions like AWS S3 and Microsoft Azure require credentials and permissions to be created in their respective administration portals. Please refer to the online documentation, guidelines and polices for whichever storage platform to which you are attempting to connect your application using this component. Please take care in granting access and assigning permissions to your application instance. Always follow the recommended security policies and guidelines of your chosen storage platform.

pop-storage is a component of the Pop PHP Framework.

Top

Install

Install pop-storage using Composer.

composer require popphp/pop-storage

Or, require it in your composer.json file

"require": {
    "popphp/pop-storage" : "^2.0.0"
}

Top

Quickstart

A storage object can be created using one of the factories:

Then a local file can be uploaded to the storage platform:

Or, a remote file can be downloaded from the storage platform, which will return the file contents to be utilized within the application:

Top

Adapters

By default, there are 3 available adapters. All of the adapters share the same interface and are interchangeable. Other adapters can be created, as long as they implement the same Pop\Storage\StorageInterface.

AWS S3

The Amazon AWS S3 adapter interfaces with AWS S3 and requires the following credentials and access information to be obtained from the AWS administration console:

Microsoft Azure

The Microsoft Azure adapter interfaces with Microsoft Azure Storage and requires the following credentials and access information to be obtained from the AWS administration console:

Local Disk

The local disk adapter allows simple management of files and folders on the local disk of the application using the same interface as the other adapters. This can be useful for local development and testing, before switching to one of the enterprise adapters for production.

It only needs the main directory to serve as the base location:

Top

Working with Files

There are a number of available methods to assist in the uploading and downloading of files to and from the storage platform, as well as obtaining general data and information about them.

Put a local file on the remote location

Use a file on disk:

Use a stream of file contents:

Fetch file contents

This method returns the file contents to be utilized within the application:

Fetch file info

This method uses a custom request (i.e, a HEAD request) to return general information about a file without downloading the file's contents:

Upload files from a server request ($_FILES format)

List Files

You can list or search the files in the current location:

List all or search all directories and files together:

Copy or move file from one remote location to another

Copy of move file from/to an external location on the same remote storage resource

This allows you to copy or move files between different AWS buckets or Azure containers that are outside the currently referenced bucket or container.

To External

From External

Delete file

Top

Directories

The AWS and Azure storage resources don't explicitly support "directories" or "folders." However, they do still allow for a "directory-like" structure in the form of "prefixes." The pop-storage component normalizes that functionality into a more "directory-like" interface that allows the ability to change directories, make directories and remove directories.

NOTE: The creation or removal of empty directories is only allowed with the S3 and local adapters. The Azure storage resource doesn't allow the explicit creation or removal of empty directories. Instead, a new "directory" (prefix) is created automatically created with an uploaded file that utilizes a prefix. Conversely, a "directory" (prefix) is automatically removed when the last file that utilizes the prefix is deleted.

List Directories

You can list or search the directories in the current location:

List all or search all directories and files together:

Top

Helper Methods

There are a number of helper methods to provide information on file status or things like whether or not the file exists.

Top


All versions of pop-storage with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
popphp/pop-dir Version ^4.0.0
popphp/pop-http Version ^5.1.1
popphp/pop-utils Version ^2.1.0
aws/aws-sdk-php Version ^3.283.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package popphp/pop-storage contains the following files

Loading the files please wait ....