hecart 高性能电子购物车-升级版
hecart 高性能电子购物车-升级版,现已修改热情网友指出的相关BUG,欢迎广大网友下载使用!High-performance electronic cart platform foreign electricity suppliers system high load high concurrency, high efficiency,
hecart 高性能电子购物车-升级版,现已修改热情网友指出的相关BUG,欢迎广大网友下载使用!
High-performance electronic cart platform foreign electricity suppliers system high load high concurrency, high efficiency, high-speed, distributed, high-performance electronic cart systems
With these various techniques and optimization, then do not worry for the lost one; using this system you can sit back and relax boss Monetize your friends!
Core features are as follows:
Database separate read and write speed
memcached buffering speed
HTML static pages acceleration
Images watermarked
image server separation
image support CDN
DNS round robin mirror server
Multi-language support
multi-currency support
Orders report statistical analysis
Product price concessions deal
Page layout can be flexibly configured
Multi-server load balanced layout
Safety reliability
All the details of the optimization process.
It has order management and multiple payment gateways already built in and we provide lifetime free support and free software updates.
Open Source
Documentation
Unlimited Categories
Unlimited Products
Unlimited Manufacturers
Templatable
Multi-Language
Multi-Currency
Product Reviews
Product Ratings
Downloadable Products
PCI Compliant
Automatic Image Resizing
Multiple Tax Rates
Related Products
Unlimited Information Pages
Shipping Weight Calculation
Discount Coupon System
Search Engine Optimization (SEO)
Unlimited Module Instance System
Backup & Restore Tools
Printable Invoices
Sales Reports
Error Logging
High-performance electronic cart platform foreign electricity suppliers system high load high concurrency, high efficiency, high-speed, distributed, high-performance electronic cart systems
With these various techniques and optimization, then do not worry for the lost one; using this system you can sit back and relax boss Monetize your friends!
Core features are as follows:
Database separate read and write speed
memcached buffering speed
HTML static pages acceleration
Images watermarked
image server separation
image support CDN
DNS round robin mirror server
Multi-language support
multi-currency support
Orders report statistical analysis
Product price concessions deal
Page layout can be flexibly configured
Multi-server load balanced layout
Safety reliability
All the details of the optimization process.
It has order management and multiple payment gateways already built in and we provide lifetime free support and free software updates.
Open Source
Documentation
Unlimited Categories
Unlimited Products
Unlimited Manufacturers
Templatable
Multi-Language
Multi-Currency
Product Reviews
Product Ratings
Downloadable Products
PCI Compliant
Automatic Image Resizing
Multiple Tax Rates
Related Products
Unlimited Information Pages
Shipping Weight Calculation
Discount Coupon System
Search Engine Optimization (SEO)
Unlimited Module Instance System
Backup & Restore Tools
Printable Invoices
Sales Reports
Error Logging
<?php /** * 慧佳工作室 -> hoojar studio * * 模块: wcore/speed.php * 简述: 生成静态文件或缓冲MEMCACHED * 作者: woods·zhang -> hoojar@163.com * 版本: $Id: speed.php 1 2012-11-20 05:55:12Z Administrator $ * 版权: Copyright 2006-2013 慧佳工作室拥有此系统所有版权等知识产权 * */ class wcore_speed { /** * 采用哪种类型加速 * * @var string {file:文件类型 mem:Memcached} */ private $_type = 'file'; /** * 生成哪个类型的文件 * * @var string 此参数只有type=file才生效 */ private $_ext = '.html'; /** * 缓冲在哪个目录当中 * * @var string 如果type=file此处才生效 */ private $_floder = ''; /** * 过滤哪些GET字段 * * @var string 需要过滤的内容 */ private $_filter = ',nocache,error,local,'; /** * MEM缓冲对象 * * @var wcore_mem MEM缓冲对象 */ private $_mem = null; /** * 当前页面唯一编号 page unique id * * @var string 如果puid为空则代表不启动加速服务 */ private $_puid = ''; /** * 加速数据有效期(单位分钟) * * @var int 默认为10分钟 */ private $_expire = 10; /** * 构造函数 * * @param string $type 采用哪种类型加速{file:文件类型 mem:Memcached} * @param int $expire 加速数据有效期(单位分钟)默认为0是为了采用全局设置的有效期 * @param string $puid 缓冲时的唯一编号 * @param string $floder 如果type=file生效,缓冲在哪个目录当中 * @param string $ext 如果type=file生效,生成哪个类型的文件 */ public function __construct($type = 'file', $expire = 0, $puid = '', $floder = '', $ext = '.html') { /** * 判断是否启动加速服务,当有POST数据时则不加速内容或者是否设定了启动加速内容常量且为真 */ if (!empty($_POST) || (defined('SPEED_DATA') && !SPEED_DATA)) { return; } /** * 初始化相关数据 */ $this->_ext = empty($ext) ? $this->_ext : $ext; $this->_type = (strtolower($type) == 'mem') ? 'mem' : 'file'; $this->_floder = empty($floder) ? $_SERVER['DOCUMENT_ROOT'] : $floder; $expire = intval($expire); //加速数据有效期(单位分钟) $this->_expire = ($expire > 0) ? $expire : (defined('SPEED_DATA_EXPIRE') ? SPEED_DATA_EXPIRE : 10); /** * 缓冲时的唯一编号 */ if (!empty($puid)) { $this->_puid = $puid; } else { $this->generate_puid(); //生成页面唯一页面编号 } /** * 判断采用哪种媒介存储,如果是采用MEM就创建MEM对象 */ if ($this->_type == 'mem') { $this->_mem = wcore_object::mem(); } } /** * 增加需要过滤的GET字段 * * @param string $str 需要过滤的GET字段 * @return bool 增加成功返回true失败为false */ public function add_filter($str) { if (empty($str)) { return false; } $this->_filter .= "{$str},"; return true; } /** * 产生唯一编号若type类型为mem则在编号上加域名MD5 * * @return string 唯一编号 */ public function generate_puid() { /** * 判断是否有GET数据若有数据则根据GET数据生成编号 */ $puid = ''; ksort($_GET); //对GET数组的KEY排序,尽量操持puid因GET数据前后而不同 foreach ($_GET as $k => $v) { if (strpos($this->_filter, ",{$k},") === false) { $puid .= $k . (empty($v) ? '' : "-{$v}-"); } } /** * 判断由GET数据组合而成的puid是否有数据,若没有的话就只以执行文件名编号 */ if (empty($puid)) { $puid = dirname($_SERVER['SCRIPT_NAME']) . strtok(basename($_SERVER['SCRIPT_NAME']), '.') . "{$puid}"; } else { if ($puid[strlen($puid) - 1] == '-') { $puid = substr($puid, 0, -1); } $puid = strtok($_SERVER['SCRIPT_NAME'], '.') . "/{$puid}"; } /** * 根据存储类型与域名生成编号 */ $domain = defined(DOMAIN_NAME) ? DOMAIN_NAME : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''); //主机域名 $this->_puid = ($this->_type == 'mem') ? md5("{$domain}{$puid}") : "{$puid}{$this->_ext}"; } /** * 获取先前加速已存储好的数据 * * @return string 加速的内容 */ public function &get_data() { $html = ''; //要返回的数据 if (isset($_GET['nocache']) || empty($this->_puid) || !empty($_POST)) { return $html; } /** * 采用Memcached加速获取 */ if ($this->_type == 'mem') { return $this->_mem->get('SPEED-DATA', $this->_puid); } /** * 采用文件系统加速获取 */ $filename = "{$this->_floder}/{$this->_puid}"; if (file_exists($filename)) { $lcft = filemtime($filename); //last create file time 上次创建时间 if (($lcft + ($this->_expire * 60)) < time()) //加速内容过期了 { return $html; } $html = file_get_contents($filename); //读取加速文件内容 } return $html; } /** * 存储要加速的数据到指定的媒介 * * @param string $html 要存储的HTML内容 * @return bool 是否存储成功 */ public function set_data(&$html = '') { if (empty($this->_puid)) { return false; } if (empty($html)) { $html = ob_get_flush(); } /** * 采用Memcached加速存储 */ if ($this->_type == 'mem') { return $this->_mem->set('SPEED-DATA', $this->_puid, $html, $this->_expire); } /** * 采用文件系统加速存储 */ $filename = "{$this->_floder}/{$this->_puid}"; $this->make_dir(dirname($filename)); file_put_contents($filename, $html); return true; } /** * 自动创建目录,可递归创建 * * @param string $path 要创建的目录地址 * @return boolean 创建成功返回true失败为false */ public function make_dir($path) { if (empty($path)) { return false; } if (!file_exists($path)) { $this->make_dir(dirname($path)); @mkdir($path, 0777); } return true; } } ?>
2. [文件] object.php ~ 5KB 下载(7) 跳至 [1] [2] [全屏预览]
<?php /** * 慧佳工作室 -> hoojar studio * * 模块: wcore/object.php * 简述: 全局对象操作接口 * 作者: woods·zhang -> hoojar@163.com * 版本: $Id: object.php 1 2012-11-20 05:55:12Z Administrator $ * 版权: Copyright 2006-2013 慧佳工作室拥有此系统所有版权等知识产权 * */ class wcore_object { /** * 常用函数接口 * * @var wcore_utils */ private static $_utils = null; /** * 提示函数接口 * * @var wcore_tip */ private static $_tip = null; /** * 操作数据库接口 * * @var wcore_mysql */ private static $_db = array(); /** * 操作MEMCACHED库接口 * * @var wcore_mem */ private static $_mem = null; /** * 操作MEMCACHED库接口 * * @var Smarty */ private static $_smarty = null; /** * 常用函数接口 * * @return wcore_utils 返回常用函数对象 */ public static function &utils() { if (is_object(self::$_utils)) { return self::$_utils; } self::$_utils = new wcore_utils(); return self::$_utils; } /** * 提示函数接口 * * @return wcore_tip 返回常用函数对象 */ public static function &tip() { if (is_object(self::$_tip)) { return self::$_tip; } self::$_tip = new wcore_tip(); return self::$_tip; } /** * 操作数据库接口 * @param string $name * @return wcore_mssql|wcore_mysql|wcore_mysqli|wcore_oci 返回操作数据的对象 */ public static function &db($name = '') { /** * 判断数据库连接是否已生成数组连接池,是则定位到要调用的连接对象 */ if (isset(self::$_db[$name])) { return self::$_db[$name]; //数据连接从连接池数组当中取 } /** * 生成数据连接数组池 */ $db_servers = json_decode(DB_SERVERS, true); foreach ($db_servers as $k => $v) { if ($k != $name) { continue; //若$name不为空就只注册连接需要打开的数据库对象 } switch (strtolower($v['dbtype'])) { case 'mysqli': $db = new wcore_mysqli($v['host'], $v['user'], $v['pwd'], $v['dbname'], $v['charset'], $v['port'], $v['pconnect']); break; case 'oci': $db = new wcore_oci($v['host'], $v['user'], $v['pwd'], $v['dbname'], $v['charset'], $v['port'], $v['pconnect']); break; case 'mssql': $db = new wcore_mssql($v['host'], $v['user'], $v['pwd'], $v['dbname'], $v['charset'], $v['port'], $v['pconnect']); break; default: $db = new wcore_mysql($v['host'], $v['user'], $v['pwd'], $v['dbname'], $v['charset'], $v['port'], $v['pconnect']); break; } self::$_db[$k] = $db; return $db; } exit("System can't connect '{$name}' connection name objects."); } /** * 操作MEMCACHED库接口 * * @return wcore_mem 返回操作数据的对象 */ public static function &mem() { if (is_object(self::$_mem)) { return self::$_mem; } $mem_servers = json_decode(MEM_SERVERS, true); self::$_mem = new wcore_mem($mem_servers, MEM_PORT, MEM_USE, MEM_EXPIRE, MEM_PREFIX); return self::$_mem; } /** * 操作Smarty库接口 * * @return Smarty 返回操作Smarty的对象 */ public static function &smarty() { if (is_object(self::$_smarty)) { return self::$_smarty; } require(DIR_ROOT . '/smarty/Smarty.class.php'); $site_theme = get_site_theme(); //获取站点模板主题 $doc_root = get_doc_root_name(); //获取站点目录名称 /** * SMARTY 缓冲目录 */ $smarty_cache_dir = SMARTY_CACHE_DIR . "{$doc_root}/{$site_theme}"; if (!file_exists($smarty_cache_dir)) { @mkdir($smarty_cache_dir, 0777, true); } /** * SMARTY 模板目录 */ $smarty_template_dir = DIR_ROOT . "/{$doc_root}/site/{$site_theme}"; if (!file_exists($smarty_template_dir)) { @mkdir($smarty_template_dir, 0777, true); } /** * SMARTY 编译目录 */ $smarty_compile_dir = SMARTY_COMPILE_DIR . "{$doc_root}/{$site_theme}"; if (!file_exists($smarty_compile_dir)) { @mkdir($smarty_compile_dir, 0777, true); } self::$_smarty = new Smarty(); self::$_smarty->caching = SMARTY_CACHE; self::$_smarty->debugging = SMARTY_DEBUGGING; self::$_smarty->cache_lifetime = SMARTY_CACHE_LIFETIME; self::$_smarty->cache_dir = $smarty_cache_dir; self::$_smarty->template_dir = $smarty_template_dir; self::$_smarty->compile_dir = $smarty_compile_dir; self::$_smarty->left_delimiter = SMARTY_LEFT_DELIMITER; self::$_smarty->right_delimiter = SMARTY_RIGHT_DELIMITER; return self::$_smarty; } /** * 选择或检查数据连接是否已加载,若没有加载则马上加载 * * @param string $tname 操作表名 * @param string $lname 连接名称(master|slave) * @return modules_dbase */ public static function &dbase($tname, $lname = '') { static $dbase_cls = null; if (!isset($dbase_cls[$lname])) { $dbase_cls[$lname] = new modules_dbase(); $dbase_cls[$lname]->select_db_link($lname); } $dbase_cls[$lname]->_opt = $tname; return $dbase_cls[$lname]; } /** * 主数据库连接操作(可写可读) * * @return wcore_mysql 返回操作数据的对象 */ public static function mdb() { static $_db = null; if (is_null($_db)) { $_db = wcore_object::db('master'); } return $_db; } /** * 从数据库连接操作(只读) * * @return wcore_mysql 返回操作数据的对象 */ public static function sdb() { static $_db = null; if (is_null($_db)) { $_db = wcore_object::db('slave'); } return $_db; } } ?>
- 上一篇:PHP SMTP邮件发送类,支持SSL连接
- 下一篇:zend framework
精彩图集
精彩文章