本文整理汇总了PHP中Options::addOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::addOptions方法的具体用法?PHP Options::addOptions怎么用?PHP Options::addOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::addOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: downloadAction
public function downloadAction()
{
$settings = Globals::get("settings");
$path = Globals::get("path");
$plugin = isset($_POST['plugin']) ? $_POST['plugin'] : null;
//if($plugin == null){return;}
$version = isset($_POST['version']) ? $_POST['version'] : '*';
$source = $_POST['source'];
//foreach ($source as $key => $value) {
//$pathPlugin = $value.'plugins/'.$plugin.'/'.$plugin.'.tar.gz';
$pathPlugin = $source . '/plugins/' . $plugin . '/' . $plugin . '.tar.gz';
$resultData = @file_get_contents($pathPlugin);
//if($resultData !== false){
// break;
//}
//}
if ($resultData !== false) {
$pluginspath = Globals::get('path/app/plugins/path');
$pluginsFilename = $plugin . '.tar.gz';
$pluginsFilenamePath = $pluginspath . '' . $pluginsFilename;
file_put_contents($pluginsFilenamePath, $resultData);
$phar = new PharData($pluginsFilenamePath);
$phar->extractTo($pluginspath, null, true);
exec('find ' . $pluginspath . ' -type d -exec chmod 0777 {} +');
exec('find ' . $pluginsFilenamePath . ' -type f -exec chmod 0777 {} +');
unlink($pluginsFilenamePath);
// salva as operações no options
Options::addOptions("_control", array('dependence' => array($plugin => $version)));
Options::saveOptions("_control");
// captura a lista de plugins
$pluginsList = Globals::get("plugins/list");
//Plugins::getList($path,$settings);
$status = 'success';
$data = $pluginsList;
} else {
$status = 'error';
$data = null;
}
echo json_encode(array('status' => $status, 'data' => null));
return array('continue' => false);
}
示例2: sanitize
include "../../../classes/Database.php";
include "../../../classes/Connection.php";
include_once "../../../includes/bootstrap.php";
include "../../../classes/OptionsCategory.php";
include "../../../classes/Options.php";
include "../../../classes/AdminAction.php";
include "../../../includes/security.funcs.inc";
include_once "../../../includes/Pagination.php";
include_once 'thumbnail/thumbnail_images.class.php';
include_once 'functions/myFunctions.php';
if (isset($_POST['submit'])) {
$_POST = sanitize($_POST);
$category = $_POST;
settype($category, 'object');
Options::addOptions($category);
$success = "Options Successfully Saved!";
$updates = 'Add new options content';
AdminAction::addAdminAction($_SESSION['admin_name'], $updates);
}
$category = OptionsCategory::findOptionsCategory($_REQUEST['category_id']);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php
echo $ROOT_URL;
?>
_admin/_assets/css/core3.css" />