OpenCart-Hellas 

Η Ελληνική κοινότητα υποστήριξης του Opencart

Θέματα που αφορούν τη γενικότερη λειτουργία του Opencart.
Από dimitris212
#5512
Καλησπέρα σας, στην έκδοση 3.0.2.0 κατά καιρούς παίρνω pop up με τα παρακάτω σφάλματα.
Έχετε ιδέα τι μπορεί να φταίει?


2018-11-27 14:47:23 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543333643): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-11-29 11:23:37 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.geo_zone.1543490607): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 17
2018-11-29 11:25:32 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543494332): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-11-29 11:32:58 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543494778): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-11-29 12:03:26 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543496606): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-11-29 12:15:26 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543497326): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-11-29 12:18:07 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543497487): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-12-01 12:56:51 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543672611): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
2018-12-01 12:58:58 - PHP Warning: unlink(/home/xxxxxxxx/domain.gr/storage/cache/cache.catalog.language.1543672738): No such file or directory in /home/xxxxxxxx/domain.gr/system/library/cache/file.php on line 68
Άβαταρ μέλους
Από Alexandra
#5513
Καλησπέρα, αυτό είναι bug και υπάρχει σε όλες τις εκδόσεις αλλά δεν δημιουργεί πρόβλημα πέρα από το ότι γεμίζει σιγά σιγά τα error logs.

Μία πρόχειρη λύση είναι να ορίσεις στην PHP όποτε προκύπτει σφάλμα στο unlink να μην πετάει error.

Δοκίμασε στο αρχείο: system/library/cache/file.php

το:
Κώδικας: Επιλογή όλων
unlink($file);
κάνε το
Κώδικας: Επιλογή όλων
@unlink($file);
Από dimitris212
#5514
Βασικά υπάρχει πρόβλημα με αυτό το pop up γιατί το έχω πετύχει 2 3 φορές στην checkout σελίδα οπότε δεν ξέρω αν ο χρήστης πατήσει το οκ και συνεχίσει ή αν κλείσει τον browser.

Πες μου μία και στην σειρά 33 και στην 135 κάνω την αλλαγή ?
Κώδικας: Επιλογή όλων
<?php

namespace Cache;

class File {

	private $expire;



	public function __construct($expire = 3600) {

		$this->expire = $expire;



		$files = glob(DIR_CACHE . 'cache.*');



		if ($files) {

			foreach ($files as $file) {

				$time = substr(strrchr($file, '.'), 1);



				if ($time < time()) {

					if (file_exists($file)) {

						unlink($file);

					}

				}

			}

		}

	}



	public function get($key) {

		$files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');



		if ($files) {

			$handle = fopen($files[0], 'r');



			flock($handle, LOCK_SH);



			$data = fread($handle, filesize($files[0]));



			flock($handle, LOCK_UN);



			fclose($handle);



			return json_decode($data, true);

		}



		return false;

	}



	public function set($key, $value) {

		$this->delete($key);



		$file = DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.' . (time() + $this->expire);



		$handle = fopen($file, 'w');



		flock($handle, LOCK_EX);



		fwrite($handle, json_encode($value));



		fflush($handle);



		flock($handle, LOCK_UN);



		fclose($handle);

	}



	public function delete($key) {

		$files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');



		if ($files) {

			foreach ($files as $file) {

				if (file_exists($file)) {

					unlink($file);

				}

			}

		}

	}

}
Άβαταρ μέλους
Από Alexandra
#5515
Ναι κάντο και στα δύο,

Tο checkout είναι άλλη περίπτωση και έχει να κάνει με την εμφάνιση σφαλμάτων των Ajax calls που κάνει η javascript στην PHP. Το checkout -ειδικά τα quick chekcout- είναι πολύπλοκη διαδικασία και είναι σχεδόν αδύνατον να προβλέψεις όλες τις πιθανές κινήσεις του πελάτη σε όλες τις πιθανές συσκευές και browsers.
Από dimitris212
#5521
Σε ευχαριστώ πολύ το έκανα στο file και θα δούμε αν γλυτώσαμε!

Δεν γνωρίζω πως γίνετε αυτό που θέλεις να κάνεις α[…]

Σας ευχαριστώ πολύ για την απάντηση, σκεφτείτε η ε[…]

Έλεγξε αν έχεις πολύ μεγάλα αρχεία εικόνων και αν […]

Κάνε ένα restart τον σερβερ. (βασικα την λειτουργι[…]

Πριν ζητήσετε βοήθεια στο φόρουμ, παρακαλούμε ελέγξτε αν υπάρχει έτοιμη λύση στο OpenCart Extension Marketplace!