* @param string $path * @return int */ public function size($path) { return filesize($path); } public function humanFilesize($bytes, $decimals = 2) { $sz = 'BKMGTP'; //ini_set('error_log' , '/home/solomono/web/solomono.net/sites/dev/php.log'); error_reporting(E_ALL); set_error_handler(function ($level, $message, $file = '', $line = 0) { $this->handleError($level, $message, $file, $line); }); set_exception_handler(function ($e) { $this->handleException($e); }); * @param string $path * @return int */ public function size($path) { return filesize($path); } public function humanFilesize($bytes, $decimals = 2) { $sz = 'BKMGTP'; $handle = fopen($path, 'rb'); if ($handle) { // try { if (flock($handle, LOCK_SH)) { clearstatcache(true, $path); $contents = fread($handle, $this->size($path) ?: 1); flock($handle, LOCK_UN); } // } finally { // fclose($handle); // } * @throws Exception */ public function get(string $path, bool $lock = false) { if ($this->isFile($path) && file_exists($path)) { return $lock ? $this->sharedGet($path) : file_get_contents($path); } throw new Exception("File does not exist at path {$path}"); } /** // If the file doesn't exist, we obviously cannot return the cache so we will // just return null. Otherwise, we'll get the contents of the file and get // the expiration UNIX timestamps from the start of the file's contents. try { $expire = substr( $contents = $this->files->get($path, true), 0, 10 ); } catch (Exception $e) { return $this->emptyPayload(); * Retrieve an item from the cache by key. * @param string|array $key */ public function get($key) { return $this->getPayload($key)['data'] ?? null; } /** * Store an item in the cache for a given number of seconds. * @param string $key { if (is_array($key)) { return $this->many($key); } $value = $this->store->get($this->itemKey($key)); // If we could not find the cache value, we will fire the missed event and get // the default value for this cache value. This default could be a callback // so we will execute the value function which will resolve it if needed. if (is_null($value)) { * @param Closure $callback * @return mixed */ public function remember($key, $ttl, Closure $callback) { $value = $this->get($key); // If the item exists in the cache we will just return this immediately and if // not we will execute the given Closure and cache the result of that for a // given number of seconds so it's available for all subsequent requests. if (!is_null($value)) { try { if ($isCacheEnabled) { return self::getRepository() ->remember( $key, $ttl, $closure ); } else { return $closure(); FileCacheHelper::ALL_SQL_PRODUCTS_IDS_KEY . '_' . md5($listing_sql), fn() => array_column( tep_db_query($listing_sql)->fetch_all(MYSQLI_ASSOC), 'products_id' ), null );}function tep_get_all_pids_price_exclude($listing_sql, $excluded_statement){function tep_get_all_pids_price_exclude($listing_sql, $excluded_statement){ $cleared_listing_sql = str_replace($excluded_statement, '', $listing_sql); return tep_get_all_sql_products_ids($cleared_listing_sql);}function tep_get_query_products_info($listing_sql, $limit = 10){ global $languages_id, $customer_price, $listing_add_fields, $spec_array, $all_pids;// Safely use str_replace $pids_filter_excluded = tep_get_all_pids_price_exclude($listing_sql, str_replace($price_filter_statement, '', $where_filters)) ?: [0]; //products ids for attributes $where_attr = !empty($manFilter) ? str_replace($manFilter, '', $where_filters) : $where_filters; $pids_filter_attr_axcluded = tep_get_all_pids_price_exclude($listing_sql, str_replace($price_filter_statement, '', $where_attr)) ?: []; // define how much products to show on page $row_by_page = 10; if (!empty($_GET['row_by_page'])) {|
ErrorException
|
|---|
ErrorException:
filesize(): stat failed for /mnt/test_sites/sites_new/wellcraft.com.ua/storage/cache/all_sql_products_ids/all_sql_products_ids$_ffe57e6595fe30658152887bf9c5ffc5
at /home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:339
at Bootstrap\HandleExceptions->handleError()
(/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
at filesize()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:339)
at App\Classes\Filesystem\Filesystem->size()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:55)
at App\Classes\Filesystem\Filesystem->sharedGet()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:38)
at App\Classes\Filesystem\Filesystem->get()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:185)
at App\Classes\Cache\Store\FileStore->getPayload()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:48)
at App\Classes\Cache\Store\FileStore->get()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:65)
at App\Classes\Cache\Repository->get()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:319)
at App\Classes\Cache\Repository->remember()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Helpers/FileCacheHelper.php:186)
at App\Classes\Cache\Helpers\FileCacheHelper::remember()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/general.php:70)
at tep_get_all_sql_products_ids()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/general.php:78)
at tep_get_all_pids_price_exclude()
(/mnt/test_sites/sites_new/wellcraft.com.ua/index.php:339)
|