PHP Classes

File: sync.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Tradukoj PHP Po File Generator   sync.php   Download  
File: sync.php
Role: Application script
Content type: text/plain
Description: Application script
Class: Tradukoj PHP Po File Generator
Convert locale CSV file to PO and send to Tradukoj
Author: By
Last change: Update of sync.php
Date: 8 months ago
Size: 951 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

$currentDir
= dirname(__FILE__);

require_once(
$currentDir . '/vendor/autoload.php');
require_once(
$currentDir . '/Classes/PoClass.php');
require_once(
$currentDir . '/Classes/ClientSocketService.php');
require_once(
$currentDir . '/Classes/Tools.php');

$config = Tools::readConfig($currentDir);

$args = new \JLaso\ConsoleArgs\ConsoleArgs($argv, array('help'), array('upload', 'dir'));

if(!(
$baseDir = $args->getDir) || $args->hasHelp){
    print <<<EOD
Please, use this arguments to invoke this command:

    --help \tto see this help
    --upload=yes \tto force the inclusion of local translations files to the remote catalog
    --dir=dirname\tthe folder where are the root of LOCALE files

EOD;
    exit();
}

$baseDir = preg_replace("/^\.\//", $currentDir . '/', $baseDir);
print
"\nstarting command on {$baseDir}\n\n";

Tools::syncTranslations($baseDir, $config, "yes" == $args->getUpload);

print
"\n\nDone!\n";