PHP Classes

PHP Generics: Framework for accessing streams, sockets and logs

Recommend this page to a friend!
  Info   View files Documentation   View files View files (103)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-10 (3 days ago) RSS 2.0 feedStarStarStarStar 71%Total: 456 This week: 3All time: 6,103 This week: 154Up
Version License PHP version Categories
php-generics 0.35BSD License5.4Networking, PHP 5, Libraries, Logging
Description 

Author

This package is a framework for accessing streams, sockets and logs.

It provides a set of classes that serve for different purposes like HTTP clients, generic network socket client and servers, a logger compliant with PSR-3, and general purpose classes for manipulating arrays and parsing URLs.

Picture of Maik Greubel
  Performance   Level  
Name: Maik Greubel <contact>
Classes: 10 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 4x

Documentation

Build Status Code Coverage Scrutinizer Code Quality Requirements Status

PHP Generics

The purpose of this package is to provide some classes for more sophisticated access to ressources. It can be used in any framework or application which intends to use abstract interfaces.

Currently it provides a basic stream API, a socket provider and a logging infrastructure based on the PSR-3. The intention is to extend it with more infrastructure code.

Usage

Please take a look into API documentation. To create the API documentation by yourself, please install Apache Ant and execute

ant

Any further execution can be performed without updating the dependencies using command

ant no-update


Stability

The API is a test-driven framework and uses PHPUnit to test the stability. Please use ant (if not yet done, see Usage) and execute

ant

This will run all available test suites in tests/*. The command performs also some basic checks for copy&paste code parts and calculate the code quality.


Feel free to write and publish further tests.

In case of an error please report bugs using a PHPUnit test class. Take a look into the tests/ sub folders to see examples how to do create a new one.

License

The whole package is published under the terms of second BSD License (BSD2). Take a look into LICENSE.md

Pointers

This framework makes use of composer available at https://getcomposer.org/ to generate API documentation and perform tests.


  Files folder image Files  
File Role Description
Files folder imagecontrib (1 file)
Files folder imagesrc (1 directory)
Files folder imagetests (7 directories)
Accessible without login Plain text file .travis.yml Data Travis Ci configuration
Accessible without login Plain text file build.xml Data Ant build script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. Auxiliary data
Accessible without login Plain text file phpcs.xml Data PHPCodeSniffer configuration
Accessible without login Plain text file phpdox.xml Data PHPDox configuration
Accessible without login Plain text file phpmd.xml Data PHPMessDetector configuration
Accessible without login Plain text file phpunit.xml Data PHPUnit configuration
Accessible without login Plain text file README.md Doc. Auxiliary data

  Files folder image Files  /  contrib  
File Role Description
  Accessible without login Plain text file phpcs.xsd Data Codesniffer configuration schema

  Files folder image Files  /  src  
File Role Description
Files folder imageGenerics (17 files, 5 directories)

  Files folder image Files  /  src  /  Generics  
File Role Description
Files folder imageClient (8 files)
Files folder imageLogger (10 files)
Files folder imageSocket (10 files)
Files folder imageStreams (11 files, 1 directory)
Files folder imageUtil (8 files)
  Accessible without login Plain text file DeprecatedException.php Class Class source
  Accessible without login Plain text file DirectoryException.php Class Derived exception
  Accessible without login Plain text file FileExistsException.php Class Derived Exception
  Accessible without login Plain text file FileNotFoundException.php Class Derived Exception
  Accessible without login Plain text file GenericsException.php Class Derived Exception
  Accessible without login Plain text file Lockable.php Class Lockable interface
  Accessible without login Plain text file LockException.php Class Derived exception
  Accessible without login Plain text file NoAccessException.php Class Derived Exception
  Accessible without login Plain text file NoticeException.php Class Class source
  Accessible without login Plain text file RecoverableErrorException.php Class Class source
  Accessible without login Plain text file ResetException.php Class Derived exception
  Accessible without login Plain text file Resettable.php Class Resettable interface
  Accessible without login Plain text file UserDeprecatedException.php Class Class source
  Accessible without login Plain text file UserErrorException.php Class Class source
  Accessible without login Plain text file UserNoticeException.php Class Class source
  Accessible without login Plain text file UserWarningException.php Class Class source
  Accessible without login Plain text file WarningException.php Class Class source

  Files folder image Files  /  src  /  Generics  /  Client  
File Role Description
  Accessible without login Plain text file HttpClient.php Class HTTP Client
  Accessible without login Plain text file HttpClientFactory.php Class Class source
  Accessible without login Plain text file HttpClientTrait.php Class Class source
  Accessible without login Plain text file HttpException.php Class Derived Exception
  Accessible without login Plain text file HttpHeadersTrait.php Class Class source
  Accessible without login Plain text file HttpsClient.php Class Class source
  Accessible without login Plain text file HttpStatus.php Class HTTP Status support
  Accessible without login Plain text file Session.php Class Session wrapper class

  Files folder image Files  /  src  /  Generics  /  Logger  
File Role Description
  Accessible without login Plain text file BasicLogger.php Class Common logging functionality
  Accessible without login Plain text file ConsoleLogger.php Class Basic console logger
  Accessible without login Plain text file DumpLogger.php Class Dumping variables logger interface
  Accessible without login Plain text file DumpLoggerTrait.php Class Trait for logging dumps
  Accessible without login Plain text file ExceptionLogger.php Class Exception logger interface
  Accessible without login Plain text file ExceptionLoggerTrait.php Class Trait for logging exceptions
  Accessible without login Plain text file ExtendedConsoleLogger.php Class Extended console logger
  Accessible without login Plain text file ExtendedLogger.php Class Extended logger
  Accessible without login Plain text file LoggerTrait.php Class Trait for generic logging
  Accessible without login Plain text file SimpleLogger.php Class Simple logger implementation against PSR-3

  Files folder image Files  /  src  /  Generics  /  Socket  
File Role Description
  Accessible without login Plain text file ClientSocket.php Class Client socket implementation
  Accessible without login Plain text file Endpoint.php Class Socket enpoint dataholder
  Accessible without login Plain text file InvalidUrlException.php Class Derived Exception
  Accessible without login Plain text file SecureClientSocket.php Class Class source
  Accessible without login Plain text file SecureSocket.php Class Class source
  Accessible without login Plain text file ServerSocket.php Class Server socket implementation
  Accessible without login Plain text file ServiceCallback.php Class Server socket callback interface
  Accessible without login Plain text file Socket.php Class Socket interface
  Accessible without login Plain text file SocketException.php Class Derived Exception
  Accessible without login Plain text file Url.php Class Url class

  Files folder image Files  /  src  /  Generics  /  Streams  
File Role Description
Files folder imageInterceptor (3 files)
  Accessible without login Plain text file FileInputStream.php Class File input stream implementation
  Accessible without login Plain text file FileOutputStream.php Class File output stream implementation
  Accessible without login Plain text file HttpStream.php Class Http stream interface
  Accessible without login Plain text file InputOutputStream.php Class Input/output stream interface
  Accessible without login Plain text file InputStream.php Class Input stream interface
  Accessible without login Plain text file MemoryStream.php Class Memory stream implementation
  Accessible without login Plain text file OutputStream.php Class Output stream interface
  Accessible without login Plain text file SocketStream.php Class Socket stream interface
  Accessible without login Plain text file StandardOutputStream.php Class Class source
  Accessible without login Plain text file Stream.php Class Stream interface
  Accessible without login Plain text file StreamException.php Class Derived Exception

  Files folder image Files  /  src  /  Generics  /  Streams  /  Interceptor  
File Role Description
  Accessible without login Plain text file AbstractStreamInterceptor.php Class Class source
  Accessible without login Plain text file CachedStreamInterceptor.php Class Class source
  Accessible without login Plain text file StreamInterceptor.php Class Class source

  Files folder image Files  /  src  /  Generics  /  Util  
File Role Description
  Accessible without login Plain text file Arrays.php Class Arrays support utilities
  Accessible without login Plain text file BasicAuth.php Class HTTP Basic Auth class
  Accessible without login Plain text file Directory.php Class Directory utitlity class
  Accessible without login Plain text file EndpointParser.php Class EndpointParser class
  Accessible without login Plain text file ExceptionErrorHandler.php Class Class source
  Accessible without login Plain text file Interpolator.php Class Trait for interpolating
  Accessible without login Plain text file RandomString.php Class Class to generate a random string with specific length
  Accessible without login Plain text file UrlParser.php Class UrlParser class

  Files folder image Files  /  tests  
File Role Description
Files folder imageexception-tests (1 file)
Files folder imagehttp-tests (4 files)
Files folder imagelogger-tests (2 files)
Files folder imagemanually (5 files)
Files folder imagesocket-tests (4 files)
Files folder imagestream-tests (4 files)
Files folder imageutil-tests (6 files)

  Files folder image Files  /  tests  /  exception-tests  
File Role Description
  Accessible without login Plain text file ExceptionTest.php Test Unit test for exceptions

  Files folder image Files  /  tests  /  http-tests  
File Role Description
  Accessible without login Plain text file HttpClientFactoryTest.php Class Class source
  Accessible without login Plain text file HttpClientTest.php Test HTTP Client unit test
  Accessible without login Plain text file HttpsClientTest.php Class Class source
  Accessible without login Plain text file SessionsTest.php Class Class source

  Files folder image Files  /  tests  /  logger-tests  
File Role Description
  Accessible without login Plain text file ExtendedLoggerTest.php Test Unit test for extended logger
  Accessible without login Plain text file SimpleLoggerTest.php Test Unit test script

  Files folder image Files  /  tests  /  manually  
File Role Description
  Accessible without login Plain text file ClientTestManually.php Test Unit test for manually testing ClientSocket
  Accessible without login Plain text file HttpClientHeadTestManually.php Test Manually test the http client header retrieval
  Accessible without login Plain text file HttpClientTestManually.php Test Unit test for manually testing HttpClientSocket
  Accessible without login Plain text file ServerTestManually.php Test Unit test for manually testing ServerSocket
  Accessible without login Plain text file TestServerSocketCallback.php Class Callback for manually testing ServerSocket

  Files folder image Files  /  tests  /  socket-tests  
File Role Description
  Accessible without login Plain text file ClientSocketTest.php Test Unit test script
  Accessible without login Plain text file ServerSocketTest.php Test Unit test script
  Accessible without login Plain text file TestServiceCallback.php Class Callback for unit test for manually testing ServerSocket
  Accessible without login Plain text file UrlTest.php Test Url class test

  Files folder image Files  /  tests  /  stream-tests  
File Role Description
  Accessible without login Plain text file FileInputStreamTest.php Test Unit test script
  Accessible without login Plain text file FileOutputStreamTest.php Test Unit test script
  Accessible without login Plain text file MemoryStreamTest.php Test Unit test script
  Accessible without login Plain text file StandardOutputStreamTest.php Class Class source

  Files folder image Files  /  tests  /  util-tests  
File Role Description
  Accessible without login Plain text file ArraysTest.php Test Testing Arrays support utilities
  Accessible without login Plain text file DirectoryTest.php Test Unit test for Directory utility class
  Accessible without login Plain text file EndpointParserTest.php Test EndpointParser class test
  Accessible without login Plain text file ExceptionErrorHandlerTest.php Class Class source
  Accessible without login Plain text file HttpStatusTest.php Test HttpStatus class test
  Accessible without login Plain text file UrlParserTest.php Test UrlParser class test

 Version Control Reuses Unique User Downloads Download Rankings  
 100%2
Total:456
This week:3
All time:6,103
This week:154Up
User Ratings User Comments (1)
 All time
Utility:93%StarStarStarStarStar
Consistency:93%StarStarStarStarStar
Documentation:68%StarStarStarStar
Examples:-
Tests:81%StarStarStarStarStar
Videos:-
Overall:71%StarStarStarStar
Rank:326
 
Nice package.
9 years ago (pvdptje)
62%StarStarStarStar