如何从CLI设置Joomshopping Google Shopping / Yandex Market URL导出?

时间:2017-10-09 23:16:49

标签: php url joomla joomla3.0

JShopping将SEFLink函数用于漂亮的URL,但它似乎与从CLI运行不兼容。它抛出“Application Instantiation Error”。

那么我怎样才能从CLI获得正确的SEO友好网址?

这是整个Joomla cron,没有上面的所有包含/要求。 崩溃发生在SEFLink中的JFactory :: getApplication()中,或者如果你在getDefaultItemid()中删除它。

class JshopProductExport extends JApplicationCli
{
    public function __construct()
    {
        parent::__construct();
    }
    public function doExecute()
    {
        if (!file_exists(JPATH_SITE.'/components/com_jshopping/jshopping.php')){
            echo "Please install component \"joomshopping\"\n";
        }
        require_once (JPATH_SITE.'/components/com_jshopping/lib/factory.php'); 
        require_once (JPATH_SITE.'/components/com_jshopping/lib/functions.php');

        $sefLink = SEFLink('index.php?option=com_jshopping&controller=product&task=view&category_id=1&product_id=1', 0, 0, null);
    }
}

try
{
    JApplicationCli::getInstance('JshopProductExport')->execute();
}
catch (Exception $e)
{
    var_dump($e);
    exit($e->getCode());
}

0 个答案:

没有答案