diff --git a/.env.example b/.env.example
index ed090d7..51348d7 100644
--- a/.env.example
+++ b/.env.example
@@ -2,6 +2,7 @@ APP_NAME=076Server
APP_ENV=local
APP_KEY=
APP_DEBUG=false
+APP_LOG_LEVEL=debug
APP_URL=http://localhost
ONION_HOST=jkdasfhfdhndsfnklhjfdsknjfdgsjk.onion
SESSION_SECURE_COOKIE=false
@@ -18,6 +19,7 @@ ADMIN_NAME=""
ADMIN_PASS=""
LOG_CHANNEL=stack
+LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
@@ -32,6 +34,8 @@ QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
+MEMCACHED_HOST=127.0.0.1
+
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
@@ -42,6 +46,8 @@ MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
+MAIL_OWNER_ADDRESS=null
+MAIL_OWNER_NAME="${APP_NAME}"
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
@@ -51,4 +57,10 @@ GMO_SECRET=""
CONOHA_DENANT_ID=""
CONOHA_DENANT_NAME=""
CONOHA_USER_NAME=""
-CONOHA_USER_PASS=""
\ No newline at end of file
+CONOHA_USER_PASS=""
+
+YOUTUBE_API=""
+LBRY_URI=""
+PEER_URI=""
+PEER_USER=""
+PEER_PASS=""
\ No newline at end of file
diff --git a/app/Http/Controllers/BashController.php b/app/Http/Controllers/BashController.php
index 09ff50d..5356ae8 100644
--- a/app/Http/Controllers/BashController.php
+++ b/app/Http/Controllers/BashController.php
@@ -28,11 +28,11 @@ class BashController extends Controller {
if (mb_substr($args[$i], 0, 1, 'utf-8')) $opt = $args[$i];
}
- if (strpos($opt, 'l') !== false) {
+ if (str_contains($opt, 'l')) {
$ps = null;
$pg = null;
- if (strpos($opt, 't') !== false) {
+ if (str_contains($opt, 't')) {
$pg = DB::table('blg_content')->select('publish_date')->where('isPost', 0)->orderBy('title', 'asc')->first();
$ps = DB::table('blg_content')->select('publish_date')->where('isPost', 1)->orderBy('title', 'asc')->first();
}
@@ -42,8 +42,8 @@ class BashController extends Controller {
}
return "合計 2
-drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')." ".date('m', $ps->publish_date)."月 ".date('d', $ps->publish_date)." ".date('H:i', $ps->publish_date)." post
-drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')." ".date('m', $pg->publish_date)."月 ".date('d', $pg->publish_date)." ".date('H:i', $pg->publish_date)." page";
+drwxr-xr-x 2 suwako suwako ".(str_contains($opt, 'h') ? '4.0K' : '4096')." ".date('m', $ps->publish_date)."月 ".date('d', $ps->publish_date)." ".date('H:i', $ps->publish_date)." post
+drwxr-xr-x 2 suwako suwako ".(str_contains($opt, 'h') ? '4.0K' : '4096')." ".date('m', $pg->publish_date)."月 ".date('d', $pg->publish_date)." ".date('H:i', $pg->publish_date)." page";
}
return 'post page';
@@ -57,7 +57,7 @@ drwxr-xr-x 2 suwako suwako ".(strpos($opt, 'h') !== false ? '4.0K' : '4096')."
$slug = '';
for ($i = 1; $i < count($cat); $i++) {
- if (strpos($cat[$i], 'post') !== false) $mode = 1;
+ if (str_contains($cat[$i], 'post')) $mode = 1;
$slug = $cat[$i];
}
diff --git a/app/Http/Controllers/Home/Comment.php b/app/Http/Controllers/Home/Comment.php
index a4af3dc..bdd970b 100644
--- a/app/Http/Controllers/Home/Comment.php
+++ b/app/Http/Controllers/Home/Comment.php
@@ -13,7 +13,7 @@ class Comment {
$user = null;
if (isset($_COOKIE['kero_token'])) $user = DB::table('users')->select('id')->where('kero_token', $_COOKIE['kero_token'])->first()->id;
- if ($user == 0 && (strpos($r->newmessage, 'http://') !== false || strpos($r->newmessage, 'https://') !== false)) return redirect('/');
+ if ($user == 0 && (str_contains($r->newmessage, 'http://') || str_contains($r->newmessage, 'https://'))) return redirect('/');
$add = DB::table('blg_comments')->insertGetId([
'user_id' => $user,
diff --git a/app/Http/Controllers/Video/Prayer.php b/app/Http/Controllers/Video/Prayer.php
index 341a7bc..b13cb7b 100644
--- a/app/Http/Controllers/Video/Prayer.php
+++ b/app/Http/Controllers/Video/Prayer.php
@@ -98,6 +98,7 @@ class Prayer extends Engine {
if (!$get) return $err;
$get = json_decode($get);
+ if (isset($get->status) && $get->status == 404) return [];
$come = array();
$come['come'] = array();
@@ -116,7 +117,7 @@ class Prayer extends Engine {
$g->comments->id = $g->id;
$g->comments->name = $g->account->displayName;
$g->comments->channel = $g->account->url;
- $g->comments->icon = env('PEER_URI').$g->account->avatar->path;
+ $g->comments->icon = !is_null($g->account->avatar) ? env('PEER_URI').$g->account->avatar->path : '/img/noicon.jpg';
$g->comments->message = strip_tags($g->text, array('
'));
$g->comments->createdTS = strtotime($g->createdAt);
$g->comments->created = date('Y年m月d日 H:i:s', strtotime($g->createdAt));
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index ee8ca5b..d1f5496 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
+use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
{
@@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
- //
+ Paginator::useBootstrap();
}
}
diff --git a/composer.json b/composer.json
index 29a9d63..9957762 100644
--- a/composer.json
+++ b/composer.json
@@ -8,21 +8,21 @@
],
"license": "MIT",
"require": {
- "php": "^7.2.5",
- "fideloper/proxy": "^4.2",
- "fruitcake/laravel-cors": "^1.0",
- "guzzlehttp/guzzle": "^6.3",
- "laravel/framework": "^7.0",
- "laravel/tinker": "^2.0",
- "phpmailer/phpmailer": "^6.2",
- "predis/predis": "^1.1"
+ "php": "^8.0",
+ "fideloper/proxy": "^4.4.1",
+ "fruitcake/laravel-cors": "^2.0.4",
+ "guzzlehttp/guzzle": "^7.4.0",
+ "laravel/framework": "^8.74.0",
+ "laravel/tinker": "^2.6.2",
+ "phpmailer/phpmailer": "^6.5.3",
+ "predis/predis": "^1.1.9"
},
"require-dev": {
- "facade/ignition": "^2.0",
- "fzaninotto/faker": "^1.9.1",
- "mockery/mockery": "^1.3.1",
- "nunomaduro/collision": "^4.1",
- "phpunit/phpunit": "^8.5"
+ "facade/ignition": "^2.17.2",
+ "fzaninotto/faker": "^1.9.2",
+ "mockery/mockery": "^1.4.4",
+ "nunomaduro/collision": "^5.10.0",
+ "phpunit/phpunit": "^9.5.10"
},
"config": {
"optimize-autoloader": true,
diff --git a/resources/views/pages/site/index.blade.php b/resources/views/pages/site/index.blade.php
index 822d41e..d86df4c 100644
--- a/resources/views/pages/site/index.blade.php
+++ b/resources/views/pages/site/index.blade.php
@@ -4,11 +4,11 @@