<commit_before><?php

namespace Apps\Webiny\Php\Services\Lib;

use Apps\Webiny\Php\Lib\Apps\JsApp;
use Apps\Webiny\Php\Lib\WebinyTrait;
use Webiny\Component\StdLib\StdLibTrait;

class AppInstaller
{
    use WebinyTrait, StdLibTrait;

    private $privateKey = '';

    public function __construct()
    {
        $this->privateKey = $this->wConfig()->get('Marketplace.Keys.Private');
    }

    public function install($appData)
    {
        $bsConfig = file_get_contents($this->wStorage('Root')->getAbsolutePath('webiny.json'));
        $bsConfig = $this->arr(json_decode($bsConfig, true));
        $webPath = $this->wConfig()->get('Application.WebPath');

        $port = $bsConfig->keyNested('browserSync.port', 3000, true);
        $bsPath = $this->url($webPath)->setPort(intval($port) + 1);

        $curl = new \Curl\Curl();
        $curl->setTimeout(0);
        $curl->setOpt(CURLOPT_WRITEFUNCTION, function ($curl, $data) {
            $this->echo(json_decode($data, true));

            return strlen($data);
        });

        // Pick only the necessary data to send to CLI
        $cliData = [];
        $keys = ['id', 'name', 'localName', 'packagist', 'repository', 'version', 'webinyVersion'];
        foreach ($keys as $key) {
            $cliData[$key] = $appData[$key];
        }

        $curl->post($bsPath . '/?action=install', $cliData);

        return true;
    }

    private function echo ($data)
    {
        echo json_encode($data) . "_-_";
        flush();
    }
}<commit_msg>Removed private keys from installation class<commit_after><?php

namespace Apps\Webiny\Php\Services\Lib;

use Apps\Webiny\Php\Lib\WebinyTrait;
use Webiny\Component\StdLib\StdLibTrait;

class AppInstaller
{
    use WebinyTrait, StdLibTrait;

    public function install($appData)
    {
        $bsConfig = file_get_contents($this->wStorage('Root')->getAbsolutePath('webiny.json'));
        $bsConfig = $this->arr(json_decode($bsConfig, true));
        $webPath = $this->wConfig()->get('Application.WebPath');

        $port = $bsConfig->keyNested('browserSync.port', 3000, true);
        $bsPath = $this->url($webPath)->setPort(intval($port) + 1);

        $curl = new \Curl\Curl();
        $curl->setTimeout(0);
        $curl->setOpt(CURLOPT_WRITEFUNCTION, function ($curl, $data) {
            $this->echo(json_decode($data, true));

            return strlen($data);
        });

        // Pick only the necessary data to send to CLI
        $cliData = [];
        $keys = ['id', 'name', 'localName', 'packagist', 'repository', 'version', 'webinyVersion'];
        foreach ($keys as $key) {
            $cliData[$key] = $appData[$key];
        }

        $curl->post($bsPath . '/?action=install', $cliData);

        return true;
    }

    private function echo ($data)
    {
        echo json_encode($data) . "_-_";
        flush();
    }
}
{'fraction_non_alphanumeric': 0.1693548387096774, 'fraction_numerical': 0.004207573632538569, 'mean_word_length': 2.7342931937172774, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '2248691', 'n_tokens_mistral': 947, 'n_tokens_neox': 916, 'n_words': 168}