<commit_before><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Framework;

/**
 * Need 'allow_url_fopen' to be on.
 */
if (! ini_get('allow_url_fopen')) {
    echo "Cannot update when 'allow_url_fopen' is turned off." . PHP_EOL;
    exit(1);
}

/**
 * Pull changes the system as a whole.
 */
`git pull`;

/**
 * Update the library packages.
 */
 
// the package directory
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'package';

// get the list of available repositories
$url = 'http://github.com/api/v2/json/repos/show/auraphp';
$context = stream_context_create(array(
    'http' => array(
        'method' => "GET",
    ),
));
$json = file_get_contents($url, FALSE, $context);
$data = json_decode($json);

// for each of the repositories ...
foreach ($data->repositories as $repo) {
    
    // only use 'Aura.Package' repositories as packages
    if (! preg_match('/Aura\.[A-Z0-9_]+/', $repo->name)) {
        continue;
    }
    
    // does the package exist locally ?
    $sub = $dir . DIRECTORY_SEPARATOR . $repo->name;
    if (is_dir($sub)) {
        
        // pull changes to existing package
        echo "Pulling package '{$repo->name}'." . PHP_EOL;
        `cd $sub; git pull`;
        
    } else {
        
        // clone new package for installation
        echo "Cloning package '{$repo->name}'." . PHP_EOL;
        `cd $dir; git clone {$repo->url}`;
        
    }
}

// done!
echo 'Done!' . PHP_EOL;
<commit_msg>minor mods<commit_after><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Framework;

/**
 * Need 'allow_url_fopen' to be on.
 */
if (! ini_get('allow_url_fopen')) {
    echo "Cannot update when 'allow_url_fopen' is turned off." . PHP_EOL;
    exit(1);
}

/**
 * Pull changes the system as a whole.
 */
passthru('git pull');

/**
 * Update the library packages.
 */
 
// the package directory
$dir = __DIR__ . DIRECTORY_SEPARATOR . 'package';

// get the list of available repositories
$url = 'http://github.com/api/v2/json/repos/show/auraphp';
$context = stream_context_create(array(
    'http' => array(
        'method' => "GET",
    ),
));
$json = file_get_contents($url, FALSE, $context);
$data = json_decode($json);

// for each of the repositories ...
foreach ($data->repositories as $repo) {
    
    // only use 'Aura.Package' repositories as packages
    if (! preg_match('/Aura\.[A-Z0-9_]+/', $repo->name)) {
        continue;
    }
    
    // does the package exist locally ?
    $sub = $dir . DIRECTORY_SEPARATOR . $repo->name;
    if (is_dir($sub)) {
        
        // pull changes to existing package
        echo "Pulling package '{$repo->name}'." . PHP_EOL;
        passthru("cd $sub; git pull");
        
    } else {
        
        // clone new package for installation
        echo "Cloning package '{$repo->name}'." . PHP_EOL;
        passthru("cd $dir; git clone {$repo->url}");
        
    }
}

// done!
echo 'Done!' . PHP_EOL;

{'fraction_non_alphanumeric': 0.16155088852988692, 'fraction_numerical': 0.002584814216478191, 'mean_word_length': 2.4630872483221475, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '442223', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1037, 'n_words': 277}