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


PHP Configuration::write方法代码示例

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


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

示例1: upgradeInfos

 public function upgradeInfos()
 {
     $configuration = new Configuration('wakka.config.php');
     $configuration->load();
     $configuration['yeswiki_release'] = $this->release;
     return $configuration->write();
 }
开发者ID:YesWiki,项目名称:yeswiki-extension-autoupdate,代码行数:7,代码来源:PackageCore.php

示例2: init

 /**
  * API initialization
  * 
  * Launch all needed services to response to API request, first by checking
  * token and doing authentication if asked
  * 
  * @version 1.0
  * @return  void
  */
 public static function init()
 {
     // we store HTTP header & body content
     self::$headers = getallheaders();
     self::$body = json_decode(file_get_contents('php://input'));
     // we check if request method is OPTIONS to send just headers without content
     if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
         self::parsing();
         self::result();
     }
     // we search asked module & methods
     if (isset($_SERVER['PATH_INFO'])) {
         $path = substr($_SERVER['PATH_INFO'], 1);
         self::$module = explode('/', $path);
     } else {
         self::$module = array();
     }
     // we check if a token exist and we store it
     if (isset(self::$headers['Authorization']) && substr(self::$headers['Authorization'], 0, 4) == Configuration::read('token')) {
         $token = explode(' ', self::$headers['Authorization']);
         self::$token = $token[1];
     }
     // we check if an authenticate is asked or if client have a valid token
     if (isset(self::$module[0]) && self::$module[0] == 'authenticate') {
         self::auth();
     } else {
         self::token_auth();
     }
     // we try connection to bdd client
     $dsn['client'] = 'mysql:host=' . Configuration::read('db.host') . ';port=' . Configuration::read('db.port') . ';dbname=leqg_' . self::$client . ';charset=utf8';
     // We try to connect the script to the LeQG Core MySQL DB
     try {
         $dbh['client'] = new PDO($dsn['client'], Configuration::read('db.user'), Configuration::read('db.pass'));
         // We save in configuration class the SQL link
         Configuration::write('db.client', $dbh['client']);
     } catch (PDOException $e) {
         // We store SQL connection error into the API result
         API::error(503, 'SQLConnectionFail', 'Can not connect to the client database server.');
         // We stop script execution
         exit;
     }
     // we launch client asked module
     if (!empty(self::$module[0]) && class_exists(self::$module[0])) {
         $module = self::$module[0];
         ${$module} = new $module();
     } elseif (!empty(self::$module[0]) && self::$module[0] != 'authenticate') {
         API::error(404, 'UnknownModule', 'Vous demandez un module qui n\'existe pas');
     } elseif (empty(self::$module[0])) {
         API::error(404, 'UnknownModule', 'Vous demandez un module qui n\'existe pas');
     }
 }
开发者ID:leqg,项目名称:leqg-api,代码行数:60,代码来源:api.class.php

示例3: chdir

<?php

chdir('..');
require 'libraries/start.php';
// setup
$message = '';
$config = array();
// save input
if (array_key_exists('config', $_POST) && $_POST['config']) {
    $config = Http::clean($_POST['config'], 'html');
    $errors = find_configuration_errors($config);
    // display errors, if any
    if ($errors) {
        foreach ($errors as $error) {
            $message .= "<p class='error'>{$error}</p>";
        }
    } else {
        Configuration::write($config);
        Configuration::reset();
    }
}
// get config
$config = Configuration::getInstance();
// templating
$t = new Template(Configuration::get('base_dir') . DS . 'templates' . DS . 'base.html');
$t->replace('base_url', Configuration::get('base_url'));
$t->replaceFromPHPFile('content', Configuration::get('base_dir') . DS . 'templates' . DS . 'configuration.html', array('c' => $config));
$t->replace('message', $message);
$t->display();
开发者ID:amad4biz,项目名称:invoices,代码行数:29,代码来源:configure.php

示例4: PDO

Configuration::write('ini', $config);
// On fabrique la classe $noyau de connexion au noyau central
$host = '217.70.189.234';
$port = 3306;
$dbname = 'leqg-core';
$user = 'leqg-remote';
$pass = 'pbNND3JY2cfrDUuZ';
$charset = 'utf8';
$dsn = "mysql:host={$host};port={$port};dbname={$dbname};charset={$charset}";
$core = new PDO($dsn, $user, $pass);
// On fabrique la classe $link de liaison PDO
$dsn = 'mysql:host=' . Configuration::read('db.host') . ';dbname=' . Configuration::read('db.basename') . ';charset=utf8';
$link = new PDO($dsn, Configuration::read('db.user'), Configuration::read('db.pass'));
// On enregistre les liaisons SQL
Configuration::write('db.core', $core);
Configuration::write('db.link', $link);
// On charge les API extérieures
require_once '../api/esendex/autoload.php';
require_once '../api/phpmailer/class.phpmailer.php';
// On configure les données des API extérieures
$api['sms']['auth'] = new \Esendex\Authentication\LoginAuthentication($config['SMS']['compte'], $config['SMS']['login'], $config['SMS']['pass']);
$api['mail']['charset'] = 'UTF-8';
$api['mail']['smtp']['host'] = $config['MAIL']['host'];
$api['mail']['smtp']['user'] = $config['MAIL']['user'];
$api['mail']['smtp']['pass'] = $config['MAIL']['pass'];
$api['mail']['smtp']['port'] = $config['MAIL']['port'];
$api['mail']['from']['email'] = 'no-reply@leqg.info';
$api['mail']['from']['nom'] = 'Ne Pas Répondre';
$api['mail']['reply']['email'] = 'serveur@leqg.info';
$api['mail']['reply']['nom'] = 'LeQG';
// On inclut les classes non chargées
开发者ID:leqg,项目名称:leqg,代码行数:31,代码来源:includes.php

示例5: pathsConfig

 private function pathsConfig($sxml)
 {
     foreach ($sxml->{$this->selfname}->paths->path as $path) {
         Configuration::write((string) $path['name'], (string) $path);
     }
 }
开发者ID:rhokburlington,项目名称:species-invaders,代码行数:6,代码来源:coreconfig.module.php

示例6: parse_ini_file

        return false;
    }
}
// We load configuration file
$configuration = parse_ini_file('config.ini', true);
// We store token name into Configuration datas
Configuration::write('token', $configuration['token']['name']);
Configuration::write('url', $configuration['url']['base']);
Configuration::write('db.host', $configuration['core']['host']);
Configuration::write('db.port', $configuration['core']['port']);
Configuration::write('db.user', $configuration['core']['user']);
Configuration::write('db.pass', $configuration['core']['pass']);
// We prepare the data source name information for LeQG Core MySQL DB
$dsn['core'] = 'mysql:host=' . $configuration['core']['host'] . ';port=' . $configuration['core']['port'] . ';dbname=leqg_core;charset=utf8';
// We try to connect the script to the LeQG Core MySQL DB
try {
    $dbh['core'] = new PDO($dsn['core'], $configuration['core']['user'], $configuration['core']['pass']);
    // We save in configuration class the SQL link
    Configuration::write('db.core', $dbh['core']);
} catch (PDOException $e) {
    // We store SQL connection error into the API result
    API::error(503, 'CentralAuthSystemCanConnect', 'Can not connect to the central authentication server.');
    // We stop script execution
    exit;
}
// We initiate API processing
API::init();
// We parse API result to JSON format
API::parsing();
// We display API result and return HTTP response code
API::result();
开发者ID:leqg,项目名称:leqg-api,代码行数:31,代码来源:index.php

示例7: Mandrill

// On configure les données des API extérieures
$api['sms']['auth'] = new \Esendex\Authentication\LoginAuthentication($config['SMS']['compte'], $config['SMS']['login'], $config['SMS']['pass']);
$mail = new Mandrill($config['MAIL']['pass']);
$api['mail']['charset'] = 'UTF-8';
$api['mail']['smtp']['host'] = $config['MAIL']['host'];
$api['mail']['smtp']['user'] = $config['MAIL']['user'];
$api['mail']['smtp']['pass'] = $config['MAIL']['pass'];
$api['mail']['smtp']['port'] = $config['MAIL']['port'];
Configuration::write('api', $api);
Configuration::write('sms', $api['sms']['auth']);
Configuration::write('mail', $mail);
Configuration::write('mail.quota', $config['MAIL']['quota']);
Configuration::write('mail.sender.mail', $config['SENDER']['mail']);
Configuration::write('mail.sender.name', $config['SENDER']['name']);
Configuration::write('mail.replyto', $config['SENDER']['reply']);
Configuration::write('sms.sender', $config['SENDER']['name']);
// On inclut les classes non chargées
require_once 'class/boite.class.php';
require_once 'class/campaign.class.php';
require_once 'class/campagne.class.php';
require_once 'class/carto.class.php';
require_once 'class/contact.class.php';
require_once 'class/core.class.php';
require_once 'class/csv.class.php';
require_once 'class/dossier.class.php';
require_once 'class/evenement.class.php';
require_once 'class/event.class.php';
require_once 'class/folder.class.php';
require_once 'class/map.class.php';
require_once 'class/maps.class.php';
require_once 'class/mission.class.php';
开发者ID:leqg,项目名称:leqg,代码行数:31,代码来源:includes.php

示例8: array

        case 'copieTemplate':
            $data->templateCopy($_GET['template']);
            break;
        case 'modificationSMSCampagne':
            $data->update('message', $_POST['message']);
            break;
        case 'updateTracking':
            $data->trackingUpdate();
            break;
        case 'test':
            $data->testing();
            Core::goPage('campagne', array('id' => $_GET['id']), true);
            break;
    }
}
Configuration::write('tpl.actuel', $data->get('type'));
Core::loadHeader();
if ($data->get('type') == 'email') {
    ?>
<h2 id="titre-campagne" <?php 
    if ($data->get('status') == 'open') {
        ?>
class="titre"<?php 
    }
    ?>
 data-campagne="<?php 
    $data->get('id');
    ?>
"><?php 
    if (!empty($data->get('objet'))) {
        echo 'Campagne &laquo;&nbsp;' . $data->get('objet') . '&nbsp;&raquo;';
开发者ID:leqg,项目名称:leqg,代码行数:31,代码来源:campaign-dashboard.tpl.php

示例9: alertTypesConfig

 private function alertTypesConfig($sxml)
 {
     foreach ($sxml->{$this->selfname}->alertTypes->value as $value) {
         Configuration::write((string) $value['name'], (string) $value);
     }
 }
开发者ID:rhokburlington,项目名称:species-invaders,代码行数:6,代码来源:appconfig.module.php


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