<commit_before>#!/usr/bin/php -q
<?php

require_once 'ykval-synclib.php';
require_once 'ykval-config.php';
require_once "System/Daemon.php";                 

$appname="ykval-queue";

System_Daemon::setOption("appName", $appname);  
System_Daemon::setOption("appDescription", "Yubico val-server sync daemon"); 
System_Daemon::setOption("authorName", "<EMAIL>");  
System_Daemon::setOption("authorEmail", "<EMAIL>"); 

if ($argc==2 && strcmp($argv[1], "install")==0) {
  $autostart_path = System_Daemon::writeAutoRun();
  if ($autostart_path!=1){ 
    echo "Successfully created start script at " . $autostart_path . "\n";
    echo "To start daemon use: /etc/init.d/".$appname." start\n";
    exit();
  } else {
    echo "Start script already created\n";
    echo "To start daemon use: /etc/init.d/".$appname." start\n";
    exit();
  }
 }

System_Daemon::start();                           // Spawn Deamon!
/* Application start */

$sl = new SyncLib();

# Loop forever and resync

$res==0;
while ($res==0) {
  $sl->reSync($baseParams['__YKVAL_SYNC_OLD_LIMIT__'], 
	      $baseParams['__YKVAL_SYNC_RESYNC_TIMEOUT__']);
  $res=sleep($baseParams['__YKVAL_SYNC_INTERVAL__']);
 }

error_log("Stopping " . $appname);
System_Daemon::stop();

?><commit_msg>Added help description to sync daemon<commit_after>#!/usr/bin/php -q
<?php

require_once 'ykval-synclib.php';
require_once 'ykval-config.php';
require_once "System/Daemon.php";                 

$appname="ykval-queue";

System_Daemon::setOption("appName", $appname);  
System_Daemon::setOption("appDescription", "Yubico val-server sync daemon"); 
System_Daemon::setOption("authorName", "<EMAIL>");  
System_Daemon::setOption("authorEmail", "<EMAIL>"); 

if ($argc==2 && strcmp($argv[1], "install")==0) {
  $autostart_path = System_Daemon::writeAutoRun();
  if ($autostart_path!=1){ 
    echo "Successfully created start script at " . $autostart_path . "\n";
    echo "To start daemon use: /etc/init.d/".$appname." start\n";
    exit();
  } else {
    echo "Start script already created\n";
    echo "To start daemon use: /etc/init.d/".$appname." start\n";
    exit();
  }
 }

if ($argc==2 && strcmp($argv[1], "help")==0) {
  echo "\nUsage:\n\n";
  echo $argv[0] . " install  \t- Installs start scripts for daemon\n";
  echo $argv[0] . "          \t- Starts sync daemon\n";
  echo "\n";
  exit();
 }

System_Daemon::start();                           // Spawn Deamon!
/* Application start */

$sl = new SyncLib();

# Loop forever and resync

$res==0;
while ($res==0) {
  $sl->reSync($baseParams['__YKVAL_SYNC_OLD_LIMIT__'], 
	      $baseParams['__YKVAL_SYNC_RESYNC_TIMEOUT__']);
  $res=sleep($baseParams['__YKVAL_SYNC_INTERVAL__']);
 }

error_log("Stopping " . $appname);
System_Daemon::stop();

?>
{'fraction_non_alphanumeric': 0.185360524399126, 'fraction_numerical': 0.006190823015294974, 'mean_word_length': 3.9674502712477397, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '4391485', 'n_tokens_mistral': 1009, 'n_tokens_neox': 1009, 'n_words': 189}