on OpenCart 2.3.0.2 work perfect
on OpenCart 3.0.3.x work, but with problem: not login to customer account at front-end
anybody know what differences with customer/login libraries between OpenCart 2.3 and 3.0?
Code: Select all
<?php
namespace Cache;
class Null {
private $cache;
// public function __construct($expire) {}
public function __construct($expire) {
$this->expire = $expire;
------------
// public function set($key, $value) {
// return true;
// }
public function set($key,$value) {
$status = $this->cache->set($key, json_encode($value);
if($status){
$this->cache->$key, $this->expire);
}
return $status;
}
------------
// public function get($key) {
// return false;
// }
public function get($key) {
$data = $this->cache->get($key);
return json_decode($data, true);
}
------------
// public function delete($key) {
// return false;
// }
//}
public function delete($key) {
$this->cache->delete($key);
}
}
the Fellow, who created the original, about a possible upgrade, or be
willing to pay somebody for the Job done.
Good Luck!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
thanks for answer.
but I not use null.php, only mysqli_memcached.php
and OpenCart not accept Null class, only when I rename Null to NoCache, but I not use it.
I use memcached or redis cache.
question about mysqli_memcached.php
on OpenCart 2.3.0.2
db_engine = mysqli_memcached
cache_engine = memcached
all work! site "fly"! and customer can login to account.
on OpenCart 3.0.3.1
db_engine = mysqli_memcached
cache_engine = memcached
site "fly" but customer cannot login to account
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I try compare system/library/cart/customer.php from 2.3.0.2 and 3.0.3.2 and one difference is:straightlight wrote: ↑Fri Nov 01, 2019 9:24 pmThe customer cannot login into his account since the system/library/cart/customer.php file login method uses database password validation functions as opposed to the cache compared to the previous OC versions as well.
2.3.0.2
Code: Select all
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
Code: Select all
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1'");
OpenCart 3.0 not contain column approved in customer table.
may be verification password in database in other library?
may be in password.php?
2.3.0.2
Code: Select all
if ((utf8_strlen($this->request->post['password']) < 4) || (utf8_strlen($this->request->post['password']) > 20))
Code: Select all
if ((utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) < 4) || (utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) > 40))
also find this thread viewtopic.php?f=201&t=202589#p715995
all same like in it
customer can register
but after logout cannot login again.
sometimes after 10-15 attempts login successfull.
Code: Select all
$select_id = (0 <= stripos($sql, 'SELECT') && !stripos($sql, 'FROM ' . DB_PREFIX . 'cart')) ? sha1($sql) : false;
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
exclude customer table not solve problem.
now even only product_id in query
Code: Select all
$select_id = (0 <= stripos($sql, 'SELECT p.product_id, (SELECT AVG(rating)') ) ? sha1($sql) : false;
where and what yet can finding?
why not make it better by giving the class construct parameters like an array with tables to exclude and/or tables to include and/or tables update/inserts which invalidate the cache?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I only for make better!!!
but …. on OpenCart 3.0 customer cannot login (can register)
on OpenCart 2.3.0.2 mysqli_memcahed work "from box" and customer can register and login.
I can provide full access to my test site https://www.computersystems.fun - if you want to help solve problem.
(clean install of OpenCart 3.0.3.2 + mysqli_memcahed driver )
but add to cart also does not work on https://www.computersystems.fun
which is no surprise, like I said, it caches all selects except those that have a "FROM [prefix].cart" in it, of course that makes the site "fly", just not for very long...
What about the session table???
So perhaps make an inventory first of all selects in V3 and see which are eligible to be cached and which are not.
Then do the same for all table modify queries and determine which should make the cache invalid.
include those findings in the class.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
now in driver I replace !!!!
Code: Select all
$select_id = (0 <= stripos($sql, 'SELECT') && !stripos($sql, 'FROM ' . DB_PREFIX . 'cart')) ? sha1($sql) : false;
Code: Select all
$select_id = (0 <= stripos($sql, 'SELECT p.product_id, (SELECT AVG(rating)') ) ? sha1($sql) : false;
P.S. site now "fly" because
- ssd hosting
- Opcache (Zend Optmizer) enabled
- memcached used like cache engine
really "fly" working project https://www.fancies.com.ua/ OpenCart 2.3.0.2 amd mysqli_memcached enabled
what see in session table?
all logins in session table
Code: Select all
session_id data expire
e78e9afb01c48279ca3687234f {"language":"en-gb","currency":"USD"} 2019-11-01 10:54:50
e7ecc1369bef3ab12fe88cd03a {"language":"en-gb","currency":"USD"} 2019-11-02 20:58:53
e8a0962ccd21cdf6bbf777e5a1 {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:33
ea282a484c87612d80ef42c685 {"language":"en-gb","currency":"USD"} 2019-11-02 13:34:43
eea8442b308b43fa43b87a0050 {"language":"en-gb","currency":"USD"} 2019-11-02 20:58:59
f14b30c7730f40cfcb5fb4fcdc {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:35
f2067f8f336cb0ecd480501080 {"language":"en-gb","currency":"USD"} 2019-11-02 20:59:00
f3101fd15dd48e15e7964bc900 {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:34
f52916a08345a7d322cb996546 {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:40
f83dbb730d2955fb49ab8775bb {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:38
f8b7fb185f6d77235602e688de {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:30
fc608d50c269b8f69518b4a013 {"language":"en-gb","currency":"USD"} 2019-11-02 20:58:56
fcbeb9dd8c174d3224ab56430f {"language":"en-gb","currency":"USD"} 2019-11-02 17:20:32
fefd4918fdb15871935840205f {"language":"en-gb","currency":"USD"} 2019-11-02 13:27:59
ff4ce17623b70e9211ec2f9825 {"language":"en-gb","currency":"USD"} 2019-11-02 20:58:57
I use sql prepared statements on the product table, also helps for multiple product queries like category, sitemap and search pages, really neat.
I would say, instead of defining in the driver which queries you can cache, define which you cannot cache.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
use:
Code: Select all
if ($select_id && false !== $data = $this->_memcached->get($select_id)) {
error_log('memcached: '.$sql);
[rest of code]
Maybe it are the queries used in the customer.php class or maybe the caching of queries on the session table if you use table for sessions.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
If you cannot, the problem is also elsewhere (it might also be the queries).
If you can, it are the cached queries for sure.
Code: Select all
$select_id = (0 <= stripos($sql, 'SELECT') && !stripos($sql, 'FROM ' . DB_PREFIX . 'cart')) ? sha1($sql) : false;
$select_id = false;
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
error_log('memcached: '.$sql); addedletxobnav wrote: ↑Mon Nov 04, 2019 9:42 am
use:
Code: Select all
if ($select_id && false !== $data = $this->_memcached->get($select_id)) { error_log('memcached: '.$sql); [rest of code]
but
Code: Select all
2019-11-04 16:00:29 - PHP Notice: Undefined property: DB\MySQLi_Memcached::$load in /home/priazhas/computersystems.fun/www/system/library/db/mysqli_memcached.php on line 53
addedletxobnav wrote: ↑Mon Nov 04, 2019 10:38 pmCode: Select all
$select_id = (0 <= stripos($sql, 'SELECT') && !stripos($sql, 'FROM ' . DB_PREFIX . 'cart')) ? sha1($sql) : false; $select_id = false;
$select_id = false;
customer can login.
products can add to cart
Users browsing this forum: No registered users and 175 guests