Compare commits

..

20 Commits

Author SHA1 Message Date
Dan Brown
578586e51f New translations settings.php (Japanese) 2023-02-06 15:32:31 +00:00
Dan Brown
2e8508592f New translations settings.php (Japanese) 2023-02-06 14:27:21 +00:00
Dan Brown
c06cd368df New translations entities.php (Czech) 2023-02-05 19:55:55 +00:00
Dan Brown
38bc479a8e New translations errors.php (Czech) 2023-02-05 19:55:54 +00:00
Dan Brown
3e7f06d1d1 New translations settings.php (Czech) 2023-02-05 19:55:53 +00:00
Dan Brown
30b547f08e New translations entities.php (Czech) 2023-02-05 18:27:12 +00:00
Dan Brown
ef5808ebdb New translations entities.php (Japanese) 2023-02-05 17:12:20 +00:00
Dan Brown
3827a5e25a New translations errors.php (Japanese) 2023-02-05 17:12:19 +00:00
Dan Brown
0973a1157b New translations settings.php (Japanese) 2023-02-05 17:12:18 +00:00
Dan Brown
42e824fb97 New translations settings.php (Japanese) 2023-02-05 14:41:11 +00:00
Dan Brown
71e6dd7fcc New translations auth.php (Portuguese) 2023-02-03 13:37:41 +00:00
Dan Brown
0a06adbdb8 New translations errors.php (Portuguese) 2023-02-03 13:37:40 +00:00
Dan Brown
a2df9f2273 New translations settings.php (Portuguese) 2023-02-03 13:37:39 +00:00
Dan Brown
571e2ead95 New translations entities.php (Portuguese) 2023-02-03 13:37:38 +00:00
Dan Brown
2fc4dea49f New translations settings.php (Portuguese) 2023-02-03 12:20:28 +00:00
Dan Brown
42fd1719ef New translations common.php (Chinese Simplified) 2023-02-02 17:16:27 +00:00
Dan Brown
2aafa2a1c7 New translations entities.php (Chinese Simplified) 2023-02-02 15:52:35 +00:00
Dan Brown
d59e1a6252 New translations errors.php (Chinese Simplified) 2023-02-02 15:52:34 +00:00
Dan Brown
4cd3802693 New translations settings.php (Chinese Simplified) 2023-02-02 15:52:33 +00:00
Dan Brown
d4c4f4d116 New translations entities.php (Dutch) 2023-02-02 14:50:50 +00:00
619 changed files with 2596 additions and 1747 deletions

View File

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2']
steps:
- uses: actions/checkout@v1

View File

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2']
steps:
- uses: actions/checkout@v1

View File

@ -8,8 +8,6 @@
* Do not edit this file unless you're happy to maintain any changes yourself.
*/
use Illuminate\Support\Facades\Facade;
return [
// The environment to run BookStack in.
@ -100,13 +98,7 @@ return [
// Encryption cipher
'cipher' => 'AES-256-CBC',
// Maintenance Mode Driver
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
// Application Service Providers
// Application Services Provides
'providers' => [
// Laravel Framework Service Providers...
@ -149,9 +141,58 @@ return [
BookStack\Providers\ViewTweaksServiceProvider::class,
],
// Class Aliases
// This array of class aliases to be registered on application start.
'aliases' => Facade::defaultAliases()->merge([
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
// Class aliases, Registered on application start
'aliases' => [
// Laravel
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
// Laravel Packages
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
@ -161,7 +202,7 @@ return [
// Custom BookStack
'Activity' => BookStack\Facades\Activity::class,
'Theme' => BookStack\Facades\Theme::class,
])->toArray(),
],
// Proxy configuration
'proxies' => env('APP_PROXIES', ''),

View File

@ -14,7 +14,7 @@ return [
// This option controls the default broadcaster that will be used by the
// framework when an event needs to be broadcast. This can be set to
// any of the connections defined in the "connections" array below.
'default' => 'null',
'default' => env('BROADCAST_DRIVER', 'pusher'),
// Broadcast Connections
// Here you may define all of the broadcast connections that will be used
@ -22,7 +22,21 @@ return [
// each available type of connection are provided inside this array.
'connections' => [
// Default options removed since we don't use broadcasting.
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',

View File

@ -87,6 +87,6 @@ return [
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
];

View File

@ -33,20 +33,17 @@ return [
'driver' => 'local',
'root' => public_path(),
'visibility' => 'public',
'throw' => true,
],
'local_secure_attachments' => [
'driver' => 'local',
'root' => storage_path('uploads/files/'),
'throw' => true,
],
'local_secure_images' => [
'driver' => 'local',
'root' => storage_path('uploads/images/'),
'visibility' => 'public',
'throw' => true,
],
's3' => [
@ -57,7 +54,6 @@ return [
'bucket' => env('STORAGE_S3_BUCKET', 'your-bucket'),
'endpoint' => env('STORAGE_S3_ENDPOINT', null),
'use_path_style_endpoint' => env('STORAGE_S3_ENDPOINT', null) !== null,
'throw' => true,
],
],

View File

@ -21,15 +21,6 @@ return [
// one of the channels defined in the "channels" configuration array.
'default' => env('LOG_CHANNEL', 'single'),
// Deprecations Log Channel
// This option controls the log channel that should be used to log warnings
// regarding deprecated PHP and library features. This allows you to get
// your application ready for upcoming major versions of dependencies.
'deprecations' => [
'channel' => 'null',
'trace' => false,
],
// Log Channels
// Here you may configure the log channels for your application. Out of
// the box, Laravel uses the Monolog PHP logging library. This gives

View File

@ -14,7 +14,13 @@ return [
// From Laravel 7+ this is MAIL_MAILER in laravel.
// Kept as MAIL_DRIVER in BookStack to prevent breaking change.
// Options: smtp, sendmail, log, array
'default' => env('MAIL_DRIVER', 'smtp'),
'driver' => env('MAIL_DRIVER', 'smtp'),
// SMTP host address
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
// SMTP host port
'port' => env('MAIL_PORT', 587),
// Global "From" address & name
'from' => [
@ -22,42 +28,17 @@ return [
'name' => env('MAIL_FROM_NAME', 'BookStack'),
],
// Mailer Configurations
// Available mailing methods and their settings.
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
// Email encryption protocol
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
// SMTP server username
'username' => env('MAIL_USERNAME'),
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
// SMTP server password
'password' => env('MAIL_PASSWORD'),
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
],
// Sendmail application path
'sendmail' => '/usr/sbin/sendmail -bs',
// Email markdown configuration
'markdown' => [
@ -66,4 +47,11 @@ return [
resource_path('views/vendor/mail'),
],
],
// Log Channel
// If you are using the "log" driver, you may specify the logging channel
// if you prefer to keep mail messages separate from other log entries
// for simpler reading. Otherwise, the default channel will be used.
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

View File

@ -2,18 +2,18 @@
namespace BookStack\Entities\Tools\Markdown;
use League\CommonMark\Extension\CommonMark\Node\Block\ListItem;
use League\CommonMark\Extension\CommonMark\Renderer\Block\ListItemRenderer;
use League\CommonMark\Block\Element\AbstractBlock;
use League\CommonMark\Block\Element\ListItem;
use League\CommonMark\Block\Element\Paragraph;
use League\CommonMark\Block\Renderer\BlockRendererInterface;
use League\CommonMark\Block\Renderer\ListItemRenderer;
use League\CommonMark\ElementRendererInterface;
use League\CommonMark\Extension\TaskList\TaskListItemMarker;
use League\CommonMark\Node\Block\Paragraph;
use League\CommonMark\Node\Node;
use League\CommonMark\Renderer\ChildNodeRendererInterface;
use League\CommonMark\Renderer\NodeRendererInterface;
use League\CommonMark\Util\HtmlElement;
use League\CommonMark\HtmlElement;
class CustomListItemRenderer implements NodeRendererInterface
class CustomListItemRenderer implements BlockRendererInterface
{
protected ListItemRenderer $baseRenderer;
protected $baseRenderer;
public function __construct()
{
@ -23,11 +23,11 @@ class CustomListItemRenderer implements NodeRendererInterface
/**
* @return HtmlElement|string|null
*/
public function render(Node $node, ChildNodeRendererInterface $childRenderer)
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, bool $inTightList = false)
{
$listItem = $this->baseRenderer->render($node, $childRenderer);
$listItem = $this->baseRenderer->render($block, $htmlRenderer, $inTightList);
if ($node instanceof ListItem && $this->startsTaskListItem($node) && $listItem instanceof HtmlElement) {
if ($this->startsTaskListItem($block)) {
$listItem->setAttribute('class', 'task-list-item');
}

View File

@ -2,16 +2,16 @@
namespace BookStack\Entities\Tools\Markdown;
use League\CommonMark\Environment\EnvironmentBuilderInterface;
use League\CommonMark\ConfigurableEnvironmentInterface;
use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\Extension\Strikethrough\Strikethrough;
use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;
class CustomStrikeThroughExtension implements ExtensionInterface
{
public function register(EnvironmentBuilderInterface $environment): void
public function register(ConfigurableEnvironmentInterface $environment)
{
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
$environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
$environment->addInlineRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
}
}

View File

@ -2,23 +2,25 @@
namespace BookStack\Entities\Tools\Markdown;
use League\CommonMark\ElementRendererInterface;
use League\CommonMark\Extension\Strikethrough\Strikethrough;
use League\CommonMark\Node\Node;
use League\CommonMark\Renderer\ChildNodeRendererInterface;
use League\CommonMark\Renderer\NodeRendererInterface;
use League\CommonMark\Util\HtmlElement;
use League\CommonMark\HtmlElement;
use League\CommonMark\Inline\Element\AbstractInline;
use League\CommonMark\Inline\Renderer\InlineRendererInterface;
/**
* This is a somewhat clone of the League\CommonMark\Extension\Strikethrough\StrikethroughRender
* class but modified slightly to use <s> HTML tags instead of <del> in order to
* match front-end markdown-it rendering.
*/
class CustomStrikethroughRenderer implements NodeRendererInterface
class CustomStrikethroughRenderer implements InlineRendererInterface
{
public function render(Node $node, ChildNodeRendererInterface $childRenderer)
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
{
Strikethrough::assertInstanceOf($node);
if (!($inline instanceof Strikethrough)) {
throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline));
}
return new HtmlElement('s', $node->data->get('attributes'), $childRenderer->renderNodes($node->children()));
return new HtmlElement('s', $inline->getData('attributes', []), $htmlRenderer->renderInlines($inline->children()));
}
}

View File

@ -4,9 +4,8 @@ namespace BookStack\Entities\Tools\Markdown;
use BookStack\Facades\Theme;
use BookStack\Theming\ThemeEvents;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\Extension\CommonMark\Node\Block\ListItem;
use League\CommonMark\Block\Element\ListItem;
use League\CommonMark\Environment;
use League\CommonMark\Extension\Table\TableExtension;
use League\CommonMark\Extension\TaskList\TaskListExtension;
use League\CommonMark\MarkdownConverter;
@ -22,16 +21,15 @@ class MarkdownToHtml
public function convert(): string
{
$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new TableExtension());
$environment->addExtension(new TaskListExtension());
$environment->addExtension(new CustomStrikeThroughExtension());
$environment = Theme::dispatch(ThemeEvents::COMMONMARK_ENVIRONMENT_CONFIGURE, $environment) ?? $environment;
$converter = new MarkdownConverter($environment);
$environment->addRenderer(ListItem::class, new CustomListItemRenderer(), 10);
$environment->addBlockRenderer(ListItem::class, new CustomListItemRenderer(), 10);
return $converter->convert($this->markdown)->getContent();
return $converter->convertToHtml($this->markdown);
}
}

View File

@ -17,7 +17,7 @@ class Handler extends ExceptionHandler
/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<\Throwable>>
* @var array
*/
protected $dontReport = [
NotFoundException::class,
@ -25,9 +25,9 @@ class Handler extends ExceptionHandler
];
/**
* A list of the inputs that are never flashed to the session on validation exceptions.
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
* @var array
*/
protected $dontFlash = [
'current_password',
@ -98,7 +98,6 @@ class Handler extends ExceptionHandler
];
if ($e instanceof ValidationException) {
$responseData['error']['message'] = 'The given data was invalid.';
$responseData['error']['validation'] = $e->errors();
$code = $e->status;
}

View File

@ -2,18 +2,25 @@
namespace BookStack\Exceptions;
use Illuminate\Contracts\Foundation\ExceptionRenderer;
use Whoops\Handler\Handler;
class BookStackExceptionHandlerPage implements ExceptionRenderer
class WhoopsBookStackPrettyHandler extends Handler
{
public function render($throwable)
/**
* @return int|null A handler may return nothing, or a Handler::HANDLE_* constant
*/
public function handle()
{
return view('errors.debug', [
'error' => $throwable->getMessage(),
'errorClass' => get_class($throwable),
'trace' => $throwable->getTraceAsString(),
$exception = $this->getException();
echo view('errors.debug', [
'error' => $exception->getMessage(),
'errorClass' => get_class($exception),
'trace' => $exception->getTraceAsString(),
'environment' => $this->getEnvironment(),
])->render();
return Handler::QUIT;
}
protected function safeReturn(callable $callback, $default = null)

View File

@ -9,8 +9,10 @@ class Request extends LaravelRequest
/**
* Override the default request methods to get the scheme and host
* to directly use the custom APP_URL, if set.
*
* @return string
*/
public function getSchemeAndHttpHost(): string
public function getSchemeAndHttpHost()
{
$appUrl = config('app.url', null);
@ -25,8 +27,10 @@ class Request extends LaravelRequest
* Override the default request methods to get the base URL
* to directly use the custom APP_URL, if set.
* The base URL never ends with a / but should start with one if not empty.
*
* @return string
*/
public function getBaseUrl(): string
public function getBaseUrl()
{
$appUrl = config('app.url', null);

View File

@ -8,16 +8,16 @@ use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Bookshelf;
use BookStack\Entities\Models\Chapter;
use BookStack\Entities\Models\Page;
use BookStack\Exceptions\BookStackExceptionHandlerPage;
use BookStack\Exceptions\WhoopsBookStackPrettyHandler;
use BookStack\Settings\SettingService;
use BookStack\Util\CspService;
use GuzzleHttp\Client;
use Illuminate\Contracts\Foundation\ExceptionRenderer;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Psr\Http\Client\ClientInterface as HttpClientInterface;
use Whoops\Handler\HandlerInterface;
class AppServiceProvider extends ServiceProvider
{
@ -26,7 +26,7 @@ class AppServiceProvider extends ServiceProvider
* @var string[]
*/
public $bindings = [
ExceptionRenderer::class => BookStackExceptionHandlerPage::class,
HandlerInterface::class => WhoopsBookStackPrettyHandler::class,
];
/**

View File

@ -24,22 +24,11 @@ class EventServiceProvider extends ServiceProvider
];
/**
* Register any events for your application.
* Register any other events for your application.
*
* @return void
*/
public function boot()
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}

View File

@ -77,7 +77,7 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}

View File

@ -65,8 +65,8 @@ class ThemeEvents
* Provides the commonmark library environment for customization before it's used to render markdown content.
* If the listener returns a non-null value, that will be used as an environment instead.
*
* @param \League\CommonMark\Environment\Environment $environment
* @returns \League\CommonMark\Environment\Environment|null
* @param \League\CommonMark\ConfigurableEnvironmentInterface $environment
* @returns \League\CommonMark\ConfigurableEnvironmentInterface|null
*/
const COMMONMARK_ENVIRONMENT_CONFIGURE = 'commonmark_environment_configure';

View File

@ -9,7 +9,7 @@ use Illuminate\Contracts\Filesystem\Filesystem as Storage;
use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use League\Flysystem\WhitespacePathNormalizer;
use League\Flysystem\Util;
use Symfony\Component\HttpFoundation\File\UploadedFile;
class AttachmentService
@ -54,7 +54,7 @@ class AttachmentService
*/
protected function adjustPathForStorageDisk(string $path): string
{
$path = (new WhitespacePathNormalizer())->normalizePath(str_replace('uploads/files/', '', $path));
$path = Util::normalizePath(str_replace('uploads/files/', '', $path));
if ($this->getStorageDiskName() === 'local_secure_attachments') {
return $path;

View File

@ -20,7 +20,7 @@ use Illuminate\Support\Str;
use Intervention\Image\Exception\NotSupportedException;
use Intervention\Image\Image as InterventionImage;
use Intervention\Image\ImageManager;
use League\Flysystem\WhitespacePathNormalizer;
use League\Flysystem\Util;
use Psr\SimpleCache\InvalidArgumentException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\StreamedResponse;
@ -29,9 +29,10 @@ class ImageService
{
protected ImageManager $imageTool;
protected Cache $cache;
protected $storageUrl;
protected FilesystemManager $fileSystem;
protected static array $supportedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
protected static $supportedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
public function __construct(ImageManager $imageTool, FilesystemManager $fileSystem, Cache $cache)
{
@ -72,7 +73,7 @@ class ImageService
*/
protected function adjustPathForStorageDisk(string $path, string $imageType = ''): string
{
$path = (new WhitespacePathNormalizer())->normalizePath(str_replace('uploads/images/', '', $path));
$path = Util::normalizePath(str_replace('uploads/images/', '', $path));
if ($this->usingSecureImages($imageType)) {
return $path;
@ -547,7 +548,7 @@ class ImageService
// Check the image file exists
&& $disk->exists($imagePath)
// Check the file is likely an image file
&& strpos($disk->mimeType($imagePath), 'image/') === 0;
&& strpos($disk->getMimetype($imagePath), 'image/') === 0;
}
/**
@ -660,21 +661,25 @@ class ImageService
*/
private function getPublicUrl(string $filePath): string
{
$storageUrl = config('filesystems.url');
if (is_null($this->storageUrl)) {
$storageUrl = config('filesystems.url');
// Get the standard public s3 url if s3 is set as storage type
// Uses the nice, short URL if bucket name has no periods in otherwise the longer
// region-based url will be used to prevent http issues.
if (!$storageUrl && config('filesystems.images') === 's3') {
$storageDetails = config('filesystems.disks.s3');
if (strpos($storageDetails['bucket'], '.') === false) {
$storageUrl = 'https://' . $storageDetails['bucket'] . '.s3.amazonaws.com';
} else {
$storageUrl = 'https://s3-' . $storageDetails['region'] . '.amazonaws.com/' . $storageDetails['bucket'];
// Get the standard public s3 url if s3 is set as storage type
// Uses the nice, short URL if bucket name has no periods in otherwise the longer
// region-based url will be used to prevent http issues.
if ($storageUrl == false && config('filesystems.images') === 's3') {
$storageDetails = config('filesystems.disks.s3');
if (strpos($storageDetails['bucket'], '.') === false) {
$storageUrl = 'https://' . $storageDetails['bucket'] . '.s3.amazonaws.com';
} else {
$storageUrl = 'https://s3-' . $storageDetails['region'] . '.amazonaws.com/' . $storageDetails['bucket'];
}
}
$this->storageUrl = $storageUrl;
}
$basePath = $storageUrl ?: url('/');
$basePath = ($this->storageUrl == false) ? url('/') : $this->storageUrl;
return rtrim($basePath, '/') . $filePath;
}

View File

@ -130,7 +130,7 @@ class LanguageManager
]);
if (!empty($locales)) {
setlocale(LC_TIME, $locales[0], ...array_slice($locales, 1));
setlocale(LC_TIME, ...$locales);
}
}
}

View File

@ -8,7 +8,7 @@
"license": "MIT",
"type": "project",
"require": {
"php": "^8.0.2",
"php": "^7.4|^8.0",
"ext-curl": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
@ -19,34 +19,36 @@
"bacon/bacon-qr-code": "^2.0",
"barryvdh/laravel-dompdf": "^2.0",
"barryvdh/laravel-snappy": "^1.0",
"doctrine/dbal": "^3.5",
"doctrine/dbal": "^3.1",
"filp/whoops": "^2.14",
"guzzlehttp/guzzle": "^7.4",
"intervention/image": "^2.7",
"laravel/framework": "^9.0",
"laravel/framework": "^8.68",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.6",
"league/commonmark": "^2.3",
"league/flysystem-aws-s3-v3": "^3.0",
"league/commonmark": "^1.6",
"league/flysystem-aws-s3-v3": "^1.0.29",
"league/html-to-markdown": "^5.0.0",
"league/oauth2-client": "^2.6",
"onelogin/php-saml": "^4.0",
"phpseclib/phpseclib": "^3.0",
"phpseclib/phpseclib": "~3.0",
"pragmarx/google2fa": "^8.0",
"predis/predis": "^2.1",
"predis/predis": "^1.1",
"socialiteproviders/discord": "^4.1",
"socialiteproviders/gitlab": "^4.1",
"socialiteproviders/microsoft-azure": "^5.1",
"socialiteproviders/okta": "^4.2",
"socialiteproviders/microsoft-azure": "^5.0.1",
"socialiteproviders/okta": "^4.1",
"socialiteproviders/slack": "^4.1",
"socialiteproviders/twitch": "^5.3",
"ssddanbrown/htmldiff": "^1.0.2"
},
"require-dev": {
"fakerphp/faker": "^1.21",
"brianium/paratest": "^6.6",
"fakerphp/faker": "^1.16",
"itsgoingd/clockwork": "^5.1",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^6.4",
"nunomaduro/larastan": "^2.4",
"mockery/mockery": "^1.4",
"nunomaduro/collision": "^5.10",
"nunomaduro/larastan": "^1.0",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7",
"ssddanbrown/asserthtml": "^1.0"
@ -71,6 +73,7 @@
"format": "phpcbf",
"lint": "phpcs",
"test": "phpunit",
"t": "@php artisan test --parallel",
"t-reset": "@php artisan test --recreate-databases",
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
@ -99,7 +102,7 @@
"preferred-install": "dist",
"sort-packages": true,
"platform": {
"php": "8.0.2"
"php": "7.4.0"
}
},
"extra": {
@ -107,6 +110,6 @@
"dont-discover": []
}
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true
}

3610
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,6 @@ pull_request_title: Updated translations with latest Crowdin changes
pull_request_labels:
- ":earth_africa: Translations"
files:
- source: /lang/en/*.php
translation: /lang/%two_letters_code%/%original_file_name%
- source: /resources/lang/en/*.php
translation: /resources/lang/%two_letters_code%/%original_file_name%
type: php

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
@ -40,4 +40,4 @@ return new class extends Migration
{
Schema::drop('users');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
@ -28,4 +28,4 @@ return new class extends Migration
{
Schema::drop('password_resets');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateBooksTable extends Migration
{
/**
* Run the migrations.
@ -30,4 +30,4 @@ return new class extends Migration
{
Schema::drop('books');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
@ -34,4 +34,4 @@ return new class extends Migration
{
Schema::drop('pages');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateImagesTable extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
{
Schema::drop('images');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateChaptersTable extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ return new class extends Migration
{
Schema::drop('chapters');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddUsersToEntities extends Migration
{
/**
* Run the migrations.
@ -54,4 +54,4 @@ return new class extends Migration
$table->dropColumn('updated_by');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreatePageRevisionsTable extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ return new class extends Migration
{
Schema::drop('page_revisions');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateActivitiesTable extends Migration
{
/**
* Run the migrations.
@ -33,4 +33,4 @@ return new class extends Migration
{
Schema::drop('activities');
}
};
}

View File

@ -1,5 +1,8 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Much of this code has been taken from entrust,
* a role & permission management solution for Laravel.
@ -9,11 +12,7 @@
* @license MIT
* @url https://github.com/Zizaco/entrust
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddRolesAndPermissions extends Migration
{
/**
* Run the migrations.
@ -148,4 +147,4 @@ return new class extends Migration
Schema::drop('role_user');
Schema::drop('roles');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
@ -28,4 +28,4 @@ return new class extends Migration
{
Schema::drop('settings');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddSearchIndexes extends Migration
{
/**
* Run the migrations.
@ -51,4 +51,4 @@ return new class extends Migration
});
}
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateSocialAccountsTable extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ return new class extends Migration
{
Schema::drop('social_accounts');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddEmailConfirmationTable extends Migration
{
/**
* Run the migrations.
@ -36,4 +36,4 @@ return new class extends Migration
});
Schema::drop('email_confirmations');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateViewsTable extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ return new class extends Migration
{
Schema::drop('views');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddEntityIndexes extends Migration
{
/**
* Run the migrations.
@ -86,4 +86,4 @@ return new class extends Migration
$table->dropIndex('views_viewable_id_index');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class FulltextWeighting extends Migration
{
/**
* Run the migrations.
@ -51,4 +51,4 @@ return new class extends Migration
});
}
}
};
}

View File

@ -4,7 +4,7 @@ use BookStack\Uploads\Image;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddImageUploadTypes extends Migration
{
/**
* Run the migrations.
@ -37,4 +37,4 @@ return new class extends Migration
$table->dropColumn('path');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddUserAvatars extends Migration
{
/**
* Run the migrations.
@ -28,4 +28,4 @@ return new class extends Migration
$table->dropColumn('image_id');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddExternalAuthToUsers extends Migration
{
/**
* Run the migrations.
@ -28,4 +28,4 @@ return new class extends Migration
$table->dropColumn('external_auth_id');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddSlugToRevisions extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ return new class extends Migration
$table->dropColumn('book_slug');
});
}
};
}

View File

@ -2,7 +2,7 @@
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
class UpdatePermissionsAndRoles extends Migration
{
/**
* Run the migrations.
@ -113,4 +113,4 @@ return new class extends Migration
}
}
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddEntityAccessControls extends Migration
{
/**
* Run the migrations.
@ -69,4 +69,4 @@ return new class extends Migration
Schema::drop('restrictions');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddPageRevisionTypes extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('type');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddPageDrafts extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('draft');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class AddMarkdownSupport extends Migration
{
/**
* Run the migrations.
@ -36,4 +36,4 @@ return new class extends Migration
$table->dropColumn('markdown');
});
}
};
}

View File

@ -2,7 +2,7 @@
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
class AddViewPermissionsToRoles extends Migration
{
/**
* Run the migrations.
@ -54,4 +54,4 @@ return new class extends Migration
}
}
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Str;
return new class extends Migration
class CreateJointPermissionsTable extends Migration
{
/**
* Run the migrations.
@ -97,4 +97,4 @@ return new class extends Migration
$table->dropColumn('hidden');
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
@ -37,4 +37,4 @@ return new class extends Migration
{
Schema::drop('tags');
}
};
}

View File

@ -2,7 +2,7 @@
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
class AddSummaryToPageRevisions extends Migration
{
/**
* Run the migrations.
@ -27,4 +27,4 @@ return new class extends Migration
$table->dropColumn('summary');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class RemoveHiddenRoles extends Migration
{
/**
* Run the migrations.
@ -63,4 +63,4 @@ return new class extends Migration
DB::table('roles')->where('system_name', '=', 'public')->update(['hidden' => true]);
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateAttachmentsTable extends Migration
{
/**
* Run the migrations.
@ -67,4 +67,4 @@ return new class extends Migration
DB::table('role_permissions')->where('name', '=', $permName)->delete();
}
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateCacheTable extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
{
Schema::dropIfExists('cache');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateSessionsTable extends Migration
{
/**
* Run the migrations.
@ -32,4 +32,4 @@ return new class extends Migration
{
Schema::dropIfExists('sessions');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateSearchIndexTable extends Migration
{
/**
* Run the migrations.
@ -73,4 +73,4 @@ return new class extends Migration
Schema::dropIfExists('search_terms');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddRevisionCounts extends Migration
{
/**
* Run the migrations.
@ -41,4 +41,4 @@ return new class extends Migration
$table->dropColumn('revision_number');
});
}
};
}

View File

@ -2,7 +2,7 @@
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
class UpdateDbEncodingToUt8mb4 extends Migration
{
/**
* Run the migrations.
@ -25,4 +25,4 @@ return new class extends Migration
{
//
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
@ -64,4 +64,4 @@ return new class extends Migration
DB::table('role_permissions')->where('name', '=', $permName)->delete();
}
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddCoverImageDisplay extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('image_id');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddRoleExternalAuthId extends Migration
{
/**
* Run the migrations.
@ -30,4 +30,4 @@ return new class extends Migration
$table->dropColumn('external_auth_id');
});
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateBookshelvesTable extends Migration
{
/**
* Run the migrations.
@ -128,4 +128,4 @@ return new class extends Migration
DB::table('search_terms')->where('entity_type', '=', 'BookStack\Entities\Models\Bookshelf')->delete();
DB::table('comments')->where('entity_type', '=', 'BookStack\Entities\Models\Bookshelf')->delete();
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddTemplateSupport extends Migration
{
/**
* Run the migrations.
@ -51,4 +51,4 @@ return new class extends Migration
DB::table('permission_role')->where('permission_id', '=', $templatesManagePermission->id)->delete();
DB::table('role_permissions')->where('name', '=', 'templates-manage')->delete();
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddUserInvitesTable extends Migration
{
/**
* Run the migrations.
@ -30,4 +30,4 @@ return new class extends Migration
{
Schema::dropIfExists('user_invites');
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddApiAuth extends Migration
{
/**
* Run the migrations.
@ -57,4 +57,4 @@ return new class extends Migration
DB::table('permission_role')->where('permission_id', '=', $apiAccessPermission->id)->delete();
DB::table('role_permissions')->where('name', '=', 'access-api')->delete();
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class DropJointPermissionsId extends Migration
{
/**
* Run the migrations.
@ -34,4 +34,4 @@ return new class extends Migration
$table->increments('id')->unsigned();
});
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class RemoveRoleNameField extends Migration
{
/**
* Run the migrations.
@ -34,4 +34,4 @@ return new class extends Migration
'name' => DB::raw("lower(replace(`display_name`, ' ', '-'))"),
]);
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddActivityIndexes extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ return new class extends Migration
$table->dropIndex('activities_created_at_index');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddEntitySoftDeletes extends Migration
{
/**
* Run the migrations.
@ -47,4 +47,4 @@ return new class extends Migration
$table->dropSoftDeletes();
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateDeletionsTable extends Migration
{
/**
* Run the migrations.
@ -35,4 +35,4 @@ return new class extends Migration
{
Schema::dropIfExists('deletions');
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class SimplifyActivitiesTable extends Migration
{
/**
* Run the migrations.
@ -55,4 +55,4 @@ return new class extends Migration
$table->index('book_id');
});
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddOwnedByFieldToEntities extends Migration
{
/**
* Run the migrations.
@ -46,4 +46,4 @@ return new class extends Migration
$table->renameColumn('owned_by', 'created_by');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddSettingsTypeColumn extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('type');
});
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
return new class extends Migration
class AddUserSlug extends Migration
{
/**
* Run the migrations.
@ -47,4 +47,4 @@ return new class extends Migration
$table->dropColumn('slug');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateFavouritesTable extends Migration
{
/**
* Run the migrations.
@ -33,4 +33,4 @@ return new class extends Migration
{
Schema::dropIfExists('favourites');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateMfaValuesTable extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ return new class extends Migration
{
Schema::dropIfExists('mfa_values');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddMfaEnforcedToRolesTable extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('mfa_enforced');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Carbon\Carbon;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
class AddExportRolePermission extends Migration
{
/**
* Run the migrations.
@ -46,4 +46,4 @@ return new class extends Migration
DB::table('permission_role')->where('permission_id', '=', $contentExportPermission->id)->delete();
DB::table('role_permissions')->where('id', '=', 'content-export')->delete();
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddActivitiesIpColumn extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropColumn('ip');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddIndexForUserIp extends Migration
{
/**
* Run the migrations.
@ -29,4 +29,4 @@ return new class extends Migration
$table->dropIndex('activities_ip_index');
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateWebhooksTable extends Migration
{
/**
* Run the migrations.
@ -45,4 +45,4 @@ return new class extends Migration
Schema::dropIfExists('webhooks');
Schema::dropIfExists('webhook_tracked_events');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
@ -33,4 +33,4 @@ return new class extends Migration
{
Schema::dropIfExists('jobs');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
@ -33,4 +33,4 @@ return new class extends Migration
{
Schema::dropIfExists('failed_jobs');
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddWebhooksTimeoutErrorColumns extends Migration
{
/**
* Run the migrations.
@ -35,4 +35,4 @@ return new class extends Migration
$table->dropColumn('last_errored_at');
});
}
};
}

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class AddEditorChangeFieldAndPermission extends Migration
{
/**
* Run the migrations.
@ -59,4 +59,4 @@ return new class extends Migration
// Remove traces of the role permission
DB::table('role_permissions')->where('name', '=', 'editor-change')->delete();
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
class UpdatePolymorphicTypes extends Migration
{
/**
* Mapping of old polymorphic types to new simpler values.
@ -61,4 +61,4 @@ return new class extends Migration
}
}
}
};
}

View File

@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class DropJointPermissionType extends Migration
{
/**
* Run the migrations.
@ -38,4 +38,4 @@ return new class extends Migration
$table->primary(['role_id', 'entity_type', 'entity_id', 'action']);
});
}
};
}

View File

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class CreateReferencesTable extends Migration
{
/**
* Run the migrations.
@ -31,4 +31,4 @@ return new class extends Migration
{
Schema::dropIfExists('references');
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
class FixShelfCoverImageTypes extends Migration
{
/**
* Run the migrations.
@ -41,4 +41,4 @@ return new class extends Migration
->where('type', '=', 'cover_bookshelf')
->update(['type' => 'cover_book']);
}
};
}

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class FlattenEntityPermissionsTable extends Migration
{
/**
* Run the migrations.
@ -102,4 +102,4 @@ return new class extends Migration
Schema::dropIfExists('entity_permissions');
Schema::rename('old_entity_permissions', 'entity_permissions');
}
};
}

View File

@ -7,7 +7,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class DropEntityRestrictedField extends Migration
{
/**
* Run the migrations.
@ -90,4 +90,4 @@ return new class extends Migration
// Delete default entity permissions
DB::table('entity_permissions')->where('role_id', '=', 0)->delete();
}
};
}

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
class RefactorJointPermissionsStorage extends Migration
{
/**
* Run the migrations.
@ -49,4 +49,4 @@ return new class extends Migration
$table->unsignedInteger('owned_by')->index();
});
}
};
}

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
class CopyColorSettingsForDarkMode extends Migration
{
/**
* Run the migrations.
@ -66,4 +66,4 @@ return new class extends Migration
->whereIn('setting_key', $colorSettings)
->delete();
}
};
}

View File

@ -9,7 +9,7 @@ parameters:
# The level 8 is the highest level
level: 1
phpVersion: 80002
phpVersion: 70400
bootstrapFiles:
- bootstrap/phpstan.php

View File

@ -32,7 +32,6 @@
<server name="AUTH_AUTO_INITIATE" value="false"/>
<server name="DISABLE_EXTERNAL_SERVICES" value="true"/>
<server name="ALLOW_UNTRUSTED_SERVER_FETCHING" value="false"/>
<server name="ALLOW_CONTENT_SCRIPTS" value="false"/>
<server name="AVATAR_URL" value=""/>
<server name="LDAP_START_TLS" value="false"/>
<server name="LDAP_VERSION" value="3"/>

Some files were not shown because too many files have changed in this diff Show More