Subversion Repositories computer_asset_manager_v1

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 80
Line 1... Line 1...
1
<?php 
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 {
2
   include_once( realpath( $_SERVER['DOCUMENT_ROOT'] . '/../camp_config.php' ) );
30
      include_once( realpath( $_SERVER['DOCUMENT_ROOT'] . '/../camp_config.php' ) );
-
 
31
   }
3
?>
32
?>