Php Magento-从浏览器运行Shell脚本?

Php Magento-从浏览器运行Shell脚本?,php,shell,magento,Php,Shell,Magento,下页第6点介绍了如何使用脚本导入数据: 问题是该示例提供了一个shell脚本,因此在尝试从浏览器运行此脚本时出错。在我没有访问Shell的权限的情况下,有什么方法可以将这些类型的脚本作为浏览器运行吗?我找到了解决方案。只需要注释掉/shell/abstract.php中受保护函数的内容 在下方添加一行 protected $_factory; // Line 76 as protected $_passvalidation = false; 然后改变函数uu构造() 至 if(!$this

下页第6点介绍了如何使用脚本导入数据:


问题是该示例提供了一个shell脚本,因此在尝试从浏览器运行此脚本时出错。在我没有访问Shell的权限的情况下,有什么方法可以将这些类型的脚本作为浏览器运行吗?

我找到了解决方案。只需要注释掉/shell/abstract.php中受保护函数的内容 在下方添加一行

protected $_factory; // Line 76
as

protected $_passvalidation = false;
然后改变函数uu构造()

if(!$this->_passvalidation) $this->_validate();
在shell脚本中添加

function __construct() {
    $this->_passvalidation = true;
    parent::__construct();
}

它使用shell来执行一个php文件。您还应该能够通过web请求触发文件的执行。也许您需要调整参数处理。当我从浏览器尝试时,我得到一个错误:“此脚本无法从浏览器运行。这是shell脚本。”显然,这是Magento中的安全措施。
function __construct() {
    $this->_passvalidation = true;
    parent::__construct();
}