Skip to content

Instantly share code, notes, and snippets.

@kappuccino
Created March 26, 2014 15:42
Show Gist options
  • Select an option

  • Save kappuccino/9786300 to your computer and use it in GitHub Desktop.

Select an option

Save kappuccino/9786300 to your computer and use it in GitHub Desktop.
Wordpress Config
<?php
// Detecter le site de DEV (bdd de dev)
if($_SERVER['HTTP_HOST'] == 'dev.monsite.fr'){
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', '');
define('WP_HOME', 'http://dev.monsite.fr');
define('WP_SITEURL', 'http://dev.monsite.fr');
}else{
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', '');
define('WP_HOME', 'http://');
define('WP_SITEURL', 'http://');
}
// Si l'on ne souhaite pas utiliser /wp-content mais /data comme dossier
#define ('WP_CONTENT_FOLDERNAME', 'data');
#define ('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME) ;
#define ('WP_CONTENT_URL', WP_SITEURL . WP_CONTENT_FOLDERNAME);
// Désactive le cron interne ... il faut le lancer depuis l'extérieur
define('DISABLE_WP_CRON', true);
// Active le debug
define('WP_DEBUG', false);
error_reporting(E_ERROR | E_PARSE);
// Interdit l'installation d'un plugin depuis l'admin et l'edition des fichiers
define('DISALLOW_FILE_MODS', true);
define('DISALLOW_FILE_EDIT', true);
// Du plus
define('FS_CHMOD_FILE', 0755);
define('FS_CHMOD_DIR', 0644);
define('AUTOSAVE_INTERVAL', 120);
define('WP_POST_REVISIONS', 5);
define('WP_MEMORY_LIMIT', '64M');
@kappuccino
Copy link
Copy Markdown
Author

Rajouter
include __DIR__.'/kappuccino.php';
au début du fichier wp-config.php pour loader ce fichier en premier.

Comme tout est à base de constante, peu importe les valeur du fichier wp-config.php elle seront initialisé avant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment