Comments (13)
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.
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.
.\vendor\liebig\cron\src\Liebig\Cron\Cron.php
namespace Liebig\Cron;
require_once DIR.'/models/manager.php'; //add this line and solve.
from cron.
Thank you very much for improving Cron. I will test your fix with Linux and Windows and will give you a feedback.
from cron.
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.
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.
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.
yes~ already.
from cron.
Fixed - thanks again for the great help, waisir!
from cron.
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.
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.
hahahaha. I can live with my code so living with this hack will not be a problem :-)
from cron.
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)
- Are tests working? HOT 2
- Incompatibility with Laravel 8, 9 HOT 1
- Exception with two closures on the same line of code HOT 3
- Symfony\Component\Console\Helper\HelperSet->get('table') HOT 3
- usage question: loading jobs from database HOT 3
- command cron:run/list error HOT 1
- stop cronjob run during beforeRun event HOT 3
- Cron job running only one time HOT 3
- Pull request #80 not in composer package HOT 3
- trying to understand why I should use this over Laravel's built-in scheduler HOT 2
- Which user should run cron HOT 2
- Laravel 5.4 support HOT 3
- PHP Fatal error: Class 'App\Providers\Cron' not found in C:\xampp\htdocs\isend\blog\app\Providers\AppServiceProvider.php on line 33 HOT 3
- laravel5.2.45 install failed HOT 2
- passing variable to the function parameter before adding a cron HOT 5
- Have Undefined index while run the cron job!!! HOT 3
- Php artisan cron:run Not working HOT 13
- Can't use `artisan route:cache` because the built-in cron route uses a closure HOT 5
- [Laravel 5.6] Ambiguous class resolution warning HOT 10
- doesn't work with Laravel 5.8 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cron.