本文整理汇总了PHP中Setup::escapeOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP Setup::escapeOutput方法的具体用法?PHP Setup::escapeOutput怎么用?PHP Setup::escapeOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setup
的用法示例。
在下文中一共展示了Setup::escapeOutput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Setup $setup)
{
$this->setup = $setup;
$this->storageMode = 'flat-file';
$metadata_file = $this->setup->dir . '/.metadata';
$update_metadata = false;
// Read exist metadata file if one exists
if (file_exists($metadata_file)) {
$json_metadata = json_decode(file_get_contents($metadata_file), true);
$this->setup->metadata = array_merge($this->setup->metadata, $json_metadata);
}
// Check if comment thread directory exists
if ($setup->mode !== 'api') {
if (file_exists(dirname($metadata_file)) and is_writable(dirname($metadata_file))) {
// Check whether the page and metadata URLs differ
if ($this->setup->metadata['title'] !== $setup->pageTitle) {
$this->setup->metadata['title'] = $setup->pageTitle;
$update_metadata = true;
}
// Check whether the page and metadata titles differ
if ($this->setup->metadata['url'] !== $setup->pageURL) {
$this->setup->metadata['url'] = $setup->pageURL;
$update_metadata = true;
}
// Update metadata if the data has changed
if ($update_metadata === true) {
if ($this->save_metadata($this->setup->metadata, $metadata_file) === false) {
exit($setup->escapeOutput('<b>HashOver</b>: Failed to create metadata file.', 'single'));
}
}
}
}
}
示例2: __construct
public function __construct(Setup $setup)
{
$this->setup = $setup;
$this->storageMode = $setup->databaseType;
try {
if ($setup->databaseType === 'sqlite') {
$this->database = new PDO('sqlite:' . $setup->rootDirectory . '/pages/' . $setup->databaseName . '.sqlite');
} else {
$sql_connection = 'host=' . $setup->databaseHost . ';' . 'dbname=' . $setup->databaseName . ';' . 'charset=' . $setup->databaseCharset;
$this->database = new PDO($setup->databaseType . ':' . $sql_connection, $setup->databaseUser, $setup->databasePassword);
}
} catch (PDOException $error) {
exit($setup->escapeOutput($error->getMessage(), 'single'));
}
// Create comment tread table
$create = 'CREATE TABLE IF NOT EXISTS \'' . $setup->threadDirectory . '\' ' . '(id TEXT PRIMARY KEY,' . ' name TEXT,' . ' password TEXT,' . ' login_id TEXT,' . ' email TEXT,' . ' encryption TEXT,' . ' website TEXT,' . ' date TEXT,' . ' likes TEXT,' . ' dislikes TEXT,' . ' notifications TEXT,' . ' ipaddr TEXT,' . ' status TEXT,' . ' body TEXT)';
$this->database->exec($create);
}