-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23d5933
commit a6c2da3
Showing
22 changed files
with
675 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
lib/CleantalkSP/SpbctWP/FSWatcher/Analyzer/SpbctWpFSWAnalyzer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace CleantalkSP\SpbctWP\FSWatcher\Analyzer; | ||
|
||
use CleantalkSP\SpbctWP\FSWatcher\SpbctWpFSWController; | ||
use CleantalkSP\Common\FSWatcher\Logger; | ||
|
||
class SpbctWpFSWAnalyzer extends \CleantalkSP\Common\FSWatcher\Analyzer\Analyzer | ||
{ | ||
/** | ||
* @return array|false | ||
*/ | ||
public static function getCompareResult() | ||
{ | ||
$first = filter_var($_POST['fswatcher__first_date'], FILTER_VALIDATE_INT); | ||
$second = filter_var($_POST['fswatcher__second_date'], FILTER_VALIDATE_INT); | ||
|
||
if ($first > $second) { | ||
$tmp = $first; | ||
$first = $second; | ||
$second = $tmp; | ||
} | ||
|
||
$storage = SpbctWpFSWController::$storage; | ||
|
||
$first_journal = $storage::getJournal($first); | ||
$second_journal = $storage::getJournal($second); | ||
|
||
if (!$first_journal || !$second_journal) { | ||
return false; | ||
} | ||
|
||
if (SpbctWpFSWController::$debug) { | ||
Logger::log('first journal ' . $first_journal); | ||
Logger::log('second journal ' . $second_journal); | ||
} | ||
|
||
return parent::compare($first_journal, $second_journal); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/CleantalkSP/SpbctWP/FSWatcher/Repository/SpbctWpFSWFileRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace CleantalkSP\SpbctWP\FSWatcher\Repository; | ||
|
||
use CleantalkSP\SpbctWP\FSWatcher\SpbctWpFSWController; | ||
use CleantalkSP\Common\FSWatcher\Repository\Repository; | ||
|
||
/** | ||
* @psalm-suppress UnusedClass | ||
*/ | ||
class SpbctWpFSWFileRepository implements Repository | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function getAvailableJournals() | ||
{ | ||
$storage = SpbctWpFSWController::$storage; | ||
return $storage::getAvailableJournals(); | ||
} | ||
} |
Oops, something went wrong.