Download the PHP package nodejs-php-fallback/nodejs-php-fallback without Composer

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

NodejsPhpFallback

Latest Stable Version Build Status StyleCI Test Coverage Code Climate

Allow you to call node.js module or scripts throught PHP and call a fallback function if node.js is not available.

Usage

Edit composer.json to add nodejs-php-fallback to "require", your "npm" dependancies to "extra" and to both "post-install-cmd" and "post-update-cmd" in "scripts"

For example, to use node.js stylus and fallback to the php kylekatarnls/stylus port, use:

With this configuration, both node stylus and php kylekatarnls/stylus packages will be installed and updated when you update or install with composer if node is installed, else, only the php package will be.

So you can easily create a function that will try first to call the node package, then else the php one:

Here will contain CSS code rendered from your stylus file, no matter node is installed or not. So you can install node on your production environment to benefit of the last official version of a npm package but any one can test or develop your project with no need to install node.

Note: the PHP fallback can be a simple php function, not necessarily a call to a class or a composer package.

Settings

The extra.npm can be an object with npm required packages as key and versions for each of them as value (see https://docs.npmjs.com/misc/semver for version definition). You can also set it as an array of package names, it's the same as specify all packages dependancies with version. Else if you need only one package and don't care about the version, just pass it as a string:

Array configuration:

String configuration:

Ask the user to confirm package install

You can use the npm-confirm setting to ask the user if he want to install one or more npm package. This should be used to make the user aware npm packages will be installed, and what for they are. This is also a way to not install optional packages if they are used in a user specific case.

With the configuration above, when the user will execute compoers update or composer install, he will be asked the following:

Each of stylus and less packages will be installed only if the user enter Y on confirm or if he ran the command with the mode --no-interaction.

The clean-css package will be installed with no confirm.


All versions of nodejs-php-fallback with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
composer-plugin-api Version ^1.0 || ^2.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 nodejs-php-fallback/nodejs-php-fallback contains the following files

Loading the files please wait ....