Open Source Content Management Framework

PHP midgard_config method save_file

  1. Example

Save configuration to a file.

bool save_file(name, [bool user]);

midgard_config method save_file takes two parameters:

  • configuration name
  • user configuration switch

Named configuration's file will be created if doesn't exist. In other case, its content is overwritten. user switch has the same meaning as in read_file method.

Returns TRUE if configuration has been successfully written to a file, FALSE otherwise.

Example

<?php

$config = new midgard_config();

$config->dbtype = "Oracle";
$config->database = "midgard";
$config->dbuser = "midgard";
$config->dbpass = "midgard";

if(!$config->save_file("my_oracle_ex")) 
{
    echo "Could not save configuration!"; 
}
?>
Tagged
ragnaroek
vinland
Designed by Nemein, hosted by Kafit