nmalservet/php-requirements-checker

一个小型库,用于检查您的PHP应用中的需求。您必须在配置文件my-requirements.php中指定需要安装的库、需要创建的文件夹和文件,然后您可以执行脚本,该脚本将显示每个需求的状况。

1.1 2016-09-14 14:28 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:58:15 UTC


README

php-requirements-checker 是一个php脚本,可以集成到每个PHP软件中,以检查需求是否良好

如何使用

您需要将两个文件php-requirements-checker.php和my-requirements.php复制到您的PHP应用中。另一种方法是使用composer获取最新稳定版本。请转到composer部分进行操作。

添加您自己的库、文件夹和文件进行检查

您需要添加自己的库进行检查,以及文件夹和文件。为此,编辑文件my-requirements.php。

启动您的自定义php需求检查器

通过网页: https:///myapp/php-requirements-checker.php

##结果 您将获得一个HTML格式的结果,如下面的示例所示

#可选部分:通过Composer安装 Composer是一个强大的工具,用于安装外部库。如果您需要了解composer如何工作,请访问此页面: https://getcomposer.org.cn/

要将此库通过composer添加到您的安装中,您只需要将"nmalservet/php-requirements-checker"添加到您的composer.json中的"require"部分,如下例所示

"require": {
        "nmalservet/php-requirements-checker":"*",
        ...
    },

然后,运行命令"composer update"。Composer将可能将库安装到您的"vendor"文件夹中。

您需要创建自己的配置并从您的安装中调用脚本。首先将文件my-requirements.php复制到您的文件夹中,例如"my-own-requirements.php"。打开一个文件,例如my-checker.php,然后包含配置文件和脚本。

include ('my-own-requirements.php');
require(__DIR__ . '/../vendor/nmalservet/php-requirements-checker/php-requirements-checker.php');

因此,要检查您的需求是否已安装,您需要使用此url: https:///myapp/my-checker.php

#可选部分:通过限制访问权限保护检查需求的脚本 要保护脚本,在"my-checker.php"的目录中创建一个.htaccess文件。然后复制以下行

AuthName "Admin Only"
AuthType Basic
AuthUserFile /var/www/.passwd
require valid-user
</FilesMatch> ```

You will need to create a file .passwd into /var/www.
To do it use toe command line tool htpasswd : https://httpd.apache.ac.cn/docs/current/programs/htpasswd.html