sledgehammer / core
Sledgehammer - A general purpose PHP toolkit
Installs: 2 142
Dependents: 11
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 2
Open Issues: 0
Requires
- php: >=7.3
Requires (Dev)
- phpunit/phpunit: ^9.5
- dev-master
- 22.07.0
- 20.01.0
- 18.08.0
- 18.04.0
- 16.11.0
- 16.05.0
- 15.08.0
- 14.03.0
- 14.01.1
- 14.01.0
- 13.12.0
- 13.09.2
- 13.09.1
- 13.09.0
- 13.08.1
- 13.08.0
- 13.06.1
- 13.06.0
- 13.05.1
- 13.05.0
- 13.04.4
- 13.04.3
- 13.04.2
- 13.04.1
- 13.04.0
- 13.03.2
- 13.03.1
- 13.03.0
- 13.02.4
- 13.02.3
- 13.02.2
- 13.02.1
- 13.02.0
- 13.01.0
- 12.12.2
- 12.12.1
- 12.12.0
- 12.11.3
- 12.11.2
- 12.11.1
- 12.11.0
- 12.10.5
- 12.10.4
- 12.10.3
- 12.10.2
- 12.10.1
- dev-htmltokenizer
This package is auto-updated.
Last update: 2024-11-07 12:46:16 UTC
README
A general purpose PHP toolkit, with a focus on debugging.
- Improved error reporting with Sledgehammer\Core\Debug\ErrorHandler.
- Improved var_dump() with dump().
- Improved PDO compatible database connection with Sledgehammer\Core\Database\Connection.
Resources
Scope
- Debugging, error-reporting, loggin and profiling functionality.
- A collection of global functions (that should be included in PHP, imho)
- Generic utility classes
Classes
- Autoloader : Detects classes and interfaces in any php file and load them when needed. no more includes.
- ErrorHandler : An error reporting solution.
- Base : A more strict base class with improved error messages.
- Sledgehammer/dump() : A colorful
var_dump
, with copy-pastable array format. - Database : PDO Database class enhanced with logging/profiling and improved error/warning detection.
- Sql : Generating complex queries in a chainable.
- Collection : Enhanced Array/Iterator handling.
- Text : Chainable UTF-8 string functions.
- Url : Read and generate urls in a OOP style.
- Sledgehammer/cache() : Easy caching api using closures.
- Json : Reliable JSON encoding and decoding.
- DebugR : Sending debugging information alongside XMLHttpRequests.
- more...
Installation
Use composer to install sledgehammer modules.
$ composer.phar require sledgehammer/core:*
Just include('vendor/autoload.php');
and the Sledgehammer Framework (and other installed composer libraries) can be used.
You can try the dump function: dump($var);
to check if the installation is successful.
ErrorHandler
Add \Sledgehammer\Core\Debug\ErrorHandler::enable();
to allow the Sledgehammer ErrorHandler to handle the errors, warnings, notices and uncaught exceptions.
The errorhandler can send error reports per email to the address configured in ErrorHandler->email
.
Static files
Serve static files from modules by adding a line to your rewrite/index.php.
require("vendor/sledgehammer/core/src/render_public_folders.php");
Autoloader
\Sledgehammer\Core\Autoloader::enable();
Enables the autoloader, which kicks in when the Composer Autoloader was unable to load the class. The Sledgehammer\Core\Autoloader tries to diagnose the issue and loads the class when it can.