From 7c18f10bd2ea9f22264aec652cc29e816d65583c Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 20 May 2020 16:53:53 +0000 Subject: [PATCH] [TOOLS] Fixed all licence blocks, to use the same, foldable, format --- bin/fix_license | 94 +++++++++++++++++++++++++ src/Command/ListEventsCommand.php | 33 ++++----- src/Controller/NetworkPublic.php | 33 ++++----- src/Core/DB.php | 33 ++++----- src/Core/DefaultSettings.php | 33 ++++----- src/Core/GNUsocial.php | 33 ++++----- src/Core/GSEvent.php | 33 ++++----- src/Core/I18n.php | 33 ++++----- src/Core/Log.php | 33 ++++----- src/Core/ModulesManager.php | 33 ++++----- src/Core/RouteLoader.php | 33 ++++----- src/Core/SchemaDefDriver.php | 33 ++++----- src/Entity/Attention.php | 2 +- src/Entity/Avatar.php | 2 +- src/Entity/Config.php | 2 +- src/Entity/ConfirmAddress.php | 2 +- src/Entity/Consumer.php | 2 +- src/Entity/Conversation.php | 2 +- src/Entity/File.php | 2 +- src/Entity/FileRedirection.php | 2 +- src/Entity/FileThumbnail.php | 2 +- src/Entity/FileToPost.php | 2 +- src/Entity/ForeignLink.php | 2 +- src/Entity/ForeignService.php | 2 +- src/Entity/ForeignSubscription.php | 2 +- src/Entity/ForeignUser.php | 2 +- src/Entity/GroupAlias.php | 2 +- src/Entity/GroupBlock.php | 2 +- src/Entity/GroupInbox.php | 2 +- src/Entity/GroupJoinQueue.php | 2 +- src/Entity/GroupMember.php | 2 +- src/Entity/Invitation.php | 2 +- src/Entity/LocationNamespace.php | 2 +- src/Entity/LoginToken.php | 2 +- src/Entity/Nonce.php | 2 +- src/Entity/Notice.php | 2 +- src/Entity/NoticeLocation.php | 2 +- src/Entity/NoticePrefs.php | 2 +- src/Entity/NoticeSource.php | 2 +- src/Entity/NoticeTag.php | 2 +- src/Entity/OauthApplication.php | 2 +- src/Entity/OauthApplicationUser.php | 2 +- src/Entity/OauthTokenAssociation.php | 2 +- src/Entity/OldSchoolPrefs.php | 2 +- src/Entity/Profile.php | 2 +- src/Entity/ProfileBlock.php | 2 +- src/Entity/ProfileList.php | 2 +- src/Entity/ProfilePrefs.php | 2 +- src/Entity/ProfileRole.php | 2 +- src/Entity/ProfileTag.php | 2 +- src/Entity/ProfileTagSubscription.php | 2 +- src/Entity/QueueItem.php | 2 +- src/Entity/RelatedGroup.php | 2 +- src/Entity/RememberMe.php | 2 +- src/Entity/Reply.php | 2 +- src/Entity/SchemaVersion.php | 2 +- src/Entity/Session.php | 2 +- src/Entity/SmsCarrier.php | 2 +- src/Entity/Subscription.php | 2 +- src/Entity/SubscriptionQueue.php | 2 +- src/Entity/Token.php | 2 +- src/Entity/UnavailableStatusNetwork.php | 2 +- src/Entity/User.php | 2 +- src/Entity/UserGroup.php | 2 +- src/Entity/UserImPrefs.php | 2 +- src/Entity/UserLocationPrefs.php | 2 +- src/Entity/UserUrlshortenerPrefs.php | 2 +- src/Entity/UserUsername.php | 2 +- 68 files changed, 337 insertions(+), 232 deletions(-) create mode 100755 bin/fix_license diff --git a/bin/fix_license b/bin/fix_license new file mode 100755 index 0000000000..e5f16ba4a0 --- /dev/null +++ b/bin/fix_license @@ -0,0 +1,94 @@ +#!/bin/php + +. + */ +', '// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/soci +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} +', '/* + * This file is part of GNU social - https://www.gnu.org/software/social + * + * GNU social 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. + * + * GNU social 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 GNU social. If not, see . + */']; + +$new_license = "// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} +"; + +foreach ($old_licenses as $old) { + $files = str_replace("$old", "$new_license", $files); +} + +F\map(F\zip($files, $filenames), + function ($arg) + { + list($file, $filename) = $arg; + file_put_contents($filename, $file); + } +); diff --git a/src/Command/ListEventsCommand.php b/src/Command/ListEventsCommand.php index 2aa9132c3c..77bbb6d696 100644 --- a/src/Command/ListEventsCommand.php +++ b/src/Command/ListEventsCommand.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Command to search for event by pattern diff --git a/src/Controller/NetworkPublic.php b/src/Controller/NetworkPublic.php index 1ccabe34bf..9da7ff2ed7 100644 --- a/src/Controller/NetworkPublic.php +++ b/src/Controller/NetworkPublic.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Handle network public feed diff --git a/src/Core/DB.php b/src/Core/DB.php index c1505ca3e2..47258b54e0 100644 --- a/src/Core/DB.php +++ b/src/Core/DB.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Doctrine entity manager static wrapper diff --git a/src/Core/DefaultSettings.php b/src/Core/DefaultSettings.php index a7a451d44e..e509557a89 100644 --- a/src/Core/DefaultSettings.php +++ b/src/Core/DefaultSettings.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Write the default settings to the database diff --git a/src/Core/GNUsocial.php b/src/Core/GNUsocial.php index 7b80a1d47b..254447fa10 100644 --- a/src/Core/GNUsocial.php +++ b/src/Core/GNUsocial.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Main GNU social entry point diff --git a/src/Core/GSEvent.php b/src/Core/GSEvent.php index 0a349e1f23..1336abcaff 100644 --- a/src/Core/GSEvent.php +++ b/src/Core/GSEvent.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * GNU social's event handler wrapper around Symfony's, diff --git a/src/Core/I18n.php b/src/Core/I18n.php index d896888043..d455105372 100644 --- a/src/Core/I18n.php +++ b/src/Core/I18n.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Utility functions for i18n diff --git a/src/Core/Log.php b/src/Core/Log.php index 88bd04cfaf..58dcb36d3e 100644 --- a/src/Core/Log.php +++ b/src/Core/Log.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * GNU social's logger wrapper around Symfony's, diff --git a/src/Core/ModulesManager.php b/src/Core/ModulesManager.php index ef6a3efb15..a08ca2c902 100644 --- a/src/Core/ModulesManager.php +++ b/src/Core/ModulesManager.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Module and plugin loader code, one of the main features of GNU social diff --git a/src/Core/RouteLoader.php b/src/Core/RouteLoader.php index 3e82986044..a9e8344ec6 100644 --- a/src/Core/RouteLoader.php +++ b/src/Core/RouteLoader.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Dynamic router loader and URLMapper interface atop Symfony's router diff --git a/src/Core/SchemaDefDriver.php b/src/Core/SchemaDefDriver.php index 0b3e80a881..8e71260b0f 100644 --- a/src/Core/SchemaDefDriver.php +++ b/src/Core/SchemaDefDriver.php @@ -1,21 +1,22 @@ . - */ +// {{{ License +// This file is part of GNU social - https://www.gnu.org/software/social +// +// GNU social 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. +// +// GNU social 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 GNU social. If not, see . +// }}} + /** * Doctrine metadata driver which implements our old `schemaDef` interface diff --git a/src/Entity/Attention.php b/src/Entity/Attention.php index bd7b06347d..8d856f1d5c 100644 --- a/src/Entity/Attention.php +++ b/src/Entity/Attention.php @@ -1,7 +1,7 @@