Download the PHP package websharks/wp-php-rv without Composer

On this page you can find all versions of the php package websharks/wp-php-rv. 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 wp-php-rv

WP PHP vX.x+ (Version Check w/ Dashboard Notice)

Stub for WordPress themes/plugins that require PHP vX.x+ (i.e. a minimum version that you define).


Example Usage in a Typical WordPress Theme/Plugin File


Alternate Approach

The check.php file will automatically return true upon using include() or require() in your scripts; i.e., iff the installation site is running PHP vX.x+ (as configured by $GLOBALS['wp_php_rv']). Otherwise it returns false. Therefore, the simplest way to run your check is to use if(require('wp-php-rv/src/includes/check.php')). However, you could also choose to do it this way.


Dashboard Notice that Calls your Software by Name

Note: If you omit the $brand_name argument, a default value is used instead. The default value is ucwords('[calling file basedir]'); e.g., if /my-plugin/stub.php calls wp-php-rv/src/includes/check.php, the default $software_name automatically becomes My Plugin. Nice!


What if multiple themes/plugins use this?

This is fine! :-) The wp-php-rv/src/includes/check.php file uses function_exists() as a wrapper; which allows it to be included any number of times, and by any number of plugins; and also from any number of locations. The only thing to remember, is that you MUST be sure to define $GLOBALS['wp_php_rv'] each time; i.e., each time you include('wp-php-rv/src/includes/check.php') or require('wp-php-rv/src/includes/check.php').

The point here, is that $GLOBALS['wp_php_rv'] defines a PHP version that is specific to your plugin requirements, so it should be defined explicitly by each plugin developer before they include('wp-php-rv/src/includes/check.php') or require('wp-php-rv/src/includes/check.php').


Can this just go at the top of my existing theme/plugin file?

No, there are two important things to remember.

  1. Don't forget to bundle a copy of the websharks/wp-php-rv repo with your theme/plugin. All you really need is the /src directory.
  2. Don't leave your existing code in the same file. Use this in a stub file that checks for PHP vX.x+ first (as seen in the examples above), BEFORE loading your code which depends on PHP vX.x+. Why? If you put a PHP vX.x+ check at the top of an existing PHP file, and that particular PHP file happens to contain code which is only valid in PHP v5.2 (for instance), it may still trigger a syntax error. For this reason, you should move your code into a separate file and create a stub file that checks for the existence of PHP vX.x+ first.

Can I test for required PHP extensions too?

Yes, $GLOBALS['wp_php_rv'] can be either a string with a required version, or an array with both a required version and a nested array of required PHP extensions. The easiest way to show how this works is by example (as seen below). Note that your array of required PHP extensions must be compatible with PHP's extension_loaded() function.


What else can I test for with this system?

A compatible OS, a compatible PHP version, required bits, required PHP functions, required PHP extensions, and a compatible WP version.


PHP Compatibility

Please note that the WP PHP RV software itself requires PHP v5.2 or higher, the same as WordPress core.


Copyright: © 2015 WebSharks, Inc. (coded in the USA)

Released under the terms of the GNU General Public License.


All versions of wp-php-rv with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2
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 websharks/wp-php-rv contains the following files

Loading the files please wait ....