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): Directory not empty
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)
|
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)
|