1
0
Эх сурвалжийг харах

Merge pull request #2491 from pixelfed/staging

Update laravel framework to v8
daniel 4 жил өмнө
parent
commit
0ccd30b032

+ 4 - 11
app/Providers/AppServiceProvider.php

@@ -22,6 +22,7 @@ use Auth, Horizon, URL;
 use Illuminate\Support\Facades\Blade;
 use Illuminate\Support\Facades\Schema;
 use Illuminate\Support\ServiceProvider;
+use Illuminate\Pagination\Paginator;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -35,6 +36,8 @@ class AppServiceProvider extends ServiceProvider
         URL::forceScheme('https');
         Schema::defaultStringLength(191);
 
+        Paginator::useBootstrap();
+
         Avatar::observe(AvatarObserver::class);
         Notification::observe(NotificationObserver::class);
         ModLog::observe(ModLogObserver::class);
@@ -47,17 +50,7 @@ class AppServiceProvider extends ServiceProvider
         });
 
         Blade::directive('prettyNumber', function ($expression) {
-            $num = $expression;
-            $abbrevs = [12 => 'T', 9 => 'B', 6 => 'M', 3 => 'K', 0 => ''];
-            foreach ($abbrevs as $exponent => $abbrev) {
-                if ($expression >= pow(10, $exponent)) {
-                    $display_num = $expression / pow(10, $exponent);
-                    $num = number_format($display_num, 0).$abbrev;
-
-                    return "<?php echo '$num'; ?>";
-                }
-            }
-
+            $num = \App\Util\Lexer\PrettyNumber::convert($expression);
             return "<?php echo $num; ?>";
         });
 

+ 7 - 7
composer.json

@@ -5,7 +5,7 @@
     "license": "AGPL-3.0-only",
     "type": "project",
     "require": {
-        "php": "^7.2",
+        "php": "^7.3",
         "ext-bcmath": "*",
         "ext-ctype": "*",
         "ext-curl": "*",
@@ -21,10 +21,10 @@
         "fruitcake/laravel-cors": "^2.0",
         "intervention/image": "^2.4",
         "jenssegers/agent": "^2.6",
-        "laravel/framework": "^7.0",
+        "laravel/framework": "^8.0",
         "laravel/helpers": "^1.1",
-        "laravel/horizon": "^4.0",
-        "laravel/passport": "^8.0",
+        "laravel/horizon": "^5.0",
+        "laravel/passport": "^10.0",
         "laravel/tinker": "^2.0",
         "laravel/ui": "^2.0",
         "league/flysystem-aws-s3-v3": "~1.0",
@@ -44,11 +44,11 @@
         "symfony/http-kernel": "5.1.5"
     },
     "require-dev": {
-        "facade/ignition": "^2.0",
+        "facade/ignition": "^2.3.6",
         "fzaninotto/faker": "^1.4",
         "mockery/mockery": "^1.0",
-        "nunomaduro/collision": "^4.1",
-        "phpunit/phpunit": "^8.5"
+        "nunomaduro/collision": "^5.0",
+        "phpunit/phpunit": "^9.0"
     },
     "autoload": {
         "classmap": [

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 391 - 397
composer.lock


+ 32 - 0
database/migrations/2020_12_13_203138_add_uuids_to_failed_jobs_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddUuidsToFailedJobsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('failed_jobs', function (Blueprint $table) {
+            $table->string('uuid')->after('id')->nullable()->unique();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('failed_jobs', function (Blueprint $table) {
+            $table->dropColumn('uuid');
+        });
+    }
+}

+ 32 - 0
database/migrations/2020_12_13_203646_add_providers_column_to_oauth_clients_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddProvidersColumnToOauthClientsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('oauth_clients', function (Blueprint $table) {
+            $table->string('provider')->after('secret')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('oauth_clients', function (Blueprint $table) {
+            $table->dropColumn('provider');
+        });
+    }
+}

+ 31 - 30
phpunit.xml

@@ -1,32 +1,33 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="false"
-         backupStaticAttributes="false"
-         bootstrap="vendor/autoload.php"
-         colors="true"
-         convertErrorsToExceptions="true"
-         convertNoticesToExceptions="true"
-         convertWarningsToExceptions="true"
-         processIsolation="false"
-         stopOnFailure="false">
-    <testsuites>
-        <testsuite name="Feature">
-            <directory suffix="Test.php">./tests/Feature</directory>
-        </testsuite>
-
-        <testsuite name="Unit">
-            <directory suffix="Test.php">./tests/Unit</directory>
-        </testsuite>
-    </testsuites>
-    <filter>
-        <whitelist processUncoveredFilesFromWhitelist="true">
-            <directory suffix=".php">./app</directory>
-        </whitelist>
-    </filter>
-    <php>
-        <env name="APP_ENV" value="testing"/>
-        <env name="CACHE_DRIVER" value="array"/>
-        <env name="SESSION_DRIVER" value="array"/>
-        <env name="QUEUE_DRIVER" value="sync"/>
-        <env name="MAIL_DRIVER" value="array"/>
-    </php>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    backupGlobals="false" 
+    backupStaticAttributes="false" 
+    bootstrap="vendor/autoload.php" 
+    colors="true" 
+    convertErrorsToExceptions="true" 
+    convertNoticesToExceptions="true" 
+    convertWarningsToExceptions="true" 
+    processIsolation="false" 
+    stopOnFailure="false" 
+    xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+  <coverage processUncoveredFiles="true">
+    <include>
+      <directory suffix=".php">./app</directory>
+    </include>
+  </coverage>
+  <testsuites>
+    <testsuite name="Feature">
+      <directory suffix="Test.php">./tests/Feature</directory>
+    </testsuite>
+    <testsuite name="Unit">
+      <directory suffix="Test.php">./tests/Unit</directory>
+    </testsuite>
+  </testsuites>
+  <php>
+    <env name="APP_ENV" value="testing"/>
+    <env name="CACHE_DRIVER" value="array"/>
+    <env name="SESSION_DRIVER" value="array"/>
+    <env name="QUEUE_DRIVER" value="sync"/>
+    <env name="MAIL_DRIVER" value="array"/>
+  </php>
 </phpunit>

+ 4 - 0
public/index.php

@@ -7,6 +7,10 @@
  */
 define('LARAVEL_START', microtime(true));
 
+if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
+    require __DIR__.'/../storage/framework/maintenance.php';
+}
+
 /*
 |--------------------------------------------------------------------------
 | Register The Auto Loader

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно