コード例 #1
0
ファイル: Transform.php プロジェクト: dramacode/tools
<?php

/**
Classe addhoc qui prend un fichier de Paul Fièvre pour en faire diverses choses
qui sera édité manuellement.
*/
set_time_limit(-1);
// included file, do nothing
if (isset($_SERVER['SCRIPT_FILENAME']) && basename($_SERVER['SCRIPT_FILENAME']) != basename(__FILE__)) {
} else {
    if (isset($_SERVER['ORIG_SCRIPT_FILENAME']) && realpath($_SERVER['ORIG_SCRIPT_FILENAME']) != realpath(__FILE__)) {
    } else {
        if (php_sapi_name() == "cli") {
            Transform::cli();
        }
    }
}
/**
 * Class adhoc pour générer un docx à partir d’un XML/TEI
 */
class Transform
{
    static function cli()
    {
        array_shift($_SERVER['argv']);
        // shift first arg, the script filepath
        $xslfile = 'identifier.xsl';
        if (!count($_SERVER['argv'])) {
            exit("\nTransformer une liste de fichier avec {$xslfile}\n\n");
        }
        $xslfile = dirname(__FILE__) . '/' . $xslfile;