Download the PHP package ninjaparade/s3-uploads without Composer

On this page you can find all versions of the php package ninjaparade/s3-uploads. 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 s3-uploads

S3 Uploads
Lightweight "drop-in" for storing WordPress uploads on Amazon S3 instead of the local filesystem.
Build status Coverage via codecov.io
A Human Made project. Maintained by @joehoyle.

S3 is a WordPress plugin to store uploads on S3. S3-Uploads aims to be a lightweight "drop-in" for storing uploads on Amazon S3 instead of the local filesystem.

It's focused on providing a highly robust S3 interface with no "bells and whistles", WP-Admin UI or much otherwise. It comes with some helpful WP-CLI commands for generating IAM users, listing files on S3 and Migrating your existing library to S3.

Getting Set Up

Once you have git cloned the repo, or added it as a Git Submodule, add the following constants to your wp-config.php:

You must then enable the plugin. To do this via WP-CLI use command:

The next thing that you should do is to verify your setup. You can do this using the verify command like so:

You'll want to create a new IAM user for the S3-Uploads plugin, so you are not using admin level access keys on your site. S3-Uploads can create the IAM user for you and asign the correct permissions.

This will provide you with a new Access Key and Secret Key which you can configure S3-Uploads with. Paste the values in the wp-config.php. Once you have migrated your media to S3 with any of the below methods, you'll want to enable S3 Uploads: wp s3-uploads enable.

If you want to create your IAM user yourself, or attach the neccessary permissions to an existing user, you can output the policy via wp s3-uploads generate-iam-policy

Migrating your Media to S3

S3-Uploads can migrate your existing media library to S3. Once you have S3-Uploads up and running, use the following WP-CLI command:

By default, S3-Uploads will keep your files locally just incase something goes wrong, but you can delete with the --delete-local flag.

Listing files on S3

S3-Uploads comes with a WP-CLI command for listing files in the S3 bucket for debugging etc.

Uploading files to S3

Sometimes the wp s3-uploads migrate-attachments command may not be enough to migrate your uploads to S3, as that will only move attachment files to S3. If you are using any plugins that store data in uploads, you'll want to upload the whole uploads directory.

Passing --sync will only upload files that are newer in <from> or that don't exist on S3 already. Use --dry-run to test.

There is also an all purpose cp command for arbitrary copying to and from S3.

Note: as either <from> or <to> can be S3 or local locations, you must specify the full S3 location via s3://mybucket/mydirectory for example cp ./test.txt s3://mybucket/test.txt.

Cache Control

You can define the default HTTP Cache-Control header for uploaded media using the following constant:

You can also configure the Expires header using the S3_UPLOADS_HTTP_EXPIRES constant For instance if you wanted to set an asset to effectively not expire, you could set the Expires header way off in the future. For example:

Default Behaviour

As S3 Uploads is a plug and play plugin, activating it will start rewriting image URLs to S3, and also put new uploads on S3. Sometimes this isn't required behaviour as a site owner may want to upload a large amount of media to S3 using the wp-cli commands before enabling S3 Uploads to direct all uploads requests to S3. In this case one can define the S3_UPLOADS_AUTOENABLE to false. For example, place the following in your wp-config.php:

To then enable S3 Uploads rewriting, use the wp-cli command: wp s3-uploads enable / wp s3-uploads disable to toggle the behaviour.

URL Rewrites

By default, S3 Uploads will use the canonical S3 URIs for referencing the uploads, i.e. [bucket name].s3.amazonaws.com/uploads/[file path]. If you want to use another URL to serve the images from (for instance, if you wish to use S3 as an origin for CloudFlare), you should define S3_UPLOADS_BUCKET_URL in your wp-config.php:

Offline Development

While it's possible to use S3 Uploads for local development (this is actually a nice way to not have to sync all uploads from production to development), if you want to develop offline you have a couple of options.

  1. Just disable the S3 Uploads plugin in your development environment.
  2. Define the S3_UPLOADS_USE_LOCAL constant with the plugin active.

Option 2 will allow you to run the S3 Uploads plugin for production parity purposes, it will essentially mock Amazon S3 with a local stream wrapper and actually store the uploads in your WP Upload Dir /s3/.

Credits

Created by Human Made for high volume and large-scale sites. We run S3 Uploads on sites with millions of monthly page views, and thousands of sites.

Written and maintained by Joe Hoyle. Thanks to all our contributors.

Interested in joining in on the fun? Join us, and become human!


All versions of s3-uploads with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
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 ninjaparade/s3-uploads contains the following files

Loading the files please wait ....