Download the PHP package humanmade/php-basic-auth without Composer

On this page you can find all versions of the php package humanmade/php-basic-auth. 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 php-basic-auth

Human Made Logo

PHP Basic Auth

GitHub release (latest by date) GitHub Build Status

Basic PHP authentication for Human Made Dev and Staging environments.

screenshot of prompt in google chrome Authentication prompt in Google Chrome

screenshot of prompt in firefox Authentication prompt in Firefox

Installation & Setup

The composer file is set up to assume you want to install this package with other WordPress must-use vendor plugins. These setup instructions assume that all your composer-required must-use plugins are stored in a main /mu-plugins/vendor directory and that you are using a loader.php file to require them. You may need to adjust the configuration if your environment is different.

After installation and setup, an option to override the default basic auth setting (detected by environment) will exist on the General settings page. This option allows you to disable the basic auth on dev or staging environments from the WordPress application. By default the option will detect the environment and be checked if no setting is saved.

screenshot of new setting

Step 1

Install the plugin via composer.

Step 2

Add 'vendor/php-basic-auth/plugin.php' to the array of must-use plugins in the loader.php file in the root of your /mu-plugins directory. Make sure it is the first item in the array.

The final result should look something like this:

Step 3

Define a HM_BASIC_AUTH_USER and HM_BASIC_AUTH_PW wherever constants are defined in your project. This could be your main wp-config.php file or a separate .config/constants.php file.

Note: While not required, it's best to check that you are in a development environment before defining HM_BASIC_AUTH_USER and HM_BASIC_AUTH_PW to prevent the constant declarations from being defined in all environments. This adds an additional layer of protection against basic auth accidentally being loaded in production.

You may also want to disable basic authentication on local environments.

Your constant declarations should look something like this:

Step 4 (optional)

If you do not want to load the basic authentication check on local environments, and you have not already defined HM_LOCAL_DEV in your wp-config-local.php file, you should do that now.

You should also add these lines to your wp-config-local.sample.php.

Changelog

1.1.6

1.1.5

1.1.4

1.1.3

1.1.2

1.1.1

1.1

1.0

Credits

Created by Human Made to force authentication to view development and staging environments while still allowing those environments to be viewed in a logged-out state.

Maintained by Chris Reynolds.


Made with ❤️ by Human Made


All versions of php-basic-auth with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.7.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 humanmade/php-basic-auth contains the following files

Loading the files please wait ....