PHP Classes

File: _config.php

Recommend this page to a friend!
  Classes of John Rutherford   PHP Path Difference   _config.php   Download  
File: _config.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Path Difference
Analyze directories and find new or changed files
Author: By
Last change:
Date: 6 years ago
Size: 1,231 bytes
 

Contents

Class file image Download
<?php
 
declare(strict_types=1);
   
# SET MORE CONSTNATs
 
define('LOCALHOST', 'localhost'===$_SERVER['SERVER_NAME']);
 
define("DELETE_TABLE", LOCALHOST);
 
define('jj', "\n<br>");
 
define('jt', "\n\t<br>");

# SET DBASE PARAMETERS ONLINE OR LOCALHOST
 
$fileAboveRoot = '/var/www/html/above_root/_database_params.php';
  if(
file_exists( $fileAboveRoot) ):
   
# PREVENT HACKING
     
include $fileAboveRoot;
  else:
// LOCALHOST:
     
define('DB_HOST', 'localhost');
     
define('DB_USER', 'QfiR03E36R14G62R50p35');
     
define('DB_PWRD', 'zNa0t33y61j46k25k035!@#');
     
define('DB_NAME', 'analyze_paths');
  endif;

# SET DEFAULT PATHS - CAN ADD MANY MORE
 
$paths = [
   
__DIR__,
   
dirname(__DIR__),
  ];
 
#=============================================================
# DEBUG
#==========================================================
function fred ($val=NULL, $title=NULL)
{
  echo
'<pre class="mg1 w88 bge warn bd1">';
    echo
$title .' ==> ';
     
print_r($val);
  echo
'</pre>';
}

#==========================================================
function vd($val=NULL, $title=NULL)
{
  echo
'<pre class="mg1 w88 bge warn bd1">';
    echo
$title .' ==> ' .$title;
   
var_dump($val);
  echo
'</pre>';
}