Skip to content

Commit

Permalink
Merge pull request #4 from Indatus/develop
Browse files Browse the repository at this point in the history
v1.1.0 - Configuration change
  • Loading branch information
bkuhl committed Mar 21, 2014
2 parents 9902e9a + 625a449 commit 1833a95
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 86 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) <Ben Kuhl>
Copyright (c) 2014 <Ben Kuhl>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ Simply `extend \Indatus\Dispatcher\ScheduledCommand` and implement the `schedule
{
//every Tuesday/Thursday at 5:03am
return $scheduler->daysOfTheWeek([
Scheduler::$TUESDAY,
Scheduler::$THURSDAY
Scheduler::TUESDAY,
Scheduler::THURSDAY
])->hours(5)->minutes(3);
}
```
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/BackgroundProcessRunner.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Commands/Make.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Commands;

use Illuminate\Console\Command;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Commands/Run.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Commands;

use Illuminate\Console\Command;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Commands/ScheduleSummary.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Commands;

use Illuminate\Console\Command;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/ConfigResolver.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Drivers/Cron/ScheduleService.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Drivers\Cron;

use App;
Expand Down
81 changes: 43 additions & 38 deletions src/Indatus/Dispatcher/Drivers/Cron/Scheduler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Drivers\Cron;

use Indatus\Dispatcher\Schedulable;
Expand All @@ -13,28 +18,28 @@ class Scheduler implements Schedulable
/**
* @var string Any of the contextual timeframe
*/
public static $ANY = '*';

public static $SUNDAY = 0;
public static $MONDAY = 1;
public static $TUESDAY = 2;
public static $WEDNESDAY = 3;
public static $THURSDAY = 4;
public static $FRIDAY = 5;
public static $SATURDAY = 6;

public static $JANUARY = 1;
public static $FEBRUARY = 3;
public static $MARCH = 3;
public static $APRIL = 4;
public static $MAY = 5;
public static $JUNE = 6;
public static $JULY = 7;
public static $AUGUST = 8;
public static $SEPTEMBER = 9;
public static $OCTOBER = 10;
public static $NOVEMBER = 11;
public static $DECEMBER = 12;
const ANY = '*';

const SUNDAY = 0;
const MONDAY = 1;
const TUESDAY = 2;
const WEDNESDAY = 3;
const THURSDAY = 4;
const FRIDAY = 5;
const SATURDAY = 6;

const JANUARY = 1;
const FEBRUARY = 3;
const MARCH = 3;
const APRIL = 4;
const MAY = 5;
const JUNE = 6;
const JULY = 7;
const AUGUST = 8;
const SEPTEMBER = 9;
const OCTOBER = 10;
const NOVEMBER = 11;
const DECEMBER = 12;

private $scheduleDayOfWeek = '*';
private $scheduleMonth = '*';
Expand Down Expand Up @@ -93,7 +98,7 @@ public function yearly()
$this->setScheduleHour(0);
$this->setScheduleDayOfMonth(1);
$this->setScheduleMonth(1);
$this->setScheduleDayOfWeek(self::$ANY);
$this->setScheduleDayOfWeek(self::ANY);

return $this;
}
Expand All @@ -108,8 +113,8 @@ public function monthly()
$this->setScheduleMinute(0);
$this->setScheduleHour(0);
$this->setScheduleDayOfMonth(1);
$this->setScheduleMonth(self::$ANY);
$this->setScheduleDayOfWeek(self::$ANY);
$this->setScheduleMonth(self::ANY);
$this->setScheduleDayOfWeek(self::ANY);

return $this;
}
Expand All @@ -123,8 +128,8 @@ public function weekly()
{
$this->setScheduleMinute(0);
$this->setScheduleHour(0);
$this->setScheduleDayOfMonth(self::$ANY);
$this->setScheduleMonth(self::$ANY);
$this->setScheduleDayOfMonth(self::ANY);
$this->setScheduleMonth(self::ANY);
$this->setScheduleDayOfWeek(0);

return $this;
Expand All @@ -139,9 +144,9 @@ public function daily()
{
$this->setScheduleMinute(0);
$this->setScheduleHour(0);
$this->setScheduleDayOfMonth(self::$ANY);
$this->setScheduleMonth(self::$ANY);
$this->setScheduleDayOfWeek(self::$ANY);
$this->setScheduleDayOfMonth(self::ANY);
$this->setScheduleMonth(self::ANY);
$this->setScheduleDayOfWeek(self::ANY);

return $this;
}
Expand All @@ -154,10 +159,10 @@ public function daily()
public function hourly()
{
$this->setScheduleMinute(0);
$this->setScheduleHour(self::$ANY);
$this->setScheduleDayOfMonth(self::$ANY);
$this->setScheduleMonth(self::$ANY);
$this->setScheduleDayOfWeek(self::$ANY);
$this->setScheduleHour(self::ANY);
$this->setScheduleDayOfMonth(self::ANY);
$this->setScheduleMonth(self::ANY);
$this->setScheduleDayOfWeek(self::ANY);

return $this;
}
Expand All @@ -181,7 +186,7 @@ public function minutes($minutesIntoTheHour)
*/
public function everyMinutes($minutes)
{
$minutesSchedule = self::$ANY;
$minutesSchedule = self::ANY;
if ($minutes != 1) {
$minutesSchedule .= '/'.$minutes;
}
Expand Down Expand Up @@ -269,7 +274,7 @@ public function daysOfTheWeek($daysOfTheWeek)
*/
public function everyWeekday()
{
$this->daysOfTheWeek(Scheduler::$MONDAY.'-'.Scheduler::$FRIDAY);
$this->daysOfTheWeek(self::MONDAY.'-'.self::FRIDAY);

return $this;
}
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Platform.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher;


Expand Down
8 changes: 7 additions & 1 deletion src/Indatus/Dispatcher/Schedulable.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Indatus\Dispatcher;

Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/ScheduledCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher;

use App;
Expand Down
8 changes: 8 additions & 0 deletions src/Indatus/Dispatcher/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Indatus\Dispatcher;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Services/BackgroundProcessService.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Services;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Services/CommandService.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Services;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Services/ScheduleService.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher\Services;

use App;
Expand Down
9 changes: 7 additions & 2 deletions src/Indatus/Dispatcher/Table.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?php

/**
* @author Ben Kuhl <[email protected]>
* This file is part of Dispatcher
*
* (c) Ben Kuhl <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indatus\Dispatcher;

/**
Expand Down
Loading

0 comments on commit 1833a95

Please sign in to comment.