1. Go to this page and download the library: Download index0h/yii2-phar library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace index0h\phar\components\php;
use index0h\phar\base\Component;
use index0h\phar\base\FileEvent;
/**
* Removes whitespace and comments from php files.
*/
class Minimize extends Component
{
/**
* For all php files without suffix Controller (because help command parses comments).
*/
protected $match = ['/(?<!Controller)\.php/us'];
/**
* Modification of file.
*
* @param FileEvent $event Event with file information.
*/
public function processFile(FileEvent $event)
{
file_put_contents($event->realPath, php_strip_whitespace($event->realPath));
}
}
sh
php composer.phar
sh
php composer.phar global
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.