rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

api.php (731B)


      1 <?php
      2 /**
      3  * Database configuration
      4  */
      5 ###############################
      6 # include files from root dir #
      7 ###############################
      8 $root_1 = realpath($_SERVER["DOCUMENT_ROOT"]);
      9 $currentdir = getcwd();
     10 $root_2 = str_replace($root_1, '', $currentdir);
     11 $root_3 = explode("/", $root_2);
     12 if ($root_3[1] == 'core') {
     13   echo $root_3[1];
     14   $root = realpath($_SERVER["DOCUMENT_ROOT"]);
     15 }else{
     16   $root = $root_1 . '/' . $root_3[1];
     17 }
     18 require $root . "/core/config/connect.db.inc.php";
     19 define('DB_USERNAME', $db_username);
     20 define('DB_PASSWORD', $db_password);
     21 define('DB_HOST', $db_servername);
     22 define('DB_NAME', $db_name);
     23  
     24 define('USER_CREATED_SUCCESSFULLY', 0);
     25 define('USER_CREATE_FAILED', 1);
     26 define('USER_ALREADY_EXISTED', 2);
     27 ?>