本文整理汇总了PHP中ecrire_config函数的典型用法代码示例。如果您正苦于以下问题:PHP ecrire_config函数的具体用法?PHP ecrire_config怎么用?PHP ecrire_config使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ecrire_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formulaires_configurer_sarkaspip_plugins_traiter
function formulaires_configurer_sarkaspip_plugins_traiter()
{
// On simule le traitement normal du cvt configurer
include_spip('inc/cvt_configurer');
$args = func_get_args();
$trace = cvtconf_formulaires_configurer_enregistre('configurer_sarkaspip_plugins', $args);
// Post traitement de configuration des plugins concernes
include_spip('inc/config');
if (lire_config('sarkaspip_plugins/config_boutonstexte') == 'sarkaspip') {
ecrire_config('boutonstexte/', array('selector' => _SARKASPIP_CONFIG_BOUTONSTEXTE_SELECTOR, 'txtOnly' => _SARKASPIP_CONFIG_BOUTONSTEXTE_TXTONLY));
} else {
effacer_config('boutonstexte');
}
if (lire_config('sarkaspip_plugins/config_mediabox') == 'sarkaspip') {
ecrire_config('mediabox/', array('active' => _SARKASPIP_CONFIG_MEDIABOX_ACTIF, 'traiter_toutes_images' => _SARKASPIP_CONFIG_MEDIABOX_TOUT, 'selecteur_commun' => _SARKASPIP_CONFIG_MEDIABOX_IMAGE, 'selecteur_galerie' => _SARKASPIP_CONFIG_MEDIABOX_GALERIE, 'skin' => _SARKASPIP_CONFIG_MEDIABOX_SKIN));
} else {
effacer_config('mediabox');
}
if (lire_config('sarkaspip_plugins/config_socialtags') == 'sarkaspip') {
ecrire_config('socialtags/', array('jsselector' => _SARKASPIP_CONFIG_SOCIALTAGS_SELECTOR, 'tags' => explode(':', _SARKASPIP_CONFIG_SOCIALTAGS_TAGS)));
} else {
effacer_config('socialtags');
}
return array('message_ok' => _T('config_info_enregistree') . $trace, 'editable' => true);
}
示例2: presta_sips_install_dist
/**
* Installation des fichiers de configuration/parametrage SIPS
*/
function presta_sips_install_dist()
{
include_spip('inc/config');
if (!lire_config("bank_paiement/config_sips", '')) {
$merchant_id = "";
$certif = "";
if (isset($GLOBALS['meta']['bank_sips_merchant_id']) and file_exists(_DIR_ETC . $GLOBALS['meta']['bank_sips_merchant_id'])) {
include_once _DIR_ETC . $GLOBALS['meta']['bank_sips_merchant_id'];
$boutique = "";
if (function_exists($f = "bank_sips" . $boutique . "_merchant_id")) {
$merchant_id = $f();
}
if (file_exists($f = _DIR_ETC . dirname($GLOBALS['meta']['bank_sips_merchant_id']) . "/certif.fr.{$merchant_id}")) {
lire_fichier($f, $certif);
}
}
if (defined('_SIPS_PRESTA') and $merchant_id and $certif) {
$presta = _SIPS_PRESTA;
} else {
$presta = "mercanet";
$merchant_id = '082584341411111';
lire_fichier(_DIR_PLUGIN_BANK . "presta/sips/bin/{$presta}/param/certif.fr.{$merchant_id}", $certif);
}
ecrire_config("bank_paiement/config_sips", array('merchant_id' => '2', 'service' => $presta, 'certificat' => $certif));
}
}
示例3: ckeditor_install
function ckeditor_install($action,$prefix,$version_cible){
switch($action) {
case 'test':
$ckeditor = lire_config('ckeditor',false) ;
return is_array($ckeditor) ;
case 'install':
$formulaires = preg_files(_DIR_RACINE, "ckeditor-spip-plugin/formulaires/.*.php") ;
foreach($formulaires as $formulaire) {
spip_log("formulaire : $formulaire", "ckeditor");
if (preg_match("~formulaires/(ck[a-z]).php$~",$formulaire, $m)) {
include_spip("formulaires/".$m[1]);
$fonction = "formulaires_".$m[1]."_charger_dist" ;
$valeurs = $fonction() ;
$vals=array();
foreach($valeurs as $entree => $valeur) {
if (! is_null($valeur) && ! ($valeur === '')) {
ecrire_config("ckeditor/".$entree, $valeur) ;
$vals[]="ckeditor/$entree";
}
}
}
}
return true ;
default:
spip_log("installation[action:$action non prise en charge]", "ckeditor");
}
}
示例4: crayons_config_store_set_modifs
/**
* sauver les modifications de configs
*
* @param Array $modifs
* @param Array $return
* @return Array
*/
function crayons_config_store_set_modifs($modifs, $return) {
foreach ($modifs as $modif) {
list($type, $modele, $id, $content, $wid) = $modif;
$config = cfg_crayon2config($modele);
ecrire_config($config, $content['config']);
}
return $return;
}
示例5: compagnon_create
function compagnon_create()
{
include_spip('inc/config');
if (sql_getfetsel('id_rubrique', 'spip_rubriques', '', '', '', '0,1')) {
ecrire_config('compagnon/config/activer', 'non');
} else {
ecrire_config('compagnon/config/activer', 'oui');
}
}
示例6: formulaires_configurer_porte_plume_traiter_dist
function formulaires_configurer_porte_plume_traiter_dist(){
include_spip('inc/config');
appliquer_modifs_config();
if (version_compare($GLOBALS['spip_version_branche'], "2.1.0-dev", "<")) {
ecrire_config('barre_outils_public', _request('barre_outils_public'));
}
return array('message_ok'=>_T('barre_outils:config_info_enregistree'));
}
示例7: TestPerformMaintenance_AddProductsForArticles
function TestPerformMaintenance_AddProductsForArticles()
{
// Make first rubrique ecatalogue's rubrique, and place articles in it
ecrire_config('ecatalogue/branches', 'rubrique|1');
$this->article_mdl->update(false, array('id_rubrique' => 1));
// Delete products
$this->product_mdl->delete();
$this->ecatalogue->PerformMaintenance();
$this->assertTrue($this->product_mdl->select_by_id(1));
$this->assertTrue($this->product_mdl->select_by_id(2));
}
示例8: action_compagnon_dist
/**
* Action compagnon : indique qu'un auteur a validé un message d'aide
*
* @global array $GLOBALS ['visiteur_session']
**/
function action_compagnon_dist()
{
$securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action();
if (substr($arg, 0, 8) !== 'compris/') {
include_spip('inc/minipres');
echo minipres("Arguments de l'action compagnon non compris");
exit;
}
$quoi = substr($arg, 8);
$auteur = $GLOBALS['visiteur_session']['id_auteur'];
include_spip('inc/config');
ecrire_config("compagnon/{$auteur}/{$quoi}", 1);
}
示例9: formulaires_reinitialiser_compagnon_traiter
/**
* Traitement du formulaire de réinitialisation des messages du compagnon
*
* @return array
* Retours du traitement
**/
function formulaires_reinitialiser_compagnon_traiter()
{
$qui = _request('qui');
include_spip('inc/config');
if ($qui == 'moi') {
effacer_config('compagnon/' . $GLOBALS['visiteur_session']['id_auteur']);
}
if ($qui == 'tous') {
$config = lire_config('compagnon/config');
effacer_config('compagnon');
ecrire_config('compagnon/config', $config);
}
return array('message_ok' => _T('compagnon:reinitialisation_ok'));
}
示例10: formulaires_restauration_cfg_traiter_dist
function formulaires_restauration_cfg_traiter_dist()
{
$message = array();
$fichier = _request('fichier_a_restaurer');
lire_fichier($fichier, $tableau);
include_spip('inc/config');
$dirs = explode('/', dirname($fichier));
$fond = end($dirs);
$ok = ecrire_config($fond, $tableau);
if (!$ok) {
$message['message_nok'] = _T('sarkaspip:cfg_msg_fichier_restauration_nok');
}
if ($ok) {
$message['message_ok'] = _T('sarkaspip:cfg_msg_fichier_restauration_ok', array('nom_fichier' => $fichier));
}
return $message;
}
示例11: palette_upgrade
/**
* Installation du Plugin Palette
*/
function palette_upgrade($nom_meta_base_version,$version_cible){
$current_version = 0.0;
if ((!isset($GLOBALS['meta'][$nom_meta_base_version]))
|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){
if (function_exists('ecrire_config')){
if(is_null(lire_config('palette/palette_public')))
ecrire_config('palette/palette_public','');
if(is_null(lire_config('palette/palette_ecrire')))
ecrire_config('palette/palette_ecrire','on');
}else{
$config = @unserialize($GLOBALS['meta']['palette']);
if (!is_array($config))
$config = 'a:2:{s:14:"palette_public";N;s:14:"palette_ecrire";s:2:"on";}';
ecrire_meta('palette', $config);
}
ecrire_meta($nom_meta_base_version,$current_version=$version_cible, 'non');
}
}
示例12: formulaires_configurer_accesrestreint_traiter_dist
function formulaires_configurer_accesrestreint_traiter_dist()
{
$champs = array('accesrestreint_proteger_documents', 'creer_htpasswd');
include_spip('inc/config');
$old_config = lire_config('accesrestreint_proteger_documents');
foreach ($champs as $c) {
ecrire_config($c, _request($c) == 'oui' ? 'oui' : 'non');
}
// generer/supprimer les fichiers htaccess qui vont bien
include_spip("inc/accesrestreint_documents");
$new_config = lire_config('accesrestreint_proteger_documents');
accesrestreint_gerer_htaccess($new_config == "oui");
// si le reglage du htaccess a change, purger le cache
if ($new_config !== $old_config) {
$purger = charger_fonction("purger", "action");
$purger("cache");
}
return array('message_ok' => _T('config_info_enregistree'), 'editable' => true);
}
示例13: sarkaspip_zengarden_activer_theme
function sarkaspip_zengarden_activer_theme($flux)
{
$dir = $flux['args']['dir'];
$action = $flux['args']['action'];
$dir_cfg = $dir . '/cfg';
$cfg = preg_files($dir_cfg);
include_spip('inc/config');
if ($action == 'activer') {
// On sauvegarde des valeurs actuelles pour un eventuel rappel
$dir_cfg = sous_repertoire(_DIR_TMP, "cfg");
$dir_cfg = sous_repertoire(_DIR_TMP, "themes");
$fonds = array();
foreach ($cfg as $_fichier_cfg) {
$fonds[] = basename($_fichier_cfg, '.txt');
}
include_spip('inc/sarkaspip_filtres');
$ok = sauvegarder_fonds($fonds, $dir_cfg, 'theme');
// On ecrit la nouvelle configuration n�cessaire au theme choisi
$flux['data'] = true;
foreach ($cfg as $_fichier_cfg) {
lire_fichier($_fichier_cfg, $tableau);
$fond = basename($_fichier_cfg, '.txt');
ecrire_config($fond, $tableau);
}
} else {
if ($action == 'effacer') {
$fichiers = array();
$flux['data'] = true;
foreach ($cfg as $_fichier_cfg) {
$fond = basename($_fichier_cfg, '.txt');
effacer_config($fond);
$fichiers[] = _DIR_TMP . 'themes/cfg/' . $fond . '.txt';
}
include_spip('inc/sarkaspip_filtres');
$ok = restaurer_fonds($fichiers);
} else {
// action apercevoir : on ne fait rien, on sait pas faire..
}
}
return $flux;
}
示例14: formulaires_configurer_ckeditor_p2_traiter_dist
function formulaires_configurer_ckeditor_p2_traiter_dist() {
if (_request("_cfg_delete")) {
$valeurs = formulaires_configurer_ckeditor_p2_charger_dist() ;
foreach($valeurs as $cle => $valeur) {
if (preg_match('~^tool_~',$cle)) {
effacer_config("ckeditor/$cle") ;
// éviter que les champs ne soit préremplis avec les valeurs précédentes
unset($_POST[$cle]) ;
}
}
return array('message_erreur' => _T('ckeditor:ck_delete')) ;
} else {
foreach($GLOBALS['toolbars'] as $toolbar) {
foreach($toolbar as $tool => $size) {
if (!ckeditor_tweaks_actifs('smileys') && ($tool == 'Smiley')) continue ;
ecrire_config("ckeditor/tool_$tool", _request("tool_$tool")==='on'?1:0) ;
}
}
return array('message_ok' => _T('ckeditor:ck_ok')) ;
}
}
示例15: presta_paybox_install_dist
/**
* Installation des fichiers de configuration/parametrage PAYBOX
*/
function presta_paybox_install_dist()
{
include_spip('inc/config');
if (file_exists($f = _DIR_ETC . "presta/paybox/pbx_ids.php")) {
include_once $f;
// la fonction bank_paybox_pbx_ids est definie dans le fichier pbx_ids.php
if (function_exists("bank_paybox_pbx_ids")) {
$config = bank_paybox_pbx_ids();
ecrire_config("bank_paiement/config_paybox", $config);
@unlink($f);
}
}
if (!lire_config("bank_paiement/config_paybox", '')) {
ecrire_config("bank_paiement/config_paybox", array('PBX_IDENTIFIANT' => '2', 'PBX_SITE' => '1999888', 'PBX_RANG' => '99'));
}
// effacer cette vieille config
if (lire_config("bank_paiement/config_paybox/pubkey", '')) {
ecrire_config("bank_paiement/config_paybox/pubkey", null);
}
if (lire_config("bank_paiement/config_abo_paybox/pubkey", '')) {
ecrire_config("bank_paiement/config_abo_paybox/pubkey", null);
}
}