Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (24 sloc) 0.586 kB
#!/usr/bin/env php
<?php
require_once(dirname(__FILE__) . '/common.php');
if($argc < 2 || $argc > 3) {
die("Usage: template <dir|file> [env]\n");
}
$config = get_config('configure');
if($argc == 3) {
$config['env'] = $argv[2];
}
if(is_dir($argv[1])) {
$files_dir = $argv[1];
$files = scandir($files_dir);
foreach($files as $file) {
$file = realpath($files_dir . '/' . $file);
if(!is_file($file)) {
continue;
}
template_file($file, $config);
}
}
elseif(is_file($argv[1])) {
template_file($file, $config);
}
Jump to Line
Something went wrong with that request. Please try again.