示例#1
0
文件: convert.php 项目: ftkurtson/tdk
#!/usr/bin/env php
<?php 
include 'config.php';
include 'metadata.php';
include 'class.convert.php';
$process = new Convert();
$process->setStrictMode(true);
$process->setHtmlDir($htmlDir);
$process->setTemplatesDir($templateDir);
$process->setMetaData($metaData);
$process->process(false);
// no zip download
示例#2
0
文件: index.php 项目: ftkurtson/tdk
            $error = "No index.htm or index.html file found in the top level directory within the archive.";
            $goodToGo = false;
        }
        // If we have passed all checks... rock and roll!
        if ($goodToGo === true) {
            // It removes the directory if it exists
            if (is_dir($uploadDir . '/' . $folderName)) {
                destroyDir($uploadDir . '/' . $folderName);
            }
            mkdir($uploadDir . '/' . $folderName);
            $zip->extractTo($uploadDir . '/' . $folderName);
            // New convert process
            $process = new Convert();
            $process->setStrictMode($strictMode);
            $process->setHtmlDir($uploadDir . '/' . $folderName);
            $process->setTemplatesDir($installTemplateDir);
            $process->setWorkingDirectory($uploadDir);
            $process->setMetaData($metaData);
            $process->process($conversionResult === 'zip' ? true : false);
            $zip->close();
            // Remove the uploaded zip
            unlink($targetPath);
            // As the file is being downloaded, exit;
            if ($conversionResult === 'zip' ? true : false) {
                exit;
            } else {
                $message = 'Template installed!';
            }
        }
    }
}