当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings类代码示例

本文整理汇总了PHP中Settings的典型用法代码示例。如果您正苦于以下问题:PHP Settings类的具体用法?PHP Settings怎么用?PHP Settings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Settings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。