如何在Zend Framework3中更新composer更新时集成simplesamlphp库和更新配置

问题描述 投票:0回答:1

我使用composer安装了SIMPLESAMLPHP库

composer需要simplesamlphp / simplesamlphp

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

当我用saml-autoconfig.php文件更新我的作曲家@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)供应商/ simplesamlphp / config.php中

'baseurlpath'=>''

3)供应商/ simplesamlphpauthsources.php

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

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

php zend-framework simplesamlphp
1个回答
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

© www.soinside.com 2019 - 2024. All rights reserved.