本文整理匯總了PHP中H::saveJSONData方法的典型用法代碼示例。如果您正苦於以下問題:PHP H::saveJSONData方法的具體用法?PHP H::saveJSONData怎麽用?PHP H::saveJSONData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類H
的用法示例。
在下文中一共展示了H::saveJSONData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: MasterAdd
public function MasterAdd($id, $name, $description, $password)
{
$random_salt = \Lobby::randStr(15);
$hashed = hash("sha512", $this->master_salt . $password . $random_salt);
if (!$this->MasterExists($id)) {
saveData("master_" . $id . "_name", $name);
saveData("master_" . $id . "_description", $description);
saveData("master_" . $id . "_password", $hashed);
saveData("master_" . $id . "_password_salt", $random_salt);
saveData("master_" . $id . "_items", '');
\H::saveJSONData("keyrings", array($id => 1));
return true;
} else {
return false;
}
}
示例2: array
<?php
$this->addScript("new-site.js");
$this->addStyle("site-settings.css");
$this->setTitle("{$name} - Settings");
echo $this->inc("/src/inc/partial/site.sidebar.php", array("su" => $su));
?>
<div class="contents">
<h2>Settings</h2>
<?php
if (isset($_POST['delete_site']) && \H::csrf()) {
\H::saveJSONData("sites", array($name => false));
$this->redirect("?status=site-deleted");
} else {
if (isset($_POST['submit'])) {
$output = $_POST['output'];
$tagline = $_POST['tagline'];
$theme = isset($_POST['theme']) ? $_POST['theme'] : "";
if ($output != "" && $theme != "") {
if (!file_exists($output) || !is_writable($output)) {
\Lobby::ser("Output Path problem", "The path you gave as output doesn't exist or permission is not acceptable. Make sure it's an existing directory with Read & Write permission", false);
} else {
if (array_search($theme, $this->themes) === false) {
\Lobby::ser("Invalid Theme", "The theme you selected doesn't exist", false);
} else {
// Everything's great
$this->addSite($name, $tagline, $output, $theme, isset($_POST['empty']) ? 1 : 0, isset($_POST['titleTag']) ? 1 : 0);
/* Generate the site */
$gSite = new \Lobby\App\sige\Site($this->getSite($name), $this);
$gSite->generate($this->getPages($name));
\Lobby::sss("Site updated", "The site was updated and generated successfully");
示例3: array
<?php
if (isset($_POST['network']) && isset($_POST['id']) && isset($this->available_networks[$_POST['network']])) {
H::saveJSONData("accounts", array($_POST['network'] => array($_POST['id'] => array(false))));
var_dump(H::getJSONData("accounts"));
}