Magento:使用Magento之外的安装模型

Magento:使用Magento之外的安装模型,magento,Magento,可以使用Magento之外的Mage\u目录\u模型\u资源\u Eav\u Mysql4\u设置 require_once "app/Mage.php"; Mage::app(); //Use the setup model 我想使用属性功能(addAttribute()等)。是的,就像在Magento中一样: require_once 'app/Mage.php'; Mage::init(); $setup = Mage::getResourceModel('catalog/setup

可以使用Magento之外的
Mage\u目录\u模型\u资源\u Eav\u Mysql4\u设置

require_once "app/Mage.php";
Mage::app();

//Use the setup model

我想使用属性功能(addAttribute()等)。

是的,就像在Magento中一样:

require_once 'app/Mage.php';
Mage::init();

$setup = Mage::getResourceModel('catalog/setup', 'core_setup');
$setup->addAttribute(...);

是的,就像你在Magento那样:

require_once 'app/Mage.php';
Mage::init();

$setup = Mage::getResourceModel('catalog/setup', 'core_setup');
$setup->addAttribute(...);

不幸的是,这不起作用。。。致命错误:在第734行的app\code\core\Mage\core\Model\Resource\Setup.php中对非对象调用成员函数select()。解决方案是:$Setup=Mage::getResourceModel('catalog/Setup','core\u Setup');用户215421:你是救生员。不幸的是,这不起作用。。。致命错误:在第734行的app\code\core\Mage\core\Model\Resource\Setup.php中对非对象调用成员函数select()。解决方案是:$Setup=Mage::getResourceModel('catalog/Setup','core\u Setup');用户215421:你是救生员。