File: transform_all_lastcraft.php

package info (click to toggle)
postfixadmin 2.3.5-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,200 kB
  • sloc: php: 25,767; xml: 14,485; perl: 964; sh: 664; python: 169; makefile: 84
file content (17 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
    $transform = $argv[1];
    $source_path = $argv[2];
    $destination_path = $argv[3];
    $dir = opendir($source_path);
    while (($file = readdir($dir)) !== false) {
        if (! preg_match('/\.xml$/', $file)) {
            continue;
        }
        $source = $source_path . $file;
        $destination = $destination_path .
                preg_replace('/\.xml$/', '.php', basename($source));
        $command = "Xalan -o $destination $source $transform\n";
        `$command`;
    }
    closedir($dir);
?>