Skip to main content
3 of 3
added 189 characters in body
RappY
  • 172
  • 13

Two models cant find one of them

I have two models. The one is intializing the database, the other one i use to run a crontab. But i keep getting this error. Been playing around with it for a long time..

2017-11-29T08:56:03+00:00 ERR (3): Warning: include(Mage/Mycompany/Asynccronjobs/Model/Cron.php): failed to open stream: No such file or directory  in /var/www/mycompany/lib/Varien/Autoload.php on line 94
2017-11-29T08:56:03+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Mycompany/Asynccronjobs/Model/Cron.php' for inclusion (include_path='/var/www/mycompany/app/code/local:/var/www/mycompany/app/code/community:/var/www/mycompany/app/code/core:/var/www/mycompany/lib:.:/usr/share/pear:/usr/share/php')  in /var/www/mycompany/lib/Varien/Autoload.php on line 94

My config.xml looks like this:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_AsyncCronjobs>
            <version>1.0.0</version>
        </Mycompany_AsyncCronjobs>
    </modules>
    <global>
        <models>
            <asynccronjobs>
                <class>Mycompany_AsyncCronjobs_Model</class>
                <resourceModel>asynccronjobs_resource</resourceModel>
            </asynccronjobs>
            <asynccronjobs_resource>
                <class>Mycompany_AsyncCronjobs_Model_Resource</class>
                <entities>
                    <jobs>
                        <table>asynccronjobs_jobs</table>
                    </jobs>
                </entities>
            </asynccronjobs_resource>
        </models>
        <helpers>
            <asynccronjobs>
                <class>Mycompany_AsyncCronjobs_Helper</class>
            </asynccronjobs>
        </helpers>
        <resources>
            <asynccronjobs_setup>
                <setup>
                    <module>Mycompany_AsyncCronjobs</module>
                </setup>
            </asynccronjobs_setup>
        </resources>
    </global>
    <frontend>
        <routers>
            <asynccronjobs>
                <use>standard</use>
                <args>
                    <module>Mycompany_AsyncCronjobs</module>
                    <frontName>asynccronjobs</frontName>
                </args>
            </asynccronjobs>
        </routers>
    </frontend>
    <crontab>
        <jobs>
            <Mycompany_AsyncCronjobs>
                <schedule>
                    <cron_expr>* * * * *</cron_expr>
                </schedule>
                <run>
                    <model>asynccronjobs_resource/cron::everyHour</model>
                </run>
            </Mycompany_AsyncCronjobs>
        </jobs>
    </crontab>
</config>

My Mycompany/AsyncCronjobs/Cron.php looks like this:

<?php
class Mycompany_AsyncCronjobs_Model_Cron extends Mage_Core_Model_Abstract
{

    public function everyHour()
    {
        mage::log('got it');
    }
}
RappY
  • 172
  • 13