Switch namespace back to App

This commit is contained in:
Lance Pioch
2024-03-12 22:39:16 -04:00
parent f0489f677b
commit c83dd86a41
837 changed files with 3421 additions and 6605 deletions

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
class AccountNotFoundException extends \Exception
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
class AutoDeploymentException extends \Exception
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
use Exception;
use Illuminate\Http\Request;
@@ -12,7 +12,7 @@ use Illuminate\Http\RedirectResponse;
use Prologue\Alerts\AlertsMessageBag;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class DisplayException extends PterodactylException implements HttpExceptionInterface
class DisplayException extends PanelException implements HttpExceptionInterface
{
public const LEVEL_DEBUG = 'debug';
public const LEVEL_INFO = 'info';

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
use Exception;
use Illuminate\Support\Arr;
@@ -19,7 +19,7 @@ use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Mailer\Exception\TransportException;
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
use App\Exceptions\Repository\RecordNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@@ -30,7 +30,7 @@ class Handler extends ExceptionHandler
* resulting in some weird rule names. This string will be parsed out and
* replaced with 'p_' in the response code.
*/
private const PTERODACTYL_RULE_STRING = 'pterodactyl\_rules\_';
private const PANEL_RULE_STRING = 'App\_rules\_';
/**
* A list of the exception types that should not be reported.
@@ -132,8 +132,6 @@ class Handler extends ExceptionHandler
// This is kind of a hack, and ideally things like this should be handled as
// much as possible at the code level, but there are a lot of spots that do a
// ton of actions and were written before this bug discovery was made.
//
// @see https://github.com/pterodactyl/panel/pull/1468
if ($connections->transactionLevel()) {
$connections->rollBack(0);
}
@@ -163,7 +161,7 @@ class Handler extends ExceptionHandler
foreach ($errors as $key => $error) {
$meta = [
'source_field' => $field,
'rule' => str_replace(self::PTERODACTYL_RULE_STRING, 'p_', Arr::get(
'rule' => str_replace(self::PANEL_RULE_STRING, 'p_', Arr::get(
$codes,
str_replace('.', '_', $field) . '.' . $key
)),

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Http\Base;
namespace App\Exceptions\Http\Base;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidPasswordProvidedException extends DisplayException
{

View File

@@ -1,11 +1,11 @@
<?php
namespace Pterodactyl\Exceptions\Http\Connection;
namespace App\Exceptions\Http\Connection;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Log;
use GuzzleHttp\Exception\GuzzleException;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
/**
* @method \GuzzleHttp\Exception\GuzzleException getPrevious()
@@ -15,7 +15,7 @@ class DaemonConnectionException extends DisplayException
private int $statusCode = Response::HTTP_GATEWAY_TIMEOUT;
/**
* Every request to the Wings instance will return a unique X-Request-Id header
* Every request to the daemon instance will return a unique X-Request-Id header
* which allows for all errors to be efficiently tied to a specific request that
* triggered them, and gives users a more direct method of informing hosts when
* something goes wrong.
@@ -33,7 +33,7 @@ class DaemonConnectionException extends DisplayException
if ($useStatusCode) {
$this->statusCode = is_null($response) ? $this->statusCode : $response->getStatusCode();
// There are rare conditions where wings encounters a panic condition and crashes the
// There are rare conditions where daemon encounters a panic condition and crashes the
// request being made after content has already been sent over the wire. In these cases
// you can end up with a "successful" response code that is actual an error.
//

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions\Http;
namespace App\Exceptions\Http;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Http\Server;
namespace App\Exceptions\Http\Server;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class FileSizeTooLargeException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Http\Server;
namespace App\Exceptions\Http\Server;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class FileTypeNotEditableException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Http\Server;
namespace App\Exceptions\Http\Server;
use Pterodactyl\Models\Server;
use App\Models\Server;
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
class ServerStateConflictException extends ConflictHttpException

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions\Http;
namespace App\Exceptions\Http;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions;
namespace App\Exceptions;
use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Contracts\ProvidesSolution;

View File

@@ -1,15 +1,15 @@
<?php
namespace Pterodactyl\Exceptions\Model;
namespace App\Exceptions\Model;
use Illuminate\Support\MessageBag;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Validation\Validator;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
use Illuminate\Contracts\Support\MessageProvider;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class DataValidationException extends PterodactylException implements HttpExceptionInterface, MessageProvider
class DataValidationException extends PanelException implements HttpExceptionInterface, MessageProvider
{
/**
* DataValidationException constructor.

View File

@@ -0,0 +1,7 @@
<?php
namespace App\Exceptions;
class PanelException extends \Exception
{
}

View File

@@ -1,7 +0,0 @@
<?php
namespace Pterodactyl\Exceptions;
class PterodactylException extends \Exception
{
}

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Repository\Daemon;
namespace App\Exceptions\Repository\Daemon;
use Pterodactyl\Exceptions\Repository\RepositoryException;
use App\Exceptions\Repository\RepositoryException;
class InvalidPowerSignalException extends RepositoryException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Repository;
namespace App\Exceptions\Repository;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class DuplicateDatabaseNameException extends DisplayException
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions\Repository;
namespace App\Exceptions\Repository;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Repository;
namespace App\Exceptions\Repository;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
class RepositoryException extends PterodactylException
class RepositoryException extends PanelException
{
}

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
class AllocationDoesNotBelongToServerException extends PterodactylException
class AllocationDoesNotBelongToServerException extends PanelException
{
}

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class AutoAllocationNotEnabledException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class CidrOutOfRangeException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidPortMappingException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoAutoAllocationSpaceAvailableException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class PortOutOfRangeException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class ServerUsingAllocationException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Allocation;
namespace App\Exceptions\Service\Allocation;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TooManyPortsInRangeException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Backup;
namespace App\Exceptions\Service\Backup;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class BackupLockedException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Backup;
namespace App\Exceptions\Service\Backup;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TooManyBackupsException extends DisplayException
{

View File

@@ -1,10 +1,10 @@
<?php
namespace Pterodactyl\Exceptions\Service\Database;
namespace App\Exceptions\Service\Database;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
class DatabaseClientFeatureNotEnabledException extends PterodactylException
class DatabaseClientFeatureNotEnabledException extends PanelException
{
public function __construct()
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Database;
namespace App\Exceptions\Service\Database;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoSuitableDatabaseHostException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Database;
namespace App\Exceptions\Service\Database;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TooManyDatabasesException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Deployment;
namespace App\Exceptions\Service\Deployment;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoViableAllocationException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Deployment;
namespace App\Exceptions\Service\Deployment;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoViableNodeException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg;
namespace App\Exceptions\Service\Egg;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class BadJsonFormatException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg;
namespace App\Exceptions\Service\Egg;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class HasChildrenException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg;
namespace App\Exceptions\Service\Egg;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidCopyFromException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg;
namespace App\Exceptions\Service\Egg;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoParentConfigurationFoundException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg\Variable;
namespace App\Exceptions\Service\Egg\Variable;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class BadValidationRuleException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Egg\Variable;
namespace App\Exceptions\Service\Egg\Variable;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class ReservedVariableNameException extends DisplayException
{

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Service;
namespace App\Exceptions\Service;
use Illuminate\Http\Response;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class HasActiveServersException extends DisplayException
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions\Service\Helper;
namespace App\Exceptions\Service\Helper;
class CdnVersionFetchingException extends \Exception
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service;
namespace App\Exceptions\Service;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidFileUploadException extends DisplayException
{

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Service\Location;
namespace App\Exceptions\Service\Location;
use Illuminate\Http\Response;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class HasActiveNodesException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Node;
namespace App\Exceptions\Service\Node;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class ConfigurationNotPersistedException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Schedule\Task;
namespace App\Exceptions\Service\Schedule\Task;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TaskIntervalTooLongException extends DisplayException
{

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Service\Server;
namespace App\Exceptions\Service\Server;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
class RequiredVariableMissingException extends PterodactylException
class RequiredVariableMissingException extends PanelException
{
}

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service;
namespace App\Exceptions\Service;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class ServiceLimitExceededException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Subuser;
namespace App\Exceptions\Service\Subuser;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class ServerSubuserExistsException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\Subuser;
namespace App\Exceptions\Service\Subuser;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class UserIsServerOwnerException extends DisplayException
{

View File

@@ -1,8 +1,8 @@
<?php
namespace Pterodactyl\Exceptions\Service\User;
namespace App\Exceptions\Service\User;
use Pterodactyl\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TwoFactorAuthenticationTokenInvalid extends DisplayException
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Pterodactyl\Exceptions\Solutions;
namespace App\Exceptions\Solutions;
use Spatie\Ignition\Contracts\Solution;
@@ -19,7 +19,7 @@ class ManifestDoesNotExistSolution implements Solution
public function getDocumentationLinks(): array
{
return [
'Docs' => 'https://github.com/pterodactyl/panel/blob/develop/package.json',
'Docs' => 'https://github.com/lancepioch/panel/blob/develop/package.json',
];
}
}

View File

@@ -1,9 +1,9 @@
<?php
namespace Pterodactyl\Exceptions\Transformer;
namespace App\Exceptions\Transformer;
use Pterodactyl\Exceptions\PterodactylException;
use App\Exceptions\PanelException;
class InvalidTransformerLevelException extends PterodactylException
class InvalidTransformerLevelException extends PanelException
{
}