定制 php-platform/errors 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

php-platform/errors

Composer 安装命令:

composer require php-platform/errors

包简介

README 文档

README

This package provides uniform APIs for Error handling and logging

Build Status

Introduction

This Package mainly solves 3 problems

  • Provides Exception types for all purposes, well categorized and with unique codes
  • Common way to log all Exceptions and Errors
  • Handles PHP System Errors and converts them into Exceptions

Exception Types

Following Exception types are available for Application developers to use.

  • PlatformException abstract Parent of all exceptions , derived from Exception, all logging mechanism implemented here

    • PersistenceException abstract Parent of all persistant exceptions, these exceptions to be used by Persistant layer

      • BadQueryException
      • DataNotFoundException
      • NoAccessException
      • NoConnectionException
      • NoDuplicateException
      • ReferenceIntegrityViolationException
    • ApplicationException abstract Parent of all application exceptions, these exceptions to be used by Application/Business Layer

      • BadInputException
      • Debug
      • NoAccessException
      • ProgrammingError
    • HttpException abstract Parent of all Http exceptions, these exceptions to be used by View or Web Service Layers

      • _1XX All exceptions for Informational Http Codes
      • _2XX All exceptions for Success Http codes
      • _3XX All exceptions for Redirectional Http codes
      • _4XX All exceptions for Client Error Http codes
      • _5XX All exceptions for Server Error Http codes
    • SystemException abstract Parent of all System Exceptions generated from handling PHP System Errors

      • SystemError For all Errors this Exception is created and thrown from ErrorHandler
      • SystemWarning For all Warnings, This exception is not thrown by the ErrorHandler , instead this is created for the purpose of logging

Configuration

Configurations available for this Package

This Configuration is based on PHPPlatform/config

{
    "logs":{  // log file paths for each category of exceptions
        "Persistence":null, 
	    "Application":null,
	    "Http":null,
	    "System":null
    },
    "traces":{ // trace file paths for each category of exceptions
        "Persistence":null,
	    "Application":null,
	    "Http":null,
	    "System":null
    }
}

To enable Error Handling , call error handling function as below

PhpPlatform\Errors\ErrorHandler::handleError();

统计信息

  • 总下载量: 2.6k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固