<?php
class ControllerToolLitespeedCache extends Controller{

    public function index()
    {

        //die();
        $this->load->model('catalog/category');
        $categories = $this->db->query("SELECT * FROM ps_category ")->rows;

        $urls = array();
        foreach ($categories as $category){
            $urls[] = $this->url->link('product/category', 'path=' . $category['category_id']);
        }
        flush();
        echo '--';
        foreach ($urls as $key => $url){

            $ch = curl_init($url);
            //curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            //curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
            $results = curl_exec($ch);

            curl_close($ch);

            flush();
            echo $url . '<br>'; die();

        }

        echo '-- Done';



    }

}