runQuery( "SELECT * FROM product_categories", [] ); } /** (re-) cacheCategoryByUrl( url ) * regenerate cache of a category_product * by category's friendly url * @param $url (string): the category's friendly url */ public static function cacheCategoryByUrl(string $url) { // Only Cli interface is allowed if (php_sapi_name() != 'cli') return false; # PROXY call: # MARKET \ ProductCategories_model::tree(): # + Refresh Cache # -------------------------------------- $reply = proxy( [\app\models\market\ProductCategories_model::class, 'categoryFromUrl'], [ $url ], \CACHE_CATEGORY_TTL, \PROXY_IGNORE_CACHE ); echo ($reply == false) ? textColor("Failed\n", \FAIL) : textColor("Done!\n", \SUCCESS); } }