summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-12-13 08:40:27 -0100
committerMaxence Lange <maxence@artificial-owl.com>2018-12-13 08:40:27 -0100
commit7f2eede76bf40ba2c60deb10b9356ca9e8864889 (patch)
tree5d7733febe7ad9613e037b14a1a0076c756dacb8 /lib
parenta72039c21225de466d7761cc3fa9b1205626cf3e (diff)
moving stuff around
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Command/CacheRefresh.php4
-rw-r--r--lib/Command/NoteCreate.php2
-rw-r--r--lib/Controller/ActivityPubController.php5
-rw-r--r--lib/Controller/LocalController.php10
-rw-r--r--lib/Controller/NavigationController.php6
-rw-r--r--lib/Controller/SocialPubController.php4
-rw-r--r--lib/Cron/Cache.php4
-rw-r--r--lib/Db/ActorsRequest.php2
-rw-r--r--lib/Db/ActorsRequestBuilder.php2
-rw-r--r--lib/Db/CacheActorsRequest.php2
-rw-r--r--lib/Db/CacheActorsRequestBuilder.php2
-rw-r--r--lib/Db/CacheDocumentsRequest.php2
-rw-r--r--lib/Db/CacheDocumentsRequestBuilder.php3
-rw-r--r--lib/Db/CoreRequestBuilder.php8
-rw-r--r--lib/Db/FollowsRequest.php3
-rw-r--r--lib/Db/FollowsRequestBuilder.php2
-rw-r--r--lib/Db/NotesRequest.php4
-rw-r--r--lib/Db/NotesRequestBuilder.php4
-rw-r--r--lib/Model/ActivityPub/ACore.php27
-rw-r--r--lib/Model/ActivityPub/Activity/Add.php81
-rw-r--r--lib/Model/ActivityPub/Activity/Block.php81
-rw-r--r--lib/Model/ActivityPub/Activity/Create.php3
-rw-r--r--lib/Model/ActivityPub/Activity/Follow.php (renamed from lib/Model/ActivityPub/Follow.php)6
-rw-r--r--lib/Model/ActivityPub/Activity/Like.php (renamed from lib/Service/ActivityPub/UndoService.php)46
-rw-r--r--lib/Model/ActivityPub/Activity/Remove.php81
-rw-r--r--lib/Model/ActivityPub/Activity/Update.php81
-rw-r--r--lib/Model/ActivityPub/Actor/Person.php (renamed from lib/Model/ActivityPub/Person.php)4
-rw-r--r--lib/Model/ActivityPub/Item.php1
-rw-r--r--lib/Model/ActivityPub/Object/Document.php (renamed from lib/Model/ActivityPub/Document.php)3
-rw-r--r--lib/Model/ActivityPub/Object/Image.php (renamed from lib/Model/ActivityPub/Image.php)3
-rw-r--r--lib/Model/ActivityPub/Object/Note.php (renamed from lib/Model/ActivityPub/Note.php)3
-rw-r--r--lib/Model/ActivityPub/Object/Tombstone.php (renamed from lib/Model/ActivityPub/Tombstone.php)3
-rw-r--r--lib/Service/ActivityPub/Activity/AcceptService.php105
-rw-r--r--lib/Service/ActivityPub/Activity/AddService.php106
-rw-r--r--lib/Service/ActivityPub/Activity/BlockService.php106
-rw-r--r--lib/Service/ActivityPub/Activity/CreateService.php104
-rw-r--r--lib/Service/ActivityPub/Activity/DeleteService.php (renamed from lib/Service/ActivityPub/DeleteService.php)66
-rw-r--r--lib/Service/ActivityPub/Activity/FollowService.php (renamed from lib/Service/ActivityPub/FollowService.php)106
-rw-r--r--lib/Service/ActivityPub/Activity/LikeService.php104
-rw-r--r--lib/Service/ActivityPub/Activity/RejectService.php105
-rw-r--r--lib/Service/ActivityPub/Activity/RemoveService.php106
-rw-r--r--lib/Service/ActivityPub/Activity/UndoService.php108
-rw-r--r--lib/Service/ActivityPub/Activity/UpdateService.php104
-rw-r--r--lib/Service/ActivityPub/Actor/PersonService.php (renamed from lib/Service/ActivityPub/PersonService.php)38
-rw-r--r--lib/Service/ActivityPub/ICoreService.php28
-rw-r--r--lib/Service/ActivityPub/Object/DocumentService.php (renamed from lib/Service/ActivityPub/DocumentService.php)29
-rw-r--r--lib/Service/ActivityPub/Object/NoteService.php (renamed from lib/Service/ActivityPub/NoteService.php)52
-rw-r--r--lib/Service/ActivityService.php10
-rw-r--r--lib/Service/ActorService.php6
-rw-r--r--lib/Service/ConfigService.php2
-rw-r--r--lib/Service/ImportService.php218
-rw-r--r--lib/Service/PostService.php2
52 files changed, 1743 insertions, 254 deletions
diff --git a/lib/Command/CacheRefresh.php b/lib/Command/CacheRefresh.php
index 26a688fe..4990c918 100644
--- a/lib/Command/CacheRefresh.php
+++ b/lib/Command/CacheRefresh.php
@@ -33,8 +33,8 @@ namespace OCA\Social\Command;
use Exception;
use OC\Core\Command\Base;
-use OCA\Social\Service\ActivityPub\DocumentService;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Service\ActivityPub\Object\DocumentService;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php
index 307fa4af..1b7da816 100644
--- a/lib/Command/NoteCreate.php
+++ b/lib/Command/NoteCreate.php
@@ -33,7 +33,7 @@ namespace OCA\Social\Command;
use Exception;
use OC\Core\Command\Base;
use OCA\Social\Model\Post;
-use OCA\Social\Service\ActivityPub\NoteService;
+use OCA\Social\Service\ActivityPub\Object\NoteService;
use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\ConfigService;
diff --git a/lib/Controller/ActivityPubController.php b/lib/Controller/ActivityPubController.php
index b686bf65..0d9f9668 100644
--- a/lib/Controller/ActivityPubController.php
+++ b/lib/Controller/ActivityPubController.php
@@ -37,14 +37,13 @@ use OCA\Social\AppInfo\Application;
use OCA\Social\Db\NotesRequest;
use OCA\Social\Exceptions\SignatureIsGoneException;
use OCA\Social\Exceptions\UnknownItemException;
-use OCA\Social\Service\ActivityPub\FollowService;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Service\ActivityPub\Activity\FollowService;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\ImportService;
use OCA\Social\Service\MiscService;
use OCP\AppFramework\Controller;
-use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\Response;
use OCP\IRequest;
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index a99782d9..1fa26009 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -37,12 +37,12 @@ use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountDoesNotExistException;
use OCA\Social\Exceptions\InvalidResourceException;
use OCA\Social\Model\ActivityPub\ACore;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Model\Post;
-use OCA\Social\Service\ActivityPub\DocumentService;
-use OCA\Social\Service\ActivityPub\FollowService;
-use OCA\Social\Service\ActivityPub\NoteService;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Service\ActivityPub\Object\DocumentService;
+use OCA\Social\Service\ActivityPub\Activity\FollowService;
+use OCA\Social\Service\ActivityPub\Object\NoteService;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\MiscService;
use OCA\Social\Service\PostService;
diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php
index cbe5a1f1..f3e64c36 100644
--- a/lib/Controller/NavigationController.php
+++ b/lib/Controller/NavigationController.php
@@ -37,8 +37,8 @@ use OC\User\NoUserException;
use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountAlreadyExistsException;
use OCA\Social\Exceptions\SocialAppConfigException;
-use OCA\Social\Service\ActivityPub\DocumentService;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Service\ActivityPub\Object\DocumentService;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\CheckService;
use OCA\Social\Service\ConfigService;
@@ -227,7 +227,7 @@ class NavigationController extends Controller {
$setup = false;
try {
- $address = $this->configService->getCloudAddress(true);
+ $this->configService->getCloudAddress(true);
$setup = true;
} catch (SocialAppConfigException $e) {
}
diff --git a/lib/Controller/SocialPubController.php b/lib/Controller/SocialPubController.php
index efd35049..5654b32d 100644
--- a/lib/Controller/SocialPubController.php
+++ b/lib/Controller/SocialPubController.php
@@ -34,8 +34,8 @@ use daita\MySmallPhpTools\Traits\Nextcloud\TNCDataResponse;
use Exception;
use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
-use OCA\Social\Model\ActivityPub\Person;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Model\ActivityPub\Actor\Person;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\MiscService;
use OCP\AppFramework\Controller;
diff --git a/lib/Cron/Cache.php b/lib/Cron/Cache.php
index df9b741a..087cef31 100644
--- a/lib/Cron/Cache.php
+++ b/lib/Cron/Cache.php
@@ -34,8 +34,8 @@ namespace OCA\Social\Cron;
use Exception;
use OC\BackgroundJob\TimedJob;
use OCA\Social\AppInfo\Application;
-use OCA\Social\Service\ActivityPub\DocumentService;
-use OCA\Social\Service\ActivityPub\PersonService;
+use OCA\Social\Service\ActivityPub\Object\DocumentService;
+use OCA\Social\Service\ActivityPub\Actor\PersonService;
use OCA\Social\Service\ActorService;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
diff --git a/lib/Db/ActorsRequest.php b/lib/Db/ActorsRequest.php
index a8ad8a28..be241ab4 100644
--- a/lib/Db/ActorsRequest.php
+++ b/lib/Db/ActorsRequest.php
@@ -32,7 +32,7 @@ namespace OCA\Social\Db;
use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\SocialAppConfigException;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
use OCP\IDBConnection;
diff --git a/lib/Db/ActorsRequestBuilder.php b/lib/Db/ActorsRequestBuilder.php
index 0312dea3..5263c6e3 100644
--- a/lib/Db/ActorsRequestBuilder.php
+++ b/lib/Db/ActorsRequestBuilder.php
@@ -32,7 +32,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Exceptions\SocialAppConfigException;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCP\DB\QueryBuilder\IQueryBuilder;
class ActorsRequestBuilder extends CoreRequestBuilder {
diff --git a/lib/Db/CacheActorsRequest.php b/lib/Db/CacheActorsRequest.php
index e69afbc1..6298c12b 100644
--- a/lib/Db/CacheActorsRequest.php
+++ b/lib/Db/CacheActorsRequest.php
@@ -33,7 +33,7 @@ namespace OCA\Social\Db;
use DateTime;
use Exception;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Db/CacheActorsRequestBuilder.php b/lib/Db/CacheActorsRequestBuilder.php
index 4833d0e9..fe0e5313 100644
--- a/lib/Db/CacheActorsRequestBuilder.php
+++ b/lib/Db/CacheActorsRequestBuilder.php
@@ -32,7 +32,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCP\DB\QueryBuilder\IQueryBuilder;
class CacheActorsRequestBuilder extends CoreRequestBuilder {
diff --git a/lib/Db/CacheDocumentsRequest.php b/lib/Db/CacheDocumentsRequest.php
index 3b5d917a..43b9ad3e 100644
--- a/lib/Db/CacheDocumentsRequest.php
+++ b/lib/Db/CacheDocumentsRequest.php
@@ -33,7 +33,7 @@ namespace OCA\Social\Db;
use DateTime;
use Exception;
use OCA\Social\Exceptions\CacheDocumentDoesNotExistException;
-use OCA\Social\Model\ActivityPub\Document;
+use OCA\Social\Model\ActivityPub\Object\Document;
use OCP\DB\QueryBuilder\IQueryBuilder;
class CacheDocumentsRequest extends CacheDocumentsRequestBuilder {
diff --git a/lib/Db/CacheDocumentsRequestBuilder.php b/lib/Db/CacheDocumentsRequestBuilder.php
index 4271fe6d..300f5066 100644
--- a/lib/Db/CacheDocumentsRequestBuilder.php
+++ b/lib/Db/CacheDocumentsRequestBuilder.php
@@ -31,8 +31,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
-use OCA\Social\Model\ActivityPub\Document;
-use OCA\Social\Model\ActivityPub\Image;
+use OCA\Social\Model\ActivityPub\Object\Document;
use OCP\DB\QueryBuilder\IQueryBuilder;
class CacheDocumentsRequestBuilder extends CoreRequestBuilder {
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php
index 8f594ddd..1e96b620 100644
--- a/lib/Db/CoreRequestBuilder.php
+++ b/lib/Db/CoreRequestBuilder.php
@@ -36,10 +36,10 @@ use DateTime;
use Doctrine\DBAL\Query\QueryBuilder;
use Exception;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Document;
-use OCA\Social\Model\ActivityPub\Follow;
-use OCA\Social\Model\ActivityPub\Image;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Object\Document;
+use OCA\Social\Model\ActivityPub\Activity\Follow;
+use OCA\Social\Model\ActivityPub\Object\Image;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Db/FollowsRequest.php b/lib/Db/FollowsRequest.php
index fac47cdb..eb8789ed 100644
--- a/lib/Db/FollowsRequest.php
+++ b/lib/Db/FollowsRequest.php
@@ -34,8 +34,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
use OCA\Social\Exceptions\FollowDoesNotExistException;
-use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Follow;
+use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Db/FollowsRequestBuilder.php b/lib/Db/FollowsRequestBuilder.php
index 01e08442..6fb323a6 100644
--- a/lib/Db/FollowsRequestBuilder.php
+++ b/lib/Db/FollowsRequestBuilder.php
@@ -33,7 +33,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Follow;
+use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Db/NotesRequest.php b/lib/Db/NotesRequest.php
index fdd1313b..fa2f77b2 100644
--- a/lib/Db/NotesRequest.php
+++ b/lib/Db/NotesRequest.php
@@ -32,8 +32,8 @@ namespace OCA\Social\Db;
use DateTime;
use OCA\Social\Exceptions\NoteNotFoundException;
-use OCA\Social\Model\ActivityPub\Note;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Object\Note;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
diff --git a/lib/Db/NotesRequestBuilder.php b/lib/Db/NotesRequestBuilder.php
index 872004fa..4adaf37a 100644
--- a/lib/Db/NotesRequestBuilder.php
+++ b/lib/Db/NotesRequestBuilder.php
@@ -34,8 +34,8 @@ use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
use Doctrine\DBAL\Query\QueryBuilder;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Note;
-use OCA\Social\Model\ActivityPub\Person;
+use OCA\Social\Model\ActivityPub\Object\Note;
+use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Model\InstancePath;
use OCP\DB\QueryBuilder\ICompositeExpression;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php
index 3e76e2fc..c0b8ccf3 100644
--- a/lib/Model/ActivityPub/ACore.php
+++ b/lib/Model/ActivityPub/ACore.php
@@ -37,6 +37,7 @@ use OCA\Social\Exceptions\ActivityCantBeVerifiedException;
use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\InvalidResourceEntryException;
use OCA\Social\Exceptions\UrlCloudException;
+use OCA\Social\Model\ActivityPub\Object\Document;
use OCA\Social\Service\ActivityPub\ICoreService;
@@ -87,18 +88,18 @@ abstract class ACore extends Item implements JsonSerializable {
/**
- * @param Item $parent
+ * @param ACore $parent
*
- * @return Item
+ * @return ACore
*/
- public function setParent(Item $parent): ACore {
+ public function setParent(ACore $parent): ACore {
$this->parent = $parent;
return $this;
}
/**
- * @return Item
+ * @return ACore
*/
public function getParent(): ACore {
return $this->parent;
@@ -384,13 +385,13 @@ abstract class ACore extends Item implements JsonSerializable {
* @param string $default
*
* @return string
- * @throws InvalidResourceEntryException
*/
public function validate(int $as, string $k, array $arr, string $default = ''): string {
- $value = $this->validateEntryString($as, $this->get($k, $arr, $default));
-
-
- return $value;
+ try {
+ return $this->validateEntryString($as, $this->get($k, $arr, $default));
+ } catch (InvalidResourceEntryException $e) {
+ return $default;
+ }
}
@@ -401,14 +402,16 @@ abstract class ACore extends Item implements JsonSerializable {
* @param array $default
*
* @return array
- * @throws InvalidResourceEntryException
*/
public function validateArray(int $as, string $k, array $arr, array $default = []): array {
$values = $this->getArray($k, $arr, $default);
$result = [];
foreach ($values as $value) {
- $result[] = $this->validateEntryString($as, $value);
+ try {
+ $result[] = $this->validateEntryString($as, $value);
+ } catch (InvalidResourceEntryException $e) {
+ }
}
return $result;
@@ -469,8 +472,6 @@ abstract class ACore extends Item implements JsonSerializable {
/**
* @param array $data
- *
- * @throws InvalidResourceEntryException
*/
public function import(array $data) {
$this->setId($this->validate(self::AS_ID, 'id', $data, ''));
diff --git a/lib/Model/ActivityPub/Activity/Add.php b/lib/Model/ActivityPub/Activity/Add.php
new file mode 100644
index 00000000..321913eb
--- /dev/null
+++ b/lib/Model/ActivityPub/Activity/Add.php
@@ -0,0 +1,81 @@
+<?php
+declare(strict_types=1);
+
+
+/**
+ * Nextcloud - Social Support
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Maxence Lange <maxence@artificial-owl.com>
+ * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+namespace OCA\Social\Model\ActivityPub\Activity;
+
+
+use JsonSerializable;
+use OCA\Social\Model\ActivityPub\ACore;
+
+
+/**
+ * Class Add
+ *
+ * @package OCA\Social\Model\ActivityPub\Activity
+ */
+class Add extends ACore implements JsonSerializable {
+
+
+ const TYPE = 'Add';
+
+
+ /**
+ * Activity constructor.
+ *
+ * @param ACore $parent
+ */
+ public function __construct($parent = null) {
+ parent::__construct($parent);
+
+ $this->setType(self::TYPE);
+ }
+
+
+ /**
+ * @param array $data
+ */
+ public function import(array $data) {
+ parent::import($data);
+ }
+
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize(): array {
+ return array_merge(
+ parent::jsonSerialize(),
+ [
+ ]
+ );
+ }
+
+}
+
diff --git a/lib/Model/ActivityPub/Activity/Block.php b/lib/Model/ActivityPub/Activity/Block.php
new file mode 100644
index