Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\Listeners; use App\Events\MediaSyncCompleted; use App\Values\SyncRes..
Decoded Output download
<?php
namespace App\Listeners;
use App\Events\MediaSyncCompleted;
use App\Values\SyncResult;
use Illuminate\Support\Collection;
use Throwable;
class WriteSyncLog
{
public function handle(MediaSyncCompleted $event): void
{
$transformer = static fn (SyncResult $entry) => (string) $entry;
/** @var Collection $messages */
$messages = config('koel.sync_log_level') === 'all'
? $event->results->map($transformer)
: $event->results->error()->map($transformer);
try {
$file = storage_path('logs/sync-' . now()->format('Ymd-His') . '.log');
file_put_contents($file, implode(PHP_EOL, $messages->toArray()));
} catch (Throwable) {
}
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace App\Listeners;
use App\Events\MediaSyncCompleted;
use App\Values\SyncResult;
use Illuminate\Support\Collection;
use Throwable;
class WriteSyncLog
{
public function handle(MediaSyncCompleted $event): void
{
$transformer = static fn (SyncResult $entry) => (string) $entry;
/** @var Collection $messages */
$messages = config('koel.sync_log_level') === 'all'
? $event->results->map($transformer)
: $event->results->error()->map($transformer);
try {
$file = storage_path('logs/sync-' . now()->format('Ymd-His') . '.log');
file_put_contents($file, implode(PHP_EOL, $messages->toArray()));
} catch (Throwable) {
}
}
}
Function Calls
None |
Stats
MD5 | 6315cfea711386f8402b2c130b0e7953 |
Eval Count | 0 |
Decode Time | 97 ms |