marcosmarcolin / fricc2_encrypter
使用 fricc2 扩展加密您的 PHP 文件。
1.0.0
2022-12-29 17:28 UTC
Requires
- php: >=7.4
Requires (Dev)
- nunomaduro/phpinsights: @stable
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: @stable
This package is auto-updated.
Last update: 2024-08-29 05:50:51 UTC
README
本软件包旨在通过使用 FRICC2 扩展,简化您的 PHP 脚本加密过程。
它只是一个通过 Shell 执行的编码器资源。
编码器
为了使该工具工作,您需要在您的操作系统上安装编码器到 /usr/bin/fricc2
。
默认情况下,它将使用名称 fricc2
,但如果您使用其他名称安装,可以在 Encrypter
类的构造函数中告知。
安装
composer require marcosmarcolin/fricc2_encrypter
兼容性
仅在 Linux 环境中测试过:Ubuntu 和 Debian。
需要 PHP 版本 >= 7.4.x。
如何使用
仅编码一个文件
<?php use MarcosMarcolin\Fricc2Encrypter\Encrypter; include 'vendor/autoload.php'; $from = __DIR__ . '/src/file.php'; $to = __DIR__ . '/src/new_file.php'; try { $Encrypter = new Encrypter($from, $to); $Encrypter->simpleEncrypt(); // true or false } catch (Exception $e) { // Any error that occurs will throw an exception. var_dump($e->getMessage()); }
递归地将一个目录编码到另一个目录,使用
<?php try { $Encrypter = new Encrypter($from, $to); $Encrypter->recursiveEncrypt(); // true or false } catch (Exception $e) { // Any error that occurs will throw an exception. var_dump($e->getMessage()); }
捕获失败或成功的文件,使用
<?php // Only for recursive encoder $faileds = $Encrypter->getFaileds()); // array $success = $Encrypter->getSuccess()); // array
代码质量
使用 PHPCS 检查错误
composer phpcs
使用 PHPCS 自动修正错误
composer phpcbf
使用 PHPInsights 检查错误
composer phpinsights
使用 PHPInsights 自动修正错误
composer phpinsights-fix
作者
Marcos Marcolin marcolindev@gmail.com