summaryrefslogtreecommitdiff
path: root/ifconfig/ifconfig.php
diff options
context:
space:
mode:
Diffstat (limited to 'ifconfig/ifconfig.php')
-rw-r--r--ifconfig/ifconfig.php60
1 files changed, 0 insertions, 60 deletions
diff --git a/ifconfig/ifconfig.php b/ifconfig/ifconfig.php
deleted file mode 100644
index 33ec5ba..0000000
--- a/ifconfig/ifconfig.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-class Ifconfig {
-
- public $ip;
-
- public function __construct($ip){
- $this->ip=$ip;
- }
-
- public function getHeader(){
- $headers = '';
- foreach ($_SERVER as $name => $value){
- if (substr($name, 0, 5) == 'HTTP_'){
- $headers[str_replace(' ', '-', ucwords( strtolower( str_replace( '_', ' ', substr( $name, 5) ) ) ) )] = $value;
- }
- }
- return $headers;
- }
-
- public function getAllGeoipRecords(){
-
- $tmp = geoip_record_by_name( $this->ip );
- if( $tmp ){
- unset($tmp['dma_code']);
- unset($tmp['area_code']);
- } else {
- $tmp = array ( "status" => "Data not available");
- }
-
- return $tmp;
- }
-
- public function encodeJson($value){
-
- if( empty($value) || is_null($value) || $value == "" )
- return json_encode($output = array( "status" => "failure" ));
- else
- $output = array( "status" => "success" );
-
- if ( ! is_array($value) ){
- $output[] = $value;
- } else {
- $output = array_merge($output, $value);
- }
-
- return json_encode($output);
- }
-
- public function getReverseDNS($ip = NULL){
- if ( is_null($ip) )
- $ip = $this->ip;
-
- return gethostbyaddr($ip);
- }
-
- public function __destruct(){
- return true;
- }
-}