Subversion Repositories computer_asset_manager_v1

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
80 rodolico 1
<?php
2
 
3
   function is_cli() {
4
       if ( defined('STDIN') ) {
5
           return true;
6
       }
7
 
8
       if ( php_sapi_name() === 'cli' ) {
9
           return true;
10
       }
11
 
12
       if ( array_key_exists('SHELL', $_ENV) ) {
13
           return true;
14
       }
15
 
16
       if ( empty($_SERVER['REMOTE_ADDR']) and !isset($_SERVER['HTTP_USER_AGENT']) and count($_SERVER['argv']) > 0) {
17
           return true;
18
       } 
19
 
20
       if ( !array_key_exists('REQUEST_METHOD', $_SERVER) ) {
21
           return true;
22
       }
23
 
24
       return false;
25
   }
26
 
27
   if ( is_cli() ) {
28
      include_once( dirname(__FILE__) . '/../../camp_config.php' );
29
   } else {
30
      include_once( realpath( $_SERVER['DOCUMENT_ROOT'] . '/../camp_config.php' ) );
31
   }
1 rodolico 32
?>