if (!file_exists($dir)) { return true; } if (!is_dir($dir)) { return unlink($dir); } foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') { continue; //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 (!file_exists($dir)) { return true; } if (!is_dir($dir)) { return unlink($dir); } foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') { continue; foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') { continue; } if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { return false; } } return rmdir($dir); 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'])) { </div> <?php } endif; ?> <div id="block"> <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL); // products listing ?> </div> <?php if (isset($seoFilterInfo) && $seoFilterInfo) { $desc_text = $seoFilterInfo['description']; } elseif (is_array($searchResultsQuery) && $searchResultsQuery["seo_text"]) { <?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 -->}if (isset($_SERVER['HTTP_X_REQUESTED_WITH'] ) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL);} else { require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);}require(DIR_WS_INCLUDES . 'application_bottom.php');|
ErrorException
|
|---|
ErrorException:
unlink(/mnt/test_sites/sites_new/wellcraft.com.ua/storage/cache/all_sql_products_ids/all_sql_products_ids$_5f6f7994b4cb76dd463100af7dcc6e65): No such file or directory
at /home/solomono/web/solomono.net/sites/demo/includes/functions/files_functions.php:147
at Bootstrap\HandleExceptions->handleError()
(/home/solomono/web/solomono.net/sites/demo/bootstrap/HandleExceptions.php:32)
at Bootstrap\HandleExceptions->Bootstrap\{closure}()
at unlink()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/files_functions.php:147)
at deleteDirectory()
(/home/solomono/web/solomono.net/sites/demo/includes/functions/files_functions.php:155)
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')
(/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/index_products.tpl.php:125)
at require('/mnt/test_sites/sites_new/wellcraft.com.ua/templates/default/content/index_products.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/index.php:512)
|