⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.php

📁 主要是提供域名查询功能的主程序 PHP源代码
💻 PHP
字号:
<?php
// --------------------------------------------
// | The EP-Dev Whois script        
// |                                           
// | Copyright (c) 2003-2005 EP-Dev.com :           
// | This program is distributed as free       
// | software under the GNU General Public     
// | License as published by the Free Software 
// | Foundation. You may freely redistribute     
// | and/or modify this program.               
// |                                           
// --------------------------------------------


/* ------------------------------------------------------------------ */
//	Global Class
//  Initializes and organizes all classes of the whois script as well
//	as general functions that may be used by multiple classes.
//	Date: 3/29/2005
/* ------------------------------------------------------------------ */

class EP_Dev_Whois_Global
{
	var $DOMAINS;
	var $ENGINE;
	var $DISPLAY;
	var $USER;

	var $TEMPLATES;
	var $CONFIG;

	var $ERROR;
	var $LOG;

	function EP_Dev_Whois_Global($absolute_path="")
	{
		// +------------------------------
		//	Load templates
		// +------------------------------
		$this->ERROR = new EP_Dev_Whois_Error($this);


		// +------------------------------
		//	Load configuration
		// +------------------------------

		// include file
		$this->includeFile("config/config.php", $absolute_path);

		// initialize
		$this->CONFIG = new EP_Dev_Whois_Config();


		// +------------------------------
		//	Load templates
		// +------------------------------

		// include file
		$this->includeFile("config/template.php");

		// initialize
		$config = new EP_Dev_Whois_Templates();

		// assign to local member variables
		$this->TEMPLATES = $config->TEMPLATES;

		// destroy config object
		unset($config);


		// +------------------------------
		//	Load Display Class
		// +------------------------------

		// include file
		$this->includeFile($this->CONFIG->FILES['file']['display']);

		// initialize
		$this->DISPLAY = new EP_Dev_Whois_Display($this);


		// +------------------------------
		//	Load Domain Configuration
		// +------------------------------

		// include file
		$this->includeFile($this->CONFIG->FILES['file']['domains']);

		// initialize
		$this->DOMAINS = new EP_Dev_Whois_Domains($this);


		// +------------------------------
		//	Load Whois Engine
		// +------------------------------

		// include file
		$this->includeFile($this->CONFIG->FILES['file']['engine']);


		// +------------------------------
		//	Load User Class
		// +------------------------------

		// include file
		$this->includeFile($this->CONFIG->FILES['file']['user']);

		// initialize
		$this->USER = new EP_Dev_Whois_User($this, "EP_Dev_Whois_");


		// +------------------------------
		//	Load Log Class
		// +------------------------------

		// include file
		$this->includeFile($this->CONFIG->FILES['file']['logs']);

		// initialize
		$this->LOG = new EP_Dev_Whois_Logs($this);


		// +------------------------------
		//	Reload All Cores (PHP < 5.x)
		// +------------------------------
		$this->ERROR->reloadCore($this);
		$this->DOMAINS->reloadCore($this);
		$this->DISPLAY->reloadCore($this);
		$this->USER->reloadCore($this);
		$this->LOG->reloadCore($this);
	}


	/* ------------------------------------------------------------------ */
	//	Include File
	//	Includes file found in $path. Verbose error if not $silent
	/* ------------------------------------------------------------------ */
	
	function includeFile($file, $path = null, $silent = false)
	{
		// load default path if not path given
		if ($path == null)
			$path = $this->CONFIG->SCRIPT['absolute_path'];

		// attempt include
		$result = @include_once($path . $file);

		// silently return false if error
		if ($result == false && $silent)
		{
			return false;
		}

		// error and error if verbose
		elseif ($result == false)
		{
			$this->ERROR->stop("bad_include:::{$path}:::{$file}");
			return false;
		}

		// assume success
		else
		{
			return true;
		}
	}


	/* ------------------------------------------------------------------ */
	//	Whois Request
	//	Generates new whois request object and returns resource identifier.
	/* ------------------------------------------------------------------ */
	
	function whoisRequest($domain, $ext)
	{
		// error if extension not available
		if (!in_array($ext, $this->DOMAINS->getAllExtensions()))
			$this->ERROR->stop("bad_extension:::{$ext}");

		// return new whois request object
		return new EP_Dev_Whois_Engine($domain, $ext, $this);
	}


	/* ------------------------------------------------------------------ */
	//	Convert Currency
	//	Converts number into a formatted currency string
	/* ------------------------------------------------------------------ */
	
	function currencyConvert($number)
	{
		/*
		Acceptable values here: "us", "uk", "eu", "custom:s:d:ds:ts".
		EX: Setting it to = "us" will output 10 as $10.00
			Setting it to = "uk" will output 10 as 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -