<commit_before><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

if ( isset($_SERVER['REQUEST_METHOD']) ) die;

if ( ! isset( $_SERVER['argc'] ) )
	die( "Usage: php installer/shell.php <domain>\n" );
if ( ! file_exists('db/local.php') )
	die( "Tiki is not installed yet.\n" );

if ( isset( $_SERVER['argv'][1] ) && $_SERVER['argv'][1] != 'install' && $_SERVER['argv'][1] != 'skiperrors' ) {
	$_SERVER['TIKI_VIRTUAL'] = basename($_SERVER['argv'][1]);
}

require_once('lib/init/initlib.php');
$tikipath = dirname(__FILE__) . '/../';
TikiInit::appendIncludePath($tikipath);
require_once('lib/setup/tikisetup.class.php');
require_once('db/tiki-db.php');
require_once('installer/installlib.php');
include $local_php;

// In case of replication, ignore it during installer.
unset( $shadow_dbs, $shadow_user, $shadow_pass, $shadow_host );

/**
 *
 */
class IgnoreErrorHandler implements TikiDb_ErrorHandler
{
    /**
     * @param TikiDb $db
     * @param $query
     * @param $values
     * @param $result
     */
    function handle( TikiDb $db, $query, $values, $result )
	{

	}
}

TikiDb::get()->setErrorHandler(new IgnoreErrorHandler);

echo "Running installer for: $local_php\n";

$installer = new Installer;
if ( $_SERVER['argc'] == 2 && $_SERVER['argv'][1] == 'install' )
	$installer->cleanInstall();
else {
	$installer->update();

	if (count($installer->installed)) {
		echo "\tPatches installed:\n";
		foreach ($installer->installed as $patch)
			echo "\t\t$patch\n";<commit_msg>[FIX] When updating, more tiki libraries may be required<commit_after><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

if ( isset($_SERVER['REQUEST_METHOD']) ) die;

if ( ! isset( $_SERVER['argc'] ) )
	die( "Usage: php installer/shell.php <domain>\n" );
if ( ! file_exists('db/local.php') )
	die( "Tiki is not installed yet.\n" );

if ( isset( $_SERVER['argv'][1] ) && $_SERVER['argv'][1] != 'install' && $_SERVER['argv'][1] != 'skiperrors' ) {
	$_SERVER['TIKI_VIRTUAL'] = basename($_SERVER['argv'][1]);
}

require_once('lib/init/initlib.php');
$tikipath = dirname(__FILE__) . '/../';
TikiInit::appendIncludePath($tikipath);
require_once('lib/setup/tikisetup.class.php');
require_once('db/tiki-db.php');
require_once('installer/installlib.php');
include $local_php;

// In case of replication, ignore it during installer.
unset( $shadow_dbs, $shadow_user, $shadow_pass, $shadow_host );

/**
 *
 */
class IgnoreErrorHandler implements TikiDb_ErrorHandler
{
    /**
     * @param TikiDb $db
     * @param $query
     * @param $values
     * @param $result
     */
    function handle( TikiDb $db, $query, $values, $result )
	{

	}
}

TikiDb::get()->setErrorHandler(new IgnoreErrorHandler);

echo "Running installer for: $local_php\n";

$installer = new Installer;
if ( $_SERVER['argc'] == 2 && $_SERVER['argv'][1] == 'install' )
	$installer->cleanInstall();
else {
	require_once 'tiki-setup.php';
	$installer->update();

	if (count($installer->installed)) {
		echo "\tPatches installed:\n";
		foreach ($installer->installed as $patch)
			echo "\t\t$patch\n";
{'fraction_non_alphanumeric': 0.18071942446043165, 'fraction_numerical': 0.008057553956834532, 'mean_word_length': 4.465408805031447, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '2928144', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1193, 'n_words': 285}