<global>
<models>
<starmall_shipment>
<class>Starmall_Shipment_Model</class>
<resourceModel>starmall_shipment_mysql4</resourceModel>
</starmall_shipment>
<starmall_shipment_mysql4>
<class>Starmall_Shipment_Model_Mysql4</class>
<entities>
<shipment>
<table>starmall_shipment</table>
</shipment>
</entities>
</starmall_shipment_mysql4>
</models>
</global>
My custom grid in the backend is working and I see the grid with data in it.
As a debug test I have in my Grid.php in _prepareCollection:
$x = Mage::getModel('starmall_shipment/shipment');
$x->load(3);
var_dump($x); // WORKS and I get information
When I run this in a standalone script:
<?php
define("MAGE_BASE_DIR", "/home/users/xxx/xxx");
require_once MAGE_BASE_DIR . '/app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$x = Mage::getModel('starmall_shipment/shipment');
$x->load(3);
var_dump($x);
?>
I see this error:
No such file or directory in /home/users/xxx/xxx/lib/Varien/Autoload.php
Failed opening 'Mage/Starmall/Shipment/Model/Shipment.php'
Why does it prepend Mage in front of the model?
What can be wrong in my config?
ADDED INFORMATION:
/app/etc/Starmall_Shipment.xml
<config>
<modules>
<Starmall_Shipment>
<active>true</active>
<codePool>local</codePool>
</Starmall_Shipment>
</modules>
THE REAL PROBLEM (POSSIBLY)
My Magento hosting provider puts this tag default int /app/etc/local.xml when installing Magento.
<cache>
<backend>memcached</backend>
<memcached>
<servers>
<server>
<host>unix:///path/to/memcached.sock</host>
<persistent>0</persistent>
<port>0</port>
</server>
</servers>
</memcached>
</cache>
If I comment this tag out then I don’t need to use loadModules() in my script.
I wonder if I need to turn this back on when going into production mode?
Have a look how Magento cron works – it works as standalone script also (cron.php) and copy-paste code to your custom module.
Main things:
Also it seems like modules not loaded
Try to add after init config: