<commit_before><?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Plume Framework, a simple PHP Application Framework.
# Copyright (C) 2001-2007 <NAME> and contributors.
#
# Plume Framework is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Plume Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
# ***** END LICENSE BLOCK ***** */

/**
 * Migration script.
 */
if (version_compare(PHP_VERSION, '5.2.4', '<')) {
    echo 'Error: You need at least PHP 5.2.4'."\n";
    exit(1);
}
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__));
require 'Pluf.php';
require 'Console/Getopt.php';

global $debug;
$debug = false; // Yes a dirty global variable.
$search_path = null;

$cg = new Console_Getopt();
$shortoptions = 'aixubrc:v:d';
$longoptions = array('app=', 'version=', 'conf=', 'search-path=', 
                     'include-path=');

$args = $cg->readPHPArgv(); 

function debug($what)
{
    global $debug;
    if ($debug) {
        echo($what."\n");
    }
}

function usage()
{
    echo 'Usage examples:'."\n"
        .' Upgrade all:      migrate.php --conf=path/to/config.php -a'."\n"
        .' All to version 3: migrate.php --conf=path/to/config.php -a -v3'."\n"
        .' Upgrade MyApp:    migrate.php --conf=path/to/config.php --app=MyApp'."\n"
        .' Backup MyApp:     migrate.php --conf=path/to/config.php --app=MyApp -b /path/to/backup/folder [backupname]'."\n"
        .' Restore MyApp:    migrate.php --conf=path/to/config.php --app=MyApp -r /path/to/backup/folder backupname'."\n"
        .''."\n"
        .'Options:'."\n"
        .' c, --conf:      Path to the configuration file.'."\n"
        .' a:              Upgrade all the installed applications.'."\n"
        .' v, --version:   Upgrade/Downgrade to the given version.'."\n"
        .' --app:          Application to upgrade/downgrade.'."\n"
        .' u:              Dry run, do nothing.'."\n"
        .' --search-path:  Set the DB search path before the run.'."\n"
        .' --include-path: Paths to add to the PHP include path.'."\n"        
        .' d:              Display debug information.'."\n"
        .' i:              Install the application(s).'."\n"
        .' x:              Uninstall the application(s).'."\n"
        .' b:              Backup the application(s).'."\n"
        .' r:              Restore the application(s).'."\n"
        .''."\n"
        .'Note: The command line parser of PEAR is not very robust'."\n"
        .'      if you have an unexpected error about an offset not'."\n"
        .'      set. Please report a bug. Thanks!'."\n";

}

try {<commit_msg>Fixed error in the documentation string.<commit_after><?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Plume Framework, a simple PHP Application Framework.
# Copyright (C) 2001-2007 <NAME> and contributors.
#
# Plume Framework is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Plume Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
# ***** END LICENSE BLOCK ***** */

/**
 * Migration script.
 */
if (version_compare(PHP_VERSION, '5.2.4', '<')) {
    echo 'Error: You need at least PHP 5.2.4'."\n";
    exit(1);
}
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__));
require 'Pluf.php';
require 'Console/Getopt.php';

global $debug;
$debug = false; // Yes a dirty global variable.
$search_path = null;

$cg = new Console_Getopt();
$shortoptions = 'aixubrc:v:d';
$longoptions = array('app=', 'version=', 'conf=', 'search-path=', 
                     'include-path=');

$args = $cg->readPHPArgv(); 

function debug($what)
{
    global $debug;
    if ($debug) {
        echo($what."\n");
    }
}

function usage()
{
    echo 'Usage examples:'."\n"
        .' Upgrade all:     migrate.php --conf=path/to/config.php -a'."\n"
        .' Upgrade MyApp:   migrate.php --conf=path/to/config.php --app=MyApp'."\n"
        .' Backup MyApp:    migrate.php --conf=path/to/config.php --app=MyApp -b /path/to/backup/folder [backupname]'."\n"
        .' Restore MyApp:   migrate.php --conf=path/to/config.php --app=MyApp -r /path/to/backup/folder backupname'."\n"
        .' MyApp to ver. 3: migrate.php --conf=path/to/config.php --app=MyApp -v3'."\n"
        .''."\n"
        .'Options:'."\n"
        .' c, --conf:      Path to the configuration file.'."\n"
        .' a:              Upgrade all the installed applications.'."\n"
        .' v, --version:   Upgrade/Downgrade to the given version.'."\n"
        .' --app:          Application to upgrade/downgrade.'."\n"
        .' u:              Dry run, do nothing.'."\n"
        .' --search-path:  Set the DB search path before the run.'."\n"
        .' --include-path: Paths to add to the PHP include path.'."\n"        
        .' d:              Display debug information.'."\n"
        .' i:              Install the application(s).'."\n"
        .' x:              Uninstall the application(s).'."\n"
        .' b:              Backup the application(s).'."\n"
        .' r:              Restore the application(s).'."\n"
        .''."\n"
        .'Note: The command line parser of PEAR is not very robust'."\n"
        .'      if you have an unexpected error about an offset not'."\n"
        .'      set. Please report a bug. Thanks!'."\n";

}

try {
{'fraction_non_alphanumeric': 0.1581423584762483, 'fraction_numerical': 0.009713158294126575, 'mean_word_length': 2.3299646286003033, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '2830592', 'n_tokens_mistral': 2153, 'n_tokens_neox': 2024, 'n_words': 673}