Download the PHP package dreadnip/chop without Composer

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

chop

Reset the OPcache content from the CLI, without reloading PHP-FPM.

Operates the same way cachetool does, but is much smaller. Chop can only do one thing: clear the opcache content. There is no support for the APCu cache, realpath cache and none of the extra opcache commands that cachetool has.

Chop also has no dependencies besides hollodotme/fast-cgi-client. This makes it unlikely to conflict with the dependencies of your own project. Because of this, there is no need to use Chop as a PHAR. Installing it through Composer results in easier coupling with the PHP version of your application.

Installation

composer require dreadnip/chop

Usage

This is a single-command application, so calling the binary is enough:

php /path/to/your/project/vendor/bin/chop

By default, the command will print a success message or error to the console. You can suppress this output with the -q option.

php /path/to/your/project/vendor/bin/chop -q

The tool attempts to use sane defaults:

If no argument is passed, it'll look for a php-fpm socket file in the following places:

This should find your socket file on most Linux distributions. If we forgot a common location, please open an issue/PR.

If multiple socket files are found, it'll try to select one by checking the filename for both the major and minor number of your PHP version.

For example: if your server has the followning socket files, and you're running PHP 8.1, it'll select the socket file with both 8 and 1 in the filename.

When no file socket file can be found, it will default to 127.0.0.1:9000.

If the defaults don't work for you, you can also explicitly pass an IP address or a path to a socket file using the --fcgi option:

php /path/to/your/project/vendor/bin/chop --fcgi=/var/run/php-fpm.sock

Deployer integration

Define a task with the command

task('clear:opcache', function () {
    run('{{bin/php}} {{ release_path }}/vendor/bin/chop');
});

Call the task after your deployment

after('deploy:symlink', 'clear:opcache');

Or run it manually

dep clear:opcache stage=production -vvv

Credit

This tool is of course inspired and based on the awesome cachetool.

Just like cachetool, the FastCGI socket code is handled by hollodotme/fast-cgi-client.


All versions of chop with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
hollodotme/fast-cgi-client Version ^3.1
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 dreadnip/chop contains the following files

Loading the files please wait ....