<commit_before><?php

/*
 * This file is part of the Acme PHP project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace AcmePhp\Cli\Action;

use AcmePhp\Ssl\CertificateResponse;
use AlibabaCloud\Cdn\Cdn;
use AlibabaCloud\Client\AlibabaCloud;

/**
 * Action to install certificate in an Aliyun Waf.
 *
 * @author <NAME> <<EMAIL>>
 */
class InstallAliyunCdnAction extends AbstractAction
{
    /**
     * {@inheritdoc}
     */
    public function handle($config, CertificateResponse $response)
    {
        $issuerChain = [];
        $issuerChain[] = $response->getCertificate()->getPEM();

        $issuerCertificate = $response->getCertificate()->getIssuerCertificate();
        while (null !== $issuerCertificate) {
            $issuerChain[] = $issuerCertificate->getPEM();
            $issuerCertificate = $issuerCertificate->getIssuerCertificate();
        }
        $cert = implode("\n", $issuerChain);

        $key = $response->getCertificateRequest()->getKeyPair()->getPrivateKey()->getPEM();

        AlibabaCloud::accessKeyClient($config['accessKeyId'], $config['accessKeySecret'])->regionId('cn-hangzhou')->asDefaultClient();
        Cdn::v20180510()->setDomainServerCertificate()
            ->withDomainName($config['domain'])
            ->withCertName($config['domain'] . '_' . date('Y_m_d_H_i_s'))<commit_msg>style ci, no spacing near dot<commit_after><?php

/*
 * This file is part of the Acme PHP project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace AcmePhp\Cli\Action;

use AcmePhp\Ssl\CertificateResponse;
use AlibabaCloud\Cdn\Cdn;
use AlibabaCloud\Client\AlibabaCloud;

/**
 * Action to install certificate in an Aliyun Waf.
 *
 * @author <NAME> <<EMAIL>>
 */
class InstallAliyunCdnAction extends AbstractAction
{
    /**
     * {@inheritdoc}
     */
    public function handle($config, CertificateResponse $response)
    {
        $issuerChain = [];
        $issuerChain[] = $response->getCertificate()->getPEM();

        $issuerCertificate = $response->getCertificate()->getIssuerCertificate();
        while (null !== $issuerCertificate) {
            $issuerChain[] = $issuerCertificate->getPEM();
            $issuerCertificate = $issuerCertificate->getIssuerCertificate();
        }
        $cert = implode("\n", $issuerChain);

        $key = $response->getCertificateRequest()->getKeyPair()->getPrivateKey()->getPEM();

        AlibabaCloud::accessKeyClient($config['accessKeyId'], $config['accessKeySecret'])->regionId('cn-hangzhou')->asDefaultClient();
        Cdn::v20180510()->setDomainServerCertificate()
            ->withDomainName($config['domain'])
            ->withCertName($config['domain'].'_'.date('Y_m_d_H_i_s'))
{'fraction_non_alphanumeric': 0.1502751031636864, 'fraction_numerical': 0.005502063273727648, 'mean_word_length': 3.6618589743589745, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5438811', 'n_tokens_mistral': 867, 'n_tokens_neox': 838, 'n_words': 171}