update 2023-11-10 13:08:58
This commit is contained in:
parent
1edf700fdb
commit
b36798318c
@ -92,8 +92,15 @@ final class Chapter extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->chapters->sha($translation, $book, $chapter);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->chapters->sha($translation, $book, $chapter);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -193,8 +200,15 @@ final class Chapter extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the books
|
||||
$chapters = $this->chapters->list($translation, $book);
|
||||
try
|
||||
{
|
||||
// get all the books
|
||||
$chapters = $this->chapters->list($translation, $book);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($chapters->{$chapter}) || !isset($chapters->{$chapter}->sha))
|
||||
@ -232,8 +246,15 @@ final class Chapter extends Watcher
|
||||
// load all the verses from the local database
|
||||
$inserted = false;
|
||||
|
||||
// get verses from the API
|
||||
if (($api = $this->chapters->list($translation, $book)) === null)
|
||||
try
|
||||
{
|
||||
// get verses from the API
|
||||
if (($api = $this->chapters->list($translation, $book)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -312,8 +333,15 @@ final class Chapter extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the verses
|
||||
if (($verses = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
try
|
||||
{
|
||||
// get all the verses
|
||||
if (($verses = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -345,8 +373,15 @@ final class Chapter extends Watcher
|
||||
// load all the verses from the local database
|
||||
$inserted = false;
|
||||
|
||||
// get verses from the API
|
||||
if (($api = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
try
|
||||
{
|
||||
// get verses from the API
|
||||
if (($api = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -63,8 +63,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->chapters->sha($translation, $book, $chapter);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->chapters->sha($translation, $book, $chapter);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -164,8 +171,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the books
|
||||
$chapters = $this->chapters->list($translation, $book);
|
||||
try
|
||||
{
|
||||
// get all the books
|
||||
$chapters = $this->chapters->list($translation, $book);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($chapters->{$chapter}) || !isset($chapters->{$chapter}->sha))
|
||||
@ -203,8 +217,15 @@
|
||||
// load all the verses from the local database
|
||||
$inserted = false;
|
||||
|
||||
// get verses from the API
|
||||
if (($api = $this->chapters->list($translation, $book)) === null)
|
||||
try
|
||||
{
|
||||
// get verses from the API
|
||||
if (($api = $this->chapters->list($translation, $book)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -283,8 +304,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the verses
|
||||
if (($verses = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
try
|
||||
{
|
||||
// get all the verses
|
||||
if (($verses = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -316,8 +344,15 @@
|
||||
// load all the verses from the local database
|
||||
$inserted = false;
|
||||
|
||||
// get verses from the API
|
||||
if (($api = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
try
|
||||
{
|
||||
// get verses from the API
|
||||
if (($api = $this->verses->get($translation, $book, $chapter)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -88,8 +88,15 @@ final class Translation extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->translations->sha($translation);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->translations->sha($translation);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -122,8 +129,15 @@ final class Translation extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the translations
|
||||
$translations = $this->translations->list();
|
||||
try
|
||||
{
|
||||
// get all the translations
|
||||
$translations = $this->translations->list();
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($translations->{$translation}) || !isset($translations->{$translation}->sha))
|
||||
@ -150,8 +164,15 @@ final class Translation extends Watcher
|
||||
*/
|
||||
private function update(): bool
|
||||
{
|
||||
// get translations from the API
|
||||
if (($translations = $this->translations->list()) === null)
|
||||
try
|
||||
{
|
||||
// get translations from the API
|
||||
if (($translations = $this->translations->list()) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -60,8 +60,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->translations->sha($translation);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->translations->sha($translation);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -94,8 +101,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all the translations
|
||||
$translations = $this->translations->list();
|
||||
try
|
||||
{
|
||||
// get all the translations
|
||||
$translations = $this->translations->list();
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($translations->{$translation}) || !isset($translations->{$translation}->sha))
|
||||
@ -122,8 +136,15 @@
|
||||
*/
|
||||
private function update(): bool
|
||||
{
|
||||
// get translations from the API
|
||||
if (($translations = $this->translations->list()) === null)
|
||||
try
|
||||
{
|
||||
// get translations from the API
|
||||
if (($translations = $this->translations->list()) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -104,8 +104,15 @@ final class Book extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->books->sha($translation, $book);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->books->sha($translation, $book);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -139,8 +146,15 @@ final class Book extends Watcher
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all this translation books
|
||||
$books = $this->books->list($translation);
|
||||
try
|
||||
{
|
||||
// get all this translation books
|
||||
$books = $this->books->list($translation);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($books->{$book}) || !isset($books->{$book}->sha))
|
||||
@ -169,8 +183,15 @@ final class Book extends Watcher
|
||||
*/
|
||||
private function update(string $translation): bool
|
||||
{
|
||||
// get translations from the API
|
||||
if (($books = $this->books->list($translation)) === null)
|
||||
try
|
||||
{
|
||||
// get translations from the API
|
||||
if (($books = $this->books->list($translation)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -76,8 +76,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get API hash value
|
||||
$hash = $this->books->sha($translation, $book);
|
||||
try
|
||||
{
|
||||
// get API hash value
|
||||
$hash = $this->books->sha($translation, $book);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// confirm hash has not changed
|
||||
if (hash_equals($hash, $this->target->sha))
|
||||
@ -111,8 +118,15 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all this translation books
|
||||
$books = $this->books->list($translation);
|
||||
try
|
||||
{
|
||||
// get all this translation books
|
||||
$books = $this->books->list($translation);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check return data
|
||||
if (!isset($books->{$book}) || !isset($books->{$book}->sha))
|
||||
@ -141,8 +155,15 @@
|
||||
*/
|
||||
private function update(string $translation): bool
|
||||
{
|
||||
// get translations from the API
|
||||
if (($books = $this->books->list($translation)) === null)
|
||||
try
|
||||
{
|
||||
// get translations from the API
|
||||
if (($books = $this->books->list($translation)) === null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user