[TEP-COMMIT] [CVS catalog] moved logic to service modules
anonymous-OfajU3CKLf1/[email protected] 13 Apr 2004 08:10:42 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit in catalog/catalog/includes/functions on MAIN
gzip_compression.php 1.4 removed
whos_online.php 1.13 removed
2 removed files
moved logic to service modules
----------
catalog /catalog /includes /functions
gzip_compression.php removed after 1.4
diff -N gzip_compression.php
--- /tmp/cvsAAA.wainq Tue Apr 13 10:10:40 2004
+++ /dev/null Tue Apr 13 10:10:39 2004
@@ -1,51 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2003 osCommerce
-
- Released under the GNU General Public License
-*/
-
- function tep_check_gzip() {
- if (PHP_VERSION < 4.1) {
- global $_SERVER;
- }
-
- if (headers_sent() || connection_aborted()) {
- return false;
- }
-
- if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) return 'x-gzip';
-
- if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) return 'gzip';
-
- return false;
- }
-
-/* $level = compression level 0-9, 0=none, 9=max */
- function tep_gzip_output($level = 5) {
- if ($encoding = tep_check_gzip()) {
- $contents = ob_get_contents();
- ob_end_clean();
-
- header('Content-Encoding: ' . $encoding);
-
- $size = strlen($contents);
- $crc = crc32($contents);
-
- $contents = gzcompress($contents, $level);
- $contents = substr($contents, 0, strlen($contents) - 4);
-
- echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
- echo $contents;
- echo pack('V', $crc);
- echo pack('V', $size);
- } else {
- ob_end_flush();
- }
- }
-?>
----------
catalog /catalog /includes /functions
whos_online.php removed after 1.13
diff -N whos_online.php
--- /tmp/cvsAAAVxaqnq Tue Apr 13 10:10:40 2004
+++ /dev/null Tue Apr 13 10:10:39 2004
@@ -1,67 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2004 osCommerce
-
- Released under the GNU General Public License
-*/
-
- function tep_update_whos_online() {
- global $osC_Session, $osC_Customer, $osC_Database;
-
- if ($osC_Customer->isLoggedOn()) {
- $wo_customer_id = $osC_Customer->id;
- $wo_full_name = $osC_Customer->full_name;
- } else {
- $wo_customer_id = '';
- $wo_full_name = 'Guest';
- }
-
- $wo_session_id = $osC_Session->id;
- $wo_ip_address = getenv('REMOTE_ADDR');
- $wo_last_page_url = getenv('REQUEST_URI');
-
- $current_time = time();
- $xx_mins_ago = ($current_time - 900);
-
-// remove entries that have expired
- $Qwhosonline = $osC_Database->query('delete from :table_whos_online where time_last_click < :time_last_click');
- $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
- $Qwhosonline->bindValue(':time_last_click', $xx_mins_ago);
- $Qwhosonline->execute();
-
- $Qwhosonline = $osC_Database->query('select count(*) as count from :table_whos_online where session_id = :session_id');
- $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
- $Qwhosonline->bindValue(':session_id', $wo_session_id);
- $Qwhosonline->execute();
-
- if ($Qwhosonline->valueInt('count') > 0) {
- $Qwhosonline = $osC_Database->query('update :table_whos_online set customer_id = :customer_id, full_name = :full_name, ip_address = :ip_address, time_last_click = :time_last_click, last_page_url = :last_page_url where session_id = :session_id');
- $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
- $Qwhosonline->bindInt(':customer_id', $wo_customer_id);
- $Qwhosonline->bindValue(':full_name', $wo_full_name);
- $Qwhosonline->bindValue(':ip_address', $wo_ip_address);
- $Qwhosonline->bindValue(':time_last_click', $current_time);
- $Qwhosonline->bindValue(':last_page_url', $wo_last_page_url);
- $Qwhosonline->bindValue(':session_id', $wo_session_id);
- $Qwhosonline->execute();
- } else {
- $Qwhosonline = $osC_Database->query('insert into :table_whos_online (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values (:customer_id, :full_name, :session_id, :ip_address, :time_entry, :time_last_click, :last_page_url)');
- $Qwhosonline->bindRaw(':table_whos_online', TABLE_WHOS_ONLINE);
- $Qwhosonline->bindInt(':customer_id', $wo_customer_id);
- $Qwhosonline->bindValue(':full_name', $wo_full_name);
- $Qwhosonline->bindValue(':session_id', $wo_session_id);
- $Qwhosonline->bindValue(':ip_address', $wo_ip_address);
- $Qwhosonline->bindValue(':time_entry', $current_time);
- $Qwhosonline->bindValue(':time_last_click', $current_time);
- $Qwhosonline->bindValue(':last_page_url', $wo_last_page_url);
- $Qwhosonline->execute();
- }
-
- $Qwhosonline->freeResult();
- }
-?>
CVSspam 0.2.8
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click