Git Product home page Git Product logo

Comments (13)

liebig avatar liebig commented on July 24, 2024

I got a message at the Laravel forum that someone has this problem, too. Maybe this is a problem with linux only. I will install a local Debian on Monday and will try to fix this. Can you provide me a route definition snippet which you use and get this error?

from cron.

lokielse avatar lokielse commented on July 24, 2024

1st=====================
config/app.php
alias
'Cron' => '\Liebig\Cron\Cron',

2nd==================
Route::get('cron/c56ac54aff5505bcb04259303bdf8d18',
function () {
Cron::setDatabaseLogging(true);
Cron::add('test_cron',
'* * * * * *',
function () {
ca_log('test cron', 'cron.test');
}
);
Cron::run();
return 'success';
}
);

from cron.

lokielse avatar lokielse commented on July 24, 2024

.\vendor\liebig\cron\src\Liebig\Cron\Cron.php

namespace Liebig\Cron;
require_once DIR.'/models/manager.php'; //add this line and solve.

from cron.

liebig avatar liebig commented on July 24, 2024

Thank you very much for improving Cron. I will test your fix with Linux and Windows and will give you a feedback.

from cron.

liebig avatar liebig commented on July 24, 2024

I am sorry, but at my test environment it is working without your fix. I am running debian on virtual box with apache2. This is my Route file:

Route::get('cron/c56ac54aff5505bcb04259303bdf8d18', function () {
\Liebig\Cron\Cron::setDatabaseLogging(true);
\Liebig\Cron\Cron::setLogOnlyErrorJobsToDatabase(false);
\Liebig\Cron\Cron::add('test_cron', '* * * * * *', function () {
return 'test cron is running!';
});
return \Liebig\Cron\Cron::run();
});

And this works fine. I fixed the migration case sensitive bug, so please update to head and update your database. Did you use composer to install Cron?

from cron.

lokielse avatar lokielse commented on July 24, 2024

The same code, it works on windows, but not work on debian.
There is no "models/manage" and "models/job" in generated classmap file which under vender/composer after i run "update" and "dump-autoload" on debian.
I don't know if it is problem between usage : 'Cron' => '\Liebig\Cron\Cron' ; Cron::xxx and \Liebig\Cron\Cron:xxx"
(when i use \Liebig\Cron\Cron::xxx will occur an errors, PHP 5.4.9)

from cron.

liebig avatar liebig commented on July 24, 2024

Strange issue! Okay, I will add two require_once commands to Cron. Can you please add this two lines and test Cron before I commit the change?

namespace Liebig\Cron;
require_once DIR . '/models/job.php';
require_once DIR . '/models/manager.php';

Thanks.

from cron.

lokielse avatar lokielse commented on July 24, 2024

yes~ already.

from cron.

liebig avatar liebig commented on July 24, 2024

Fixed - thanks again for the great help, waisir!

from cron.

lucasmingarro avatar lucasmingarro commented on July 24, 2024

Liebig I think that waisir has something wrong in his env/conf. I really don't know where but I'm using your package in OSX, Redhat and ubuntu an it works fine. How many coders report this issue?

from cron.

liebig avatar liebig commented on July 24, 2024

Thanks, lucasmingarro for your comment. At the moment we have two coders with this problem. I tested everything on Windows 7 and Debian 7.1.0 and it worked. But I can live with the fix because it doesen't mean much overhead. Only if the Cron class is loaded, the two model classes will be loaded, if they are not already. Only if you disable database logging in general, this two classes are not necessary but are loaded. To reach the best compatibility, I decided to commit this fix. I hope you can live with this, too ;)

from cron.

lucasmingarro avatar lucasmingarro commented on July 24, 2024

hahahaha. I can live with my code so living with this hack will not be a problem :-)

from cron.

ryanwinchester avatar ryanwinchester commented on July 24, 2024

I am having Class 'Liebig\Cron\Facades\Cron' not found in Ubuntu 13.04, Laravel 4.1, PHP 5.4.9

Fresh install of Laravel and fresh install of Cron, following the Install directions in Readme.

from cron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.