Skip to content

Instantly share code, notes, and snippets.

@nick-kravchenko
Last active March 21, 2017 13:14
Show Gist options
  • Save nick-kravchenko/57ecc63d74e7989b1e22ac9e83483523 to your computer and use it in GitHub Desktop.
Save nick-kravchenko/57ecc63d74e7989b1e22ac9e83483523 to your computer and use it in GitHub Desktop.
Deny acces for config files
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<?php
Config::write('conf1.php', array( 'setting_1' => 'foo' ));
$config = MyConfig::read('conf1.php');
$config['setting_1'] = 'test';
$config['setting_2'] = 'test';
Config::write('conf1.php', $config);
// http://php.net/manual/en/function.parse-ini-file.php
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment