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


PHP Settings::Load方法代码示例

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


在下文中一共展示了Settings::Load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Initialize

 /**
  * Initialize all variables used by Peg. Has to be called before any usage
  * of peg.
  */
 public static function Initialize()
 {
     // Initialize the plugin loader and try to load any plugins.
     self::$plugin_loader = new Plugins\Loader();
     if (self::ValidExtension()) {
         self::$plugin_loader->Start(self::GetCwd() . "/plugins");
         if (file_exists(self::GetCwd() . "/peg.conf")) {
             Settings::SetBackEnd(new Config\INI());
             Settings::Load(self::GetCwd(), "peg.conf");
         } else {
             Settings::SetBackEnd(new Config\JSON());
             Settings::Load(self::GetCwd(), "peg.json");
         }
     }
 }
开发者ID:peg-org,项目名称:peg-src,代码行数:19,代码来源:Application.php

示例2: die

*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/
require_once '../../common.php';
require_once 'class.settings.php';
if (!isset($_GET['action'])) {
    die(formatJSEND("error", "Missing parameter"));
}
//////////////////////////////////////////////////////////////////
// Verify Session or Key
//////////////////////////////////////////////////////////////////
checkSession();
$Settings = new Settings();
//////////////////////////////////////////////////////////////////
// Save User Settings
//////////////////////////////////////////////////////////////////
if ($_GET['action'] == 'save') {
    if (!isset($_POST['settings'])) {
        die(formatJSEND("error", "Missing settings"));
    }
    $Settings->username = $_SESSION['user'];
    $Settings->settings = json_decode($_POST['settings'], true);
    $Settings->Save();
}
//////////////////////////////////////////////////////////////////
// Load User Settings
//////////////////////////////////////////////////////////////////
if ($_GET['action'] == 'load') {
    $Settings->username = $_SESSION['user'];
    $Settings->Load();
}
开发者ID:iFromzForks,项目名称:appengine-codiad,代码行数:31,代码来源:controller.php

示例3: __construct


//.........这里部分代码省略.........
         }
         $emailSender = new EmailSender();
         $emailSender->SendFromTemplate($_POST['template'], $_POST['to'], $this->outserver, $boundary);
         $this->output = $emailSender->getOutput();
         if ($this->saveInTxtLog) {
             $this->saveToTxtLog($this->output);
         }
         return;
     }
     if ($this->query == "upload_universal") {
         $this->output = TransferIface::uploadFile(isset($_FILES['elist']) ? $_FILES['elist'] : null);
         return;
     }
     if ($this->query == "savedata") {
         $this->output = TransferIface::downloadFile(isset($_POST['savedata']) ? $_POST['savedata'] : null, $_POST['filename']);
         return;
     }
     if ($this->query == "changepass") {
         if (SERVICEMODE) {
             return;
         }
         $this->output = $this->changePass($_POST['login'], $_POST['pass'], $logpass);
         return;
     }
     if ($this->query == "pingoutserver") {
         if (SERVICEMODE) {
             return;
         }
         $this->output = Shell::check($_POST['server']);
         return;
     }
     if ($this->query == "linesinfile") {
         if (SERVICEMODE) {
             return;
         }
         $this->output = AMUtil::linesInFile($_POST['file_path']);
         return;
     }
     if ($this->query == "saveSettings") {
         if (SERVICEMODE) {
             return;
         }
         $result = Settings::Save($_POST['settings']);
         if ($result) {
             $this->output = $translation->getWord("settings-saved");
         } else {
             $this->output = $translation->getWord("settings-save-error");
         }
         return;
     }
     if ($this->query == "removeSettings") {
         if (SERVICEMODE) {
             return;
         }
         Settings::Remove();
         $this->output = $translation->getWord("settings-removed");
         return;
     }
     if ($this->query == "loadSettings") {
         $data = Settings::Load();
         if (!$data) {
             $this->output = "";
         } else {
             $this->output = $data;
         }
         return;
     }
     if ($this->query == "sendInBackground") {
         if (SERVICEMODE) {
             return;
         }
         $emailSender = new EmailSender();
         $outservers = isset($_POST['outservers']) ? explode("\n", $_POST['outservers']) : array();
         $additional = array();
         foreach ($_POST['additional'] as $n => $values) {
             $additional[$n] = explode("\n", $values);
         }
         $emailSender->sendInBackground($_POST['type'], $_POST['files'], $boundary, $outservers, $_POST['timeout'], array('to' => explode("\n", $_POST['to']), 'fromname' => explode("\n", $_POST['fromname']), 'frommail' => explode("\n", $_POST['frommail']), 'replymail' => explode("\n", $_POST['replymail']), 'subject' => explode("\n", $_POST['subject']), 'additional' => $additional, 'text' => $_POST['text'], 'sendInBase64' => $_POST['sendInBase64'], 'randomTimeout' => $_POST['randomTimeout'], 'enumer' => null));
         //NO RETURN ^_^
     }
     if ($this->query == "getBackgroundState") {
         if (SERVICEMODE) {
             return;
         }
         $this->output = json_encode(EmailSender::loadState());
         return;
     }
     if ($this->query == "setBackgroundState") {
         if (SERVICEMODE) {
             return;
         }
         $this->output = EmailSender::setState($_POST['isRunning'] == "true");
         return;
     }
     if ($this->query == "selfDiagnostics") {
         //if(SERVICEMODE) return;
         $this->output = $this->selfDiagnostics();
         return;
     }
 }
开发者ID:AlexusBlack,项目名称:alexusMailer-2,代码行数:101,代码来源:AlexusMailer.php

示例4: __construct

 /**
  * dbConnection::__construct()
  * Reads settings from the default settings file and creates the connection.
  * @param String $useAlternative Alternative settings file
  */
 function __construct($instanceName = 'Database')
 {
     $this->adapter = $this->getAdapter(Settings::Load()->Get($instanceName));
     $this->debug = Settings::Load()->Get($instanceName, 'debug') === '1';
 }
开发者ID:codegooglecom,项目名称:pork-dbobject,代码行数:10,代码来源:class.dbconnection.php

示例5: dbCheck

 /**
  * Logger::dbCheck()
  * Checks if the current database exists, and creates it if it's not there.
  */
 public function dbCheck()
 {
     if (!$this->checked) {
         $this->log[] = "checking if db exists";
         $this->checked = dbConnection::getInstance('Logger')->tableExists(Settings::Load()->Get('Logger', 'logtable'));
         if (!$this->checked) {
             $createquery = $this->createqueries[strtolower(Settings::Load()->Get('Logger', 'dbtype'))];
             $createquery = str_replace('@logtable@', Settings::Load()->Get('Logger', 'logtable'), $createquery);
             $this->checked = dbConnection::getInstance('Logger')->query($createquery);
             if (!$this->checked) {
                 die("Error creating logdatabase");
             }
             Logger::Log("Log database created.");
         }
     }
 }
开发者ID:codegooglecom,项目名称:pork-dbobject,代码行数:20,代码来源:class.logger.php


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