diff --git a/src/register_cron_aliases.php b/src/register_cron_aliases.php index 2987248..ca7c78d 100644 --- a/src/register_cron_aliases.php +++ b/src/register_cron_aliases.php @@ -2,10 +2,17 @@ use Cron\CronExpression; -if (! CronExpression::supportsAlias('@minutely')) { - CronExpression::registerAlias('@minutely', '* * * * *'); -} +$loader = function () use (&$loader) { + if (! CronExpression::supportsAlias('@minutely')) { + CronExpression::registerAlias('@minutely', '* * * * *'); + } -if (! CronExpression::supportsAlias('@quarterly')) { - CronExpression::registerAlias('@quarterly', '0 0 1 */3 *'); -} + if (! CronExpression::supportsAlias('@quarterly')) { + CronExpression::registerAlias('@quarterly', '0 0 1 */3 *'); + } + + spl_autoload_unregister($loader); + unset($loader); +}; + +spl_autoload_register($loader, true, true);