在Zend Framework3中更新作曲家时,如何集成simplesamlphp库和更新配置

时间:2019-04-15 11:03:52

标签: php zend-framework simplesamlphp

我使用Composer安装了SIMPLESAMLPHP库

撰写者需要simplesamlphp / simplesamlphp

要进行配置,我需要在SIMPLESAMLPHP库根目录中添加saml-autoconfig.php文件。但是我的供应商文件夹位于.gitignore文件中。

当我使用saml-autoconfig.php文件更新composer @production时,整个配置丢失了。

我需要在作曲家更新时对其进行配置。

如果有人有想法。请帮助

我需要添加以下配置文件

1)在saml-autoconfig.php中。

$metadata_url_for = array(
    /* WARNING WARNING WARNING
     *   You MUST remove the testing IdP (idp.oktadev.com) from a production system,
     *   as the testing IdP will allow ANYBODY to log in as ANY USER!
     * WARNING WARNING WARNING
     * For testing with http://saml.oktadev.com use the line below:
     */
     // 'test' => 'http://idp.oktadev.com/metadata',
);

2)vendor / simplesamlphp / config.php

'baseurlpath'=>''

3)vendor / simplesamlphpauthsources.php

 'default-sp'=>''  //its default one .I want to add more sp.

如何动态添加saml-autoconfig.php此文件并设置我的配置。

1 个答案:

答案 0 :(得分:0)

如果要在作曲家完成安装/更新过程后执行命令,则可以使用post-install-cmdpost-update-cmd选项。

在这种情况下,假设config文件夹包含您的配置,则需要将其添加到composer.json中:

{
    "require": {
        "simplesamlphp/simplesamlphp": "^1.17"
    },
    "scripts": {
        "post-install-cmd": [
            "cp ./config/config.php ./vendor/simplesamlphp/config.php",
            "cp ./config/authsources.php ./vendor/simplesamlphp/authsources.php"
        ],
        "post-update-cmd": [
            "cp ./config/config.php ./vendor/simplesamlphp/config.php",
            "cp ./config/authsources.php ./vendor/simplesamlphp/authsources.php"
        ]
    }
}

我还下载了simplesamlphp库,您报告的路径似乎不正确。安装配置文件的正确路径应为vendor/simplesamlphp/simplesamlphp/config