[TEP-COMMIT] [CVS admin] introduction of a modular IP address class implementation to use various

hpdl-OfajU3CKLf1/[email protected] 15 Aug 2004 18:06:49 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin/includes/classes on MAIN

ip_locator.php +81 added 1.1

introduction of a modular IP address class implementation to use various
services to retrieve information regarding an IP address

----------

admin /admin /includes /classes

ip_locator.php added at 1.1

diff -N ip_locator.php
--- /dev/null Sun Aug 15 20:06:48 2004
+++ /tmp/cvsAAABXaaYY Sun Aug 15 20:06:48 2004
@@ -0,0 +1,81 @@

+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2004 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class osC_IP_Locator {
+
+/* Private methods */
+
+ var $_module = false;
+
+/* Class constructor */
+
+ function osC_IP_Locator() {
+ if (defined('MODULE_IP_LOCATOR')) {
+ $this->_loadModule(MODULE_IP_LOCATOR);
+ }
+ }
+
+/* Public methods */
+
+ function isLoaded() {
+ if ($this->_module !== false) {
+ return true;
+ }
+
+ return false;
+ }
+
+ function getData($ip_address) {
+ if ($this->isLoaded()) {
+ $module_name = $this->_module;
+
+ $data = $GLOBALS[$module_name]->getData($ip_address);
+
+ if (is_array($data)) {
+ return $data;
+ }
+ }
+
+ return false;
+ }
+
+ function unload() {
+ if ($this->isLoaded()) {
+ $module_name = $this->_module;
+
+ $GLOBALS[$module_name]->unload();
+
+ unset($GLOBALS[$module_name]);
+
+ $this->_module = false;
+ }
+ }
+
+/* Private methods */
+
+ function _loadModule($module) {
+ $module = basename($module);
+
+ if (file_exists('includes/modules/' . $module . '.php')) {
+ if (include('includes/modules/' . $module . '.php')) {
+ $module_name = 'osC_IP_Locator_' . $module;
+
+ $GLOBALS[$module_name] = new $module_name();
+
+ if ($GLOBALS[$module_name]->isLoaded()) {
+ $this->_module = $module_name;
+ }
+ }
+ }
+ }
+ }
+?>

CVSspam 0.2.9

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285