本文整理匯總了PHP中Convert::setStrictMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Convert::setStrictMode方法的具體用法?PHP Convert::setStrictMode怎麽用?PHP Convert::setStrictMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Convert
的用法示例。
在下文中一共展示了Convert::setStrictMode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Convert
#!/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: destroyDir
// The template files need to be in the top level directory of the archive
if ($zip->locateName('index.html') === false && $zip->locateName('index.htm') === false) {
$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!';
}
}