22
33namespace WP2Static ;
44
5- class CrawlCache {
5+ class CrawledFiles {
66
77 public static function createTable (): void {
88 global $ wpdb ;
@@ -56,7 +56,7 @@ public static function createTable(): void {
5656 }
5757
5858 /**
59- * Get all Crawl Cache path hashes
59+ * Get all crawled file path hashes
6060 *
6161 * @return string[]
6262 */
@@ -72,7 +72,7 @@ public static function getHashes(): array {
7272 }
7373
7474 public static function getTableName (): string {
75- return Controller::getTableName ( 'crawl_cache ' );
75+ return Controller::getTableName ( 'crawled_files ' );
7676 }
7777
7878 /**
@@ -127,7 +127,7 @@ public static function addPathsIter( \Iterator $paths ): \Iterator {
127127 $ result = $ wpdb ->query ( $ wpdb ->prepare ( $ sql , ...$ values ) );
128128
129129 if ( false === $ result ) {
130- WsLog::w ( 'Error inserting into crawl cache : ' . $ wpdb ->last_error );
130+ WsLog::w ( 'Error inserting into crawled files : ' . $ wpdb ->last_error );
131131 }
132132
133133 foreach ( $ paths as $ path ) {
@@ -184,7 +184,7 @@ public static function getPathsIter(): \Iterator {
184184 }
185185
186186 /**
187- * Remove 404 URLs from the detected files, crawl cache , and
187+ * Remove 404 URLs from the detected files, crawled files , and
188188 * files written to disk.
189189 */
190190 public static function remove404s ( \Iterator $ paths ): \Iterator {
@@ -298,7 +298,7 @@ public static function getUrl( string $path, string $content_hash ): string {
298298 }
299299
300300 /**
301- * Get all paths in CrawlCache
301+ * Get all crawled files
302302 *
303303 * @return object[] {
304304 * All crawlable paths
@@ -358,26 +358,26 @@ public static function rmUrlsById( array $ids ): void {
358358 }
359359
360360 /**
361- * Clear CrawlCache via truncation
361+ * Clear crawled files via truncation
362362 */
363363 public static function truncate (): void {
364- WsLog::l ( 'Deleting CrawlCache ' );
364+ WsLog::l ( 'Deleting crawled files ' );
365365
366366 global $ wpdb ;
367367
368368 $ table_name = self ::getTableName ();
369369
370370 $ wpdb ->query ( "TRUNCATE TABLE $ table_name " );
371371
372- $ totalcrawl_cache = self ::getTotal ();
372+ $ total_crawled_files = self ::getTotal ();
373373
374- if ( $ totalcrawl_cache > 0 ) {
375- WsLog::l ( 'Failed to truncate CrawlCache : try deleting instead ' );
374+ if ( $ total_crawled_files > 0 ) {
375+ WsLog::l ( 'Failed to truncate crawled files : try deleting instead ' );
376376 }
377377 }
378378
379379 /**
380- * Count URLs in Crawl Cache
380+ * Count crawled files
381381 */
382382 public static function getTotal (): int {
383383 global $ wpdb ;
0 commit comments