Example #1
0
#!/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
Example #2
0
        // 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!';
            }
        }
    }
}
?>
<!DOCTYPE html>
<html class="no-js">