本文整理汇总了PHP中Settings类的典型用法代码示例。如果您正苦于以下问题:PHP Settings类的具体用法?PHP Settings怎么用?PHP Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Settings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
function get()
{
$settings = new Settings();
$atlantis = array('lat' => doubleval($settings->getSettings('Atlantis', 'lat')), 'long' => doubleval($settings->getSettings('Atlantis', 'long')));
$bdd = getBDD();
$req = $bdd->query('SELECT arr.*, IFNULL(arr2.nom, at_users.nom) nom FROM (SELECT t1.* FROM at_geo t1 LEFT JOIN at_geo t2 ON (t1.mac = t2.mac AND t1.timestamp < t2.timestamp) WHERE t2.timestamp IS NULL AND t1.date = CURDATE()) AS arr LEFT JOIN (SELECT at_devices.mac, at_users.nom FROM at_devices INNER JOIN at_users ON at_devices.username = at_users.id) AS arr2 ON arr.mac = arr2.mac LEFT JOIN at_users ON arr.mac = at_users.cle');
$result = $req->fetchAll(PDO::FETCH_ASSOC);
$req->closeCursor();
http_response_code(202);
$output = array('atlantis' => $atlantis, 'positions' => $result);
return $output;
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:12,代码来源:at_geo.php
示例2: getConfigurationEntries
public function getConfigurationEntries($tprefix)
{
require_once 'Settings.php';
$obj_sett = new Settings();
$arr_config = $obj_sett->getSettings($tprefix);
return $arr_config;
}
开发者ID:E-SOFTinc,项目名称:UFlp-Back-Office,代码行数:7,代码来源:Calculation11WithOutProduct.php
示例3: writeToDB
/**
* writeToDb writes the OBJECT to the database
* @param Array $data
*/
function writeToDB($data)
{
// echo print_r(array_keys($data), true);
require_once dirname(realpath(__FILE__)) . '/../includes/classes/settings.class.php';
$settings = new Settings();
$settings->writeObject($data);
}
开发者ID:ColBT,项目名称:php_tut,代码行数:11,代码来源:import_settings_to_db.php
示例4: __construct
function __construct()
{
$settings = new Settings();
$this->oc = $settings->getSettings('ownCloud', 'path');
$this->admin_username = $settings->getSettings('ownCloud', 'username');
$this->admin_password = $settings->getSettings('ownCloud', 'password');
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:7,代码来源:Owncloud.php
示例5: get
function get()
{
$pid = (new Settings())->getSettings('Daemon', 'pid');
if ($pid == -1) {
$daemon = false;
} else {
exec("ps -p {$pid}", $result);
if (count($result) > 1) {
$result = $result[1];
$result = preg_replace("/\\s+/", " ", $result);
$data = explode(" ", $result);
if ($data[count($data) - 1] == 'php') {
$daemon = true;
} else {
$daemon = false;
}
} else {
$daemon = false;
}
}
$free_disk = disk_free_space('/') / disk_total_space('/');
$settings = new Settings();
$output = array('daemon' => $daemon, 'free_hdd' => $free_disk, 'nightFrom' => $settings->getSettings('Mode', 'nightFrom'), 'nightTo' => $settings->getSettings('Mode', 'nightTo'), 'nightAuto' => $settings->getSettings('Mode', 'nightAuto'));
return $output;
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:25,代码来源:at_system.php
示例6: triggerWebtreesAdminTasks
public function triggerWebtreesAdminTasks()
{
$settings = new Settings();
$this->logger = \Piwik\Container\StaticContainer::get('Psr\\Log\\LoggerInterface');
$this->logger->info('Webtrees Admin Task triggered');
$rooturl = $settings->getSetting('webtreesRootUrl');
if (!$rooturl || strlen($rooturl->getValue()) === 0) {
return;
}
$token = $settings->getSetting('webtreesToken');
if (!$token || strlen($token->getValue()) === 0) {
return;
}
$taskname = $settings->getSetting('webtreesTaskName');
if (!$taskname || strlen($taskname->getValue()) === 0) {
return;
}
$url = sprintf('%1$s/module.php?mod=perso_admintasks&mod_action=trigger&force=%2$s&task=%3$s', $rooturl->getValue(), $token->getValue(), $taskname->getValue());
$this->logger->info('webtrees url : {url}', array('url' => $url));
try {
\Piwik\Http::sendHttpRequest($url, Webtrees::SOCKET_TIMEOUT);
} catch (Exception $e) {
$this->logger->warning('an error occured', array('exception' => $e));
}
}
开发者ID:jon48,项目名称:webtrees-tools,代码行数:25,代码来源:Tasks.php
示例7: action_index
public function action_index()
{
$settings = new Settings();
$settings->add_setting(new Setting_Preferences($this->user));
$settings->add_setting(new Setting_Profile($this->user));
$settings->add_setting(new Setting_Account($this->user));
// Run the events.
Event::fire('user.settings', array($this->user, $settings));
if ($this->request->method() == HTTP_Request::POST) {
$setting = $settings->get_by_id($this->request->post('settings-tab'));
if ($setting) {
$post = $this->request->post();
$validation = $setting->get_validation($post);
if ($validation->check()) {
try {
$setting->save($post);
Hint::success('Updated ' . $setting->title . '!');
} catch (ORM_Validation_Exception $e) {
Hint::error($e->errors('models'));
}
} else {
Hint::error($validation->errors());
}
} else {
Hint::error('Invalid settings id!');
}
}
$this->view = new View_User_Settings();
$this->view->settings = $settings;
}
开发者ID:modulargaming,项目名称:user,代码行数:30,代码来源:Settings.php
示例8: testDefaultSettings
public function testDefaultSettings()
{
$settings = new Settings();
$this->assertEquals(Settings::DEFAULT_LENGTH, $settings->getLength());
$this->assertEquals(Settings::DEFAULT_WIDTH, $settings->getWidth());
$this->assertEquals(Settings::DEFAULT_BOMB_COUNT, $settings->getBombCount());
}
开发者ID:SamyGhannad,项目名称:CtCI-6th-Edition,代码行数:7,代码来源:SettingsTest.php
示例9: testResolvePartialPath
public function testResolvePartialPath()
{
$resolver = $this->prophesize('asylgrp\\workbench\\PathResolver');
$resolver->resolve('foo')->willReturn('resolved');
$settings = new Settings(['baz' => '[path:foo]/bar'], $resolver->reveal());
$this->assertSame('resolved/bar', $settings->read('baz'));
}
开发者ID:asylgrp,项目名称:workbench,代码行数:7,代码来源:SettingsTest.php
示例10: save
/**
* Save settings
*
* @param Newscoop\News\Item $item
* @return void
*/
public function save(array $values, Settings $settings)
{
$settings->setArticleTypeName($values['article_type']);
$settings->setPublicationId($values['publication']);
$settings->setSectionNumber($values['section']);
$this->odm->persist($settings);
$this->odm->flush();
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:14,代码来源:SettingsService.php
示例11: __construct
function __construct($json, $supported_protocols)
{
$s = new Settings();
if ($json !== "") {
$s->fromJson($json);
}
$this->settings = $s;
}
开发者ID:rongzedong,项目名称:kademlia.php,代码行数:8,代码来源:instance.php
示例12: writeablePathsCreated
public function writeablePathsCreated()
{
$Settings = new Settings();
$Settings->loadSettings();
if (trim($Settings->settings['TemplatesWriteablePath'] . chr(32)) != "" && trim($Settings->settings['SrcWriteablePath'] . chr(32)) != "" && trim($Settings->settings['ClassesWriteablePath'] . chr(32)) != "") {
return true;
}
return false;
}
开发者ID:asimo124,项目名称:PHPClasses,代码行数:9,代码来源:CrudGenUtility.class.php
示例13: message
function message($arr)
{
light_notification(false);
$settings = new Settings();
if ($settings->getSettings('CallNotifier', 'voice')) {
(new Player())->sound(Player::NOTIFICATION);
(new Player())->sound(Player::INCOMING_MESSAGE);
}
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:9,代码来源:at_call_notifier.php
示例14: isAuth
protected function isAuth()
{
$Settings = new Settings();
$settings = $Settings->get('admin');
if (@$_COOKIE['pass'] == $settings['s_val']) {
return true;
} else {
return false;
}
}
开发者ID:vitsun,项目名称:igrushki-detkam,代码行数:10,代码来源:IndexController.php
示例15: del
function del()
{
$model = new Settings();
$model->del();
if ($_GET['parent'] != 0) {
$this->redirect('/settings/' . $_GET['parent'] . '/');
} else {
$this->redirect('/settings/');
}
}
开发者ID:sov-20-07,项目名称:billing,代码行数:10,代码来源:SettingsController.php
示例16: __construct
function __construct($city = 'rennes')
{
$settings = new Settings();
$this->city = $city;
$this->appid = $settings->getSettings('Weather', 'appid');
$result = $this->fetchURL($city, 7);
if ($result->cod != null && $result->cod == '200') {
$this->data = $result;
}
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:10,代码来源:Weather.php
示例17: output
public function output(Settings $settings)
{
$class = $this->getClass($settings->getDivClass());
$style = $this->getStyles();
$attrs = $this->getAttrsAsString();
return <<<RETURN
<div class="{$class}"{$attrs}>
<div id="{$this->divId}">
<script type="text/javascript" defer>
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
googletag.cmd.push(function() {
\$(function() {
var slideTimer = setTimeout(function() {
clearTimeout(slideTimer);
\$('div.{$class}').each(function() {
var ad = \$(this);
var container = \$('[data-role="pageskin"]');
var closed = false;
var scrolled = false;
var showAd = function(force) {
if(! closed || force) {
ad.fadeIn('fast'); scrolled = true; closed = false;
container.css('margin-top', '90px');
container.css('z-index', '2');
container.css('position', 'relative');
ad.css('top', container.offset().top - 90);
}
};
var hideAd = function() {
ad.fadeOut('fast');
container.css('margin-top', '0');
closed = true;
}
if(ad.find('div').css('display') != 'none') {
showAd();
\$(window).scroll(function () {
if (!scrolled && !closed && \$(this).scrollTop() > 40) {
showAd();
}
});
ad.find('.pageskin_ad_close').click(function(e) {
e.preventDefault();
hideAd();
});
}
});
}, 2000);
});
});
</script>
</div>
</div>
RETURN;
}
开发者ID:EnuygunCom,项目名称:dfp-bundle,代码行数:55,代码来源:PageSkinAdUnit.php
示例18: load
public function load($templateName, $generalSettingsInstance = false)
{
//set default template as messy
if (!$templateName) {
foreach ($this->getAllTemplates() as $tpl) {
list($template_all) = explode('-', $tpl);
if ($template_all == 'messy') {
$templateName = $tpl;
break;
} else {
$templateName = 'default';
}
}
//save in settings
$settings = new Settings(false);
$settings->update('template', 'template', array('value' => $templateName));
$settings->save();
}
$this->name = $templateName;
$tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
if (!file_exists($tPath)) {
$template = explode('-', $this->name);
$template = $template[0];
//try to get same template with different version if not exists
foreach ($this->getAllTemplates() as $tpl) {
list($template_all) = explode('-', $tpl);
if ($template_all == $template) {
$this->name = $tpl;
break;
//default template = messy
} else {
$this->name = 'default';
}
}
$tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
}
if (file_exists($tPath) && file_exists($tPath . '/template.conf.php')) {
$this->smarty->template_dir = $tPath;
$this->smarty->plugins_dir = array('plugins', self::$options['TEMPLATES_FULL_SERVER_PATH'] . '_plugins', $tPath . '/plugins');
list($this->sectionTypes, $this->settingsDefinition) = (include $tPath . '/template.conf.php');
$this->templateHTML = @file_get_contents($tPath . '/template.tpl');
$this->templateFile = $tPath . '/template.tpl';
$this->settings = new Settings($this->settingsDefinition, $generalSettingsInstance, $this->name);
// instantiate settings for each section type definition (extend $this->settings)
reset($this->sectionTypes);
while (list($tName, $t) = each($this->sectionTypes)) {
$this->sectionTypes[$tName]['settings'] = new Settings(false, $this->settings, false, isset($t['settings']) ? $t['settings'] : false);
}
return true;
}
return false;
}
开发者ID:DhariniJeeva,项目名称:berta,代码行数:52,代码来源:class.bertatemplate.php
示例19: test_verifyUser_called_userAndPassword_returnToken
/**
* method: verifyUser
* when: called
* with: userAndPassword
* should: returnToken
*/
public function test_verifyUser_called_userAndPassword_returnToken()
{
$settings = new Settings();
$postfields = array();
$postfields['auth'] = array();
$postfields['auth']['passwordCredentials'] = array();
$postfields['auth']['passwordCredentials']['username'] = 'eyeos';
$postfields['auth']['passwordCredentials']['password'] = 'eyeos';
$postfields['auth']['tenantName'] = 'eyeos';
$settings->setPostFields(json_encode($postfields));
$this->oauthProviderMock->expects($this->once())->method('verifyUser')->with($settings)->will($this->returnValue('AB'));
$this->sut->verifyUser($settings);
}
开发者ID:sebasalons,项目名称:eyeos-u1db,代码行数:19,代码来源:OAuthManagerOldTest.php
示例20: output
/**
* Output the DFP code for this ad unit
*
* @param Nodrew\Bundle\DfpBundle\Model\Settings $settings
* @return string
*/
public function output(Settings $settings)
{
$class = $settings->getDivClass();
$style = $this->getStyles();
return <<<RETURN
<div id="{$this->divId}" class="{$class}" style="{$style}">
<script type="text/javascript">
googletag.cmd.push(function() { googletag.display('{$this->divId}'); });
</script>
</div>
RETURN;
}
开发者ID:elmariachi111,项目名称:NodrewDfpBundle,代码行数:19,代码来源:AdUnit.php
注:本文中的Settings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论