<commit_before><?php
/* (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Deployer;


desc('Notifying New Relic of deployment');
task('deploy:newrelic', function () {
    global $php_errormsg;

    $config = get('newrelic', array());

    if (!is_array($config) ||
        !isset($config['license']) ||
        (!isset($config['app_name']) && !isset($config['application_id']))
    ) {
        throw new \RuntimeException("<comment>Please configure new relic:</comment> <info>set('newrelic', array('license' => 'xad3...', 'application_id' => '12873'));</info>");
    }

    $git = array(
        'user' => trim(runLocally('git config user.name')),
        'revision' => trim(runLocally('git log -n 1 --format="%h"')),
        'description' => trim(runLocally('git log -n 1 --format="%an: %s" | tr \'"\' "\'"')),
    );<commit_msg>Use params for New Relic deployment data<commit_after><?php
/* (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Deployer;

set('newrelic_deploy_user', function() {
  return trim(runLocally('git config user.name'));
});
set('newrelic_deploy_revision', function() {
  return trim(runLocally('git log -n 1 --format="%h"'));
});
set('newrelic_deploy_description', function() {
  return trim(runLocally('git log -n 1 --format="%an: %s" | tr \'"\' "\'"'));
});

desc('Notifying New Relic of deployment');
task('deploy:newrelic', function () {
    global $php_errormsg;

    $config = get('newrelic', array());

    if (!is_array($config) ||
        !isset($config['license']) ||
        (!isset($config['app_name']) && !isset($config['application_id']))
    ) {
        throw new \RuntimeException("<comment>Please configure new relic:</comment> <info>set('newrelic', array('license' => 'xad3...', 'application_id' => '12873'));</info>");
    }

    $git = [
        'user' => get('newrelic_deploy_user'),
        'revision' => get('newrelic_deploy_revision'),
        'description' => get('newrelic_deploy_description'),
    ];
{'fraction_non_alphanumeric': 0.19816933638443937, 'fraction_numerical': 0.007322654462242563, 'mean_word_length': 4.048498845265589, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, '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': '4458400', 'n_tokens_mistral': 709, 'n_tokens_neox': 685, 'n_words': 163}