<commit_before><?php
/**
 * @package deployment
 * @subpackage dragonfly.user_consolidation
 * 
 * Create kuser and user_login_data record for each system_kuser
 * 
 * Requires re-run after server code depoloy
 * Touch stop_user_migration to stop execution
 * 
 * @todo Use existing kuser if already migrated
 */

$dryRun = true; //TODO: change for real run
if($argc > 1 && $argv[1] == 'realrun')
	$dryRun = false;
	
$admin_console_partner_id = Partner::ADMIN_CONSOLE_PARTNER_ID;
$stopFile = dirname(__FILE__).'/stop_user_migration'; // creating this file will stop the script
$userLimitEachLoop = 500; //TODO: change

//------------------------------------------------------

require_once(dirname(__FILE__).'/../../../bootstrap.php');

// stores the last handled admin kuser id, helps to restore in case of crash
$lastUserFile = '05.last_system_user';
$lastUser = 0;
if(file_exists($lastUserFile)) {
	$lastUser = file_get_contents($lastUserFile);<commit_msg>added a check for existing partner -2 kuser to prevent errors cause when running this script more than once<commit_after><?php
/**
 * @package deployment
 * @subpackage dragonfly.user_consolidation
 * 
 * Create kuser and user_login_data record for each system_kuser
 * 
 * Requires re-run after server code depoloy
 * Touch stop_user_migration to stop execution
 * 
 */

$dryRun = true; //TODO: change for real run
if($argc > 1 && $argv[1] == 'realrun')
	$dryRun = false;
	
$admin_console_partner_id = Partner::ADMIN_CONSOLE_PARTNER_ID;
$stopFile = dirname(__FILE__).'/stop_user_migration'; // creating this file will stop the script
$userLimitEachLoop = 500; //TODO: change

//------------------------------------------------------

require_once(dirname(__FILE__).'/../../../bootstrap.php');

// stores the last handled admin kuser id, helps to restore in case of crash
$lastUserFile = '05.last_system_user';
$lastUser = 0;
if(file_exists($lastUserFile)) {
	$lastUser = file_get_contents($lastUserFile);
{'fraction_non_alphanumeric': 0.1695519348268839, 'fraction_numerical': 0.008655804480651732, 'mean_word_length': 3.5591647331786542, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6002612', 'n_tokens_mistral': 620, 'n_tokens_neox': 594, 'n_words': 172}