<commit_before><?php
/**
 * @author <NAME> <<EMAIL>>
 * Date: 08/06/2012
 * Time: 16:34
 */

function copy_directory($source, $destination) {
    $result = exec('cp -R ' . $source . ' ' . $destination);
    return $result;
}

$autogeneratedDirs = array('tmp', 'test', 'config');

if(!file_exists('vendor')) {
    die("[deploy] FAILED: Command must be run at the same level as composer.json\n");
}

if(file_exists('httpdocs')) {
    die("[deploy] FAILED: httpdocs directory already exists, remove if you wish to deploy a new xBoilerplate skeleton\n");
}

$baseDir = __DIR__ . DIRECTORY_SEPARATOR;

foreach($autogeneratedDirs as $directory) {
    if(file_exists($directory)) {
        mkdir($directory);
    }
}
copy_directory($baseDir . 'httpdocs', '.');

copy($baseDir . 'config' . DIRECTORY_SEPARATOR . 'config.php', 'config' . DIRECTORY_SEPARATOR . '/config.php');
copy($baseDir . "Vagrantfile", "Vagrantfile");

echo "[deploy] SUCCESS: your xBoilerplate skeleton was created\n";
echo "         You can start it by using the command: vagrant up\n";
echo "         And then accessing it via http://10.10.10.10\n";<commit_msg>Finishing touches to the deployment script.<commit_after><?php
/**
 * @author <NAME> <<EMAIL>>
 * Date: 08/06/2012
 * Time: 16:34
 */

echo "[deploy] Starting xBoilerplate deployment\n\n";

function copy_directory($source, $destination) {
    $result = exec('cp -R ' . $source . ' ' . $destination);
    return $result;
}

$autogeneratedDirs = array('tmp', 'test', 'config');

if(!file_exists('vendor')) {
    die("[deploy] FAILED: Command must be run at the same level as composer.json\n");
}

if(file_exists('httpdocs')) {
    die("[deploy] FAILED: httpdocs directory already exists, remove if you wish to deploy a new xBoilerplate skeleton\n");
}

$baseDir = __DIR__ . DIRECTORY_SEPARATOR;

foreach($autogeneratedDirs as $directory) {
    if(!file_exists($directory)) {
        mkdir($directory);
    }
}
copy_directory($baseDir . 'httpdocs', '.');

copy($baseDir . 'config' . DIRECTORY_SEPARATOR . 'config.php', 'config' . DIRECTORY_SEPARATOR . 'config.php');
copy($baseDir . "Vagrantfile", "Vagrantfile");

echo "[deploy] SUCCESS: your xBoilerplate skeleton was created\n";
echo "         You can start it by using the command: vagrant up\n";
echo "         And then accessing it via http://10.10.10.10\n";
{'fraction_non_alphanumeric': 0.1608900299529311, 'fraction_numerical': 0.017115960633290545, 'mean_word_length': 4.082608695652174, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7163585', 'n_tokens_mistral': 814, 'n_tokens_neox': 765, 'n_words': 205}