* @param bool $lock * @return int */ public function put(string $path, $contents, $lock = false) { return file_put_contents($path, $contents, $lock ? LOCK_EX : 0); } /** * Write the contents of a file, replacing it atomically if it already exists. * @param string $path //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 bool $lock * @return int */ public function put(string $path, $contents, $lock = false) { return file_put_contents($path, $contents, $lock ? LOCK_EX : 0); } /** * Write the contents of a file, replacing it atomically if it already exists. * @param string $path $this->ensureCacheDirectoryExists($path = $this->path($key)); $result = $this->files->put( $path, $this->expiration($seconds) . serialize($value), true ); if ($result !== false && $result > 0) { $this->ensureFileHasCorrectPermissions($path); * @param mixed $value * @return bool */ public function forever($key, $value): bool { return $this->put($key, $value, 0); } /** * Remove an item from the cache. * @param string $key * @param mixed $value * @return bool */ public function forever($key, $value) { $result = $this->store->forever($this->itemKey($key), $value); if ($result) { event(new CacheWritten($key, $value)); } if (is_array($key)) { return $this->putMany($key, $value); } if ($ttl === null) { return $this->forever($key, $value); } $seconds = $this->getSeconds($ttl); if ($seconds <= 0) { // given number of seconds so it's available for all subsequent requests. if (!is_null($value)) { return $value; } $this->put($key, $value = $callback(), $ttl); return $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_query_products_info($listing_sql, $limit = 10){ global $languages_id, $customer_price, $listing_add_fields, $spec_array, $all_pids; $all_pids = tep_get_all_sql_products_ids($listing_sql); if (!empty($all_pids)) { $specials = getSpecials($all_pids); $specialPrices = []; foreach ($specials as $special) { AND p2c.categories_id = '" . (int)$current_category_id . "' ORDER BY " . $order_by . " " . 'LIMIT ' . ($tpl_settings['limit'] ? (int)$tpl_settings['limit'] : 10);// split query to 2 small queries: 1) find all products ids, 2) get info for each product$drugie_query = tep_get_query_products_info($listing_sql, $tpl_settings['limit']);$drugie = tep_db_query($drugie_query);if (!empty($drugie)) { $salemakers_array = get_salemakers($drugie); tep_db_data_seek($drugie, 0); } require_once DIR_WS_EXT . "last_viewed_products/last_viewed_products.php"; } break; case 'P_DRUGIE': include(DIR_WS_MODULES . 'drugie.php'); break; case 'P_XSELL': if (is_file(DIR_WS_EXT . 'xsell_products_buynow/' . FILENAME_XSELL_PRODUCTS)) { require_once DIR_WS_EXT . 'xsell_products_buynow/' . FILENAME_XSELL_PRODUCTS; } <?php echo $breadcrumb->trail(' '); ?> <!-- END BREADCRUMBS --> <!-- CONTENT --> <?php if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/content/' . $content . '.tpl.php')) { require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/content/' . $content . '.tpl.php'); // content from current template (if exists) } else { require(DIR_WS_CONTENT . $content . '.tpl.php'); // content from default template } ?> <!-- END CONTENT --> }} else { http_response_code(404); $content = CONTENT_ERROR_404;}require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);require(DIR_WS_INCLUDES . 'application_bottom.php');|
ErrorException
|
|---|
ErrorException:
file_put_contents(/mnt/test_sites/sites_new/wellcraft.com.ua/storage/cache/all_sql_products_ids/all_sql_products_ids$_d8bdf65f3e6804ca4b8900e218ce38c3): failed to open stream: No such file or directory
at /home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:140
at Bootstrap\HandleExceptions->handleError()
(/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
at file_put_contents()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Filesystem/Filesystem.php:140)
at App\Classes\Filesystem\Filesystem->put()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:64)
at App\Classes\Cache\Store\FileStore->put()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Store/FileStore.php:131)
at App\Classes\Cache\Store\FileStore->forever()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:301)
at App\Classes\Cache\Repository->forever()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:160)
at App\Classes\Cache\Repository->put()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Repository.php:328)
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:85)
at tep_get_query_products_info()
(/home/solomono/web/solomono.net/sites/demo/includes/modules/drugie.php:31)
at include('/home/solomono/web/solomono.net/sites/demo/includes/modules/drugie.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/product_info.tpl.php:412)
at require('/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/product_info.tpl.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/main_page.tpl.php:121)
at require('/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/main_page.tpl.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/product_info.php:338)
|
if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { return false; } } return rmdir($dir);}function logToFile($path, $data = ['']){ //check argument //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); }); if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { return false; } } return rmdir($dir);}function logToFile($path, $data = ['']){ //check argument public static function forgetByPrefix(string $keyPrefix): bool { $result = false; $keyPrefix = str_replace(self::PREFIX_END, '', $keyPrefix); $path = self::getDirectory(); if (!file_exists($path . '/' . $keyPrefix) || deleteDirectory($path . '/' . $keyPrefix)) { $result = true; } return $result; } public static function forgetByPrefixMultiple(array $keyPrefixes): bool { $result = true; foreach ($keyPrefixes as $keyPrefix) { $result &= self::forgetByPrefix($keyPrefix); } return (bool)$result; } public static function forgetByTableName(string $tableName): bool } public static function forgetByTableNames(array $tablesNames): bool { $filesKeys = self::collectKeysByTableNames($tablesNames); return self::forgetByPrefixMultiple($filesKeys); } //collect keys of file caches public static function collectKeysByTableName(string $tableName): array { } //forget cache by tables names if ($cache_queries && !empty($tables) && $action && in_array($action, ['insert', 'update', 'insertodku', 'delete'])) { $tables = is_array($tables) ? $tables : [$tables]; FileCacheHelper::forgetByTableNames($tables); } $parseTime = round((microtime(true) - $start), 2); $alert_execution_time = (defined('ALERT_QUERY_EXECUTION_TIME_FRONT') && ALERT_QUERY_EXECUTION_TIME_FRONT > 0) if (!empty($listing['products_url'])) { $product_href = $listing['products_url']; // if "products_url" is set, show link without DB query to get names } else { $products_url = $seo_urls->strip($product_name); $products_url = str_replace('p-','p',$products_url); //fix bug with get product ID when url like /p-some-text/p-123.html tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_url = '" . $products_url . "' where language_id = '" . $languages_id . "' and products_id = '" . tep_db_input($id) . "'",TABLE_PRODUCTS_DESCRIPTION,'update'); $product_href = $products_url ?: '-'; // if "products_url" empty, then get name from DB } $product_href = getCPathUrlPart($id) . preg_replace('|' . $catalog_path . '|i', '', $product_href); if (!empty($listing['products_image'])) { $tpl_settings = $currenModuleSettings; $tpl_settings['request'] = $drugie; $tpl_settings['title'] = getConstantValue('PROD_DRUGIE'); getArrayWithAllAttributes(); include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL); }} } require_once DIR_WS_EXT . "last_viewed_products/last_viewed_products.php"; } break; case 'P_DRUGIE': include(DIR_WS_MODULES . 'drugie.php'); break; case 'P_XSELL': if (is_file(DIR_WS_EXT . 'xsell_products_buynow/' . FILENAME_XSELL_PRODUCTS)) { require_once DIR_WS_EXT . 'xsell_products_buynow/' . FILENAME_XSELL_PRODUCTS; } <?php echo $breadcrumb->trail(' '); ?> <!-- END BREADCRUMBS --> <!-- CONTENT --> <?php if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/content/' . $content . '.tpl.php')) { require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/content/' . $content . '.tpl.php'); // content from current template (if exists) } else { require(DIR_WS_CONTENT . $content . '.tpl.php'); // content from default template } ?> <!-- END CONTENT --> }} else { http_response_code(404); $content = CONTENT_ERROR_404;}require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);require(DIR_WS_INCLUDES . 'application_bottom.php');|
ErrorException
|
|---|
ErrorException:
rmdir(/mnt/test_sites/sites_new/wellcraft.com.ua/storage/cache/all_sql_products_ids): No such file or directory
at /home/solomono/web/solomono.net/sites/demo/includes/functions/files_functions.php:160
at Bootstrap\HandleExceptions->handleError()
(/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
at rmdir()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/files_functions.php:160)
at deleteDirectory()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Helpers/FileCacheHelper.php:236)
at App\Classes\Cache\Helpers\FileCacheHelper::forgetByPrefix()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Helpers/FileCacheHelper.php:247)
at App\Classes\Cache\Helpers\FileCacheHelper::forgetByPrefixMultiple()
(/home/solomono/web/solomono.net/sites/demo/app/Classes/Cache/Helpers/FileCacheHelper.php:261)
at App\Classes\Cache\Helpers\FileCacheHelper::forgetByTableNames()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/database.php:99)
at tep_db_query()
(/home/solomono/web/solomono.net/sites/demo/includes/modules/product_listing_col.php:292)
at include('/home/solomono/web/solomono.net/sites/demo/includes/modules/product_listing_col.php')
(/home/solomono/web/solomono.net/sites/demo/includes/modules/drugie.php:44)
at include('/home/solomono/web/solomono.net/sites/demo/includes/modules/drugie.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/product_info.tpl.php:412)
at require('/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/product_info.tpl.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/main_page.tpl.php:121)
at require('/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/main_page.tpl.php')
(/mnt/test_sites/sites_new/wellcraft.com.ua/product_info.php:338)
|