Upcoming Critical PHP Security Release

The StreamErrorCode Enum

(PHP 8 >= 8.6.0)

Вступ

The StreamErrorCode enum identifies the kind of error that a stream operation reported. It is available as StreamError::$code.

The same case may be reported by different wrappers for different reasons; StreamError::$message describes the specific failure.

Кородкий огляд переліку

enum StreamErrorCode
{
case None ; // No error.

case Generic ; // A generic error.

case ReadFailed ; // Reading from the stream failed.

case WriteFailed ; // Writing to the stream failed.

case SeekFailed ; // Seeking in the stream failed.

case SeekNotSupported ; // The stream does not support seeking.

case FlushFailed ; // Flushing the stream failed.

case TruncateFailed ; // Truncating the stream failed.

case ConnectFailed ; // Connecting the socket failed.

case BindFailed ; // Binding the socket to an address failed.

case ListenFailed ; // Listening on the socket failed.

case AcceptFailed ; // Accepting a connection on the socket failed.

case NotWritable ; // The stream is not writable.

case NotReadable ; // The stream is not readable.

case Disabled ; // The wrapper or operation is disabled by configuration.

case NotFound ; // The resource does not exist.

case PermissionDenied ; // Permission was denied.

case AlreadyExists ; // The file or directory already exists.

case InvalidPath ; // The path is invalid.

case PathTooLong ; // The path is too long.

case OpenFailed ; // Opening failed.

case CreateFailed ; // Creating the resource failed.

case DupFailed ; // Duplicating a file descriptor failed.

case UnlinkFailed ; // Deleting the file failed.

case RenameFailed ; // Renaming the file or directory failed.

case MkdirFailed ; // Creating the directory failed.

case RmdirFailed ; // Removing the directory failed.

case StatFailed ; // Retrieving file information failed.

case MetaFailed ; // Changing file metadata failed.

case ChmodFailed ; // Changing the file mode failed.

case ChownFailed ; // Changing the file owner failed.

case CopyFailed ; // Copying the file failed.

case TouchFailed ; // Changing the file times failed.

case InvalidMode ; // The open mode is invalid.

case InvalidMeta ; // The metadata option is invalid.

case ModeNotSupported ; // The open mode is not supported.

case Readonly ; // The resource is read-only.

case RecursionDetected ; // Infinite recursion was prevented.

case NotImplemented ; // The operation is not implemented by the wrapper.

case NoOpener ; // The wrapper cannot open streams.

case PersistentNotSupported ; // Persistent streams are not supported.

case WrapperNotFound ; // The wrapper does not exist.

case WrapperDisabled ; // The wrapper is disabled.

case ProtocolUnsupported ; // The protocol is not supported.

case WrapperRegistrationFailed ; // Registering the wrapper failed.

case WrapperUnregistrationFailed ; // Unregistering the wrapper failed.

case WrapperRestorationFailed ; // Restoring the wrapper failed.

case FilterNotFound ; // The stream filter does not exist.

case FilterFailed ; // A stream filter failed.

case CastFailed ; // Casting the stream failed.

case CastNotSupported ; // The stream cannot be cast to the requested type.

case MakeSeekableFailed ; // Making the stream seekable failed.

case BufferedDataLost ; // Buffered data was lost during a cast.

case NetworkSendFailed ; // Sending data failed.

case NetworkRecvFailed ; // Receiving data failed.

case SslNotSupported ; // The stream does not support encryption.

case ResumptionFailed ; // Resuming failed.

case SocketPathTooLong ; // The socket path is too long.

case OobNotSupported ; // The stream does not support out-of-band data.

case ProtocolError ; // A protocol error occurred.

case InvalidUrl ; // The URL is invalid.

case InvalidResponse ; // The response is invalid.

case InvalidHeader ; // A header is invalid.

case InvalidParam ; // A parameter or option is invalid.

case RedirectLimit ; // The redirect limit was reached.

case AuthFailed ; // Authentication failed.

case TimeOut ; // The operation timed out.

case ArchivingFailed ; // Archiving failed.

case EncodingFailed ; // Encoding failed.

case DecodingFailed ; // Decoding failed.

case InvalidFormat ; // The data format is invalid.

case AllocationFailed ; // Allocation failed.

case TemporaryFileFailed ; // Creating a temporary file failed.

case LockFailed ; // Locking the stream failed.

case LockNotSupported ; // The stream does not support locking.

case UserspaceNotImplemented ; // The user wrapper does not implement the method.

case UserspaceInvalidReturn ; // A user wrapper method returned an invalid value.

case UserspaceCallFailed ; // Calling a user callback failed.

}

Прогляньте також

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top