PHPackages                             sledgehammer/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sledgehammer/core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sledgehammer/core
=================

Sledgehammer - A general purpose PHP toolkit

26.03.0(3mo ago)32.2k211MITPHPPHP &gt;=7.3CI passing

Since Oct 12Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/sledgehammer/core)[ Packagist](https://packagist.org/packages/sledgehammer/core)[ Docs](http://sledgehammer.github.com/)[ RSS](/packages/sledgehammer-core/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (49)Used By (11)

Sledgehammer Core
=================

[](#sledgehammer-core)

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
---------

[](#resources)

- [API Documentation](http://sledgehammer.github.com/api/)
- [Sledgehammer Wiki](http://github.com/sledgehammer/sledgehammer/wiki)
- [Issue tracker](https://github.com/sledgehammer/sledgehammer/issues)
- [Roadmap / Backlog](https://trello.com/board/sledgehammer-framework/4ec77591eb9c5577726d94fb)

Scope
-----

[](#scope)

- Debugging, error-reporting, logging and profiling functionality.
- A collection of global functions (that should be included in PHP, imho)
- Generic utility classes

Classes
-------

[](#classes)

- [ErrorHandler](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Debug.ErrorHandler.html) : An error reporting solution.
- [Base](http://sledgehammer.github.com/api/class-Sledgehammer.Base.html) : A more strict base class with improved error messages.
- [Sledgehammer/dump()](http://sledgehammer.github.io/api/function-Sledgehammer.dump.html) : A colorful `var_dump`, with copy-pastable array format.
- [Database](http://sledgehammer.github.com/api/class-Sledgehammer.Database.html) : PDO Database class enhanced with logging/profiling and improved error/warning detection.
- [Sql](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Database.Sql.html) : Generating complex queries in a chainable.
- [Collection](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Collection.html) : Enhanced Array/Iterator handling.
- [Text](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Text.html) : Chainable UTF-8 string functions.
- [Url](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Url.html) : Read and generate urls in a OOP style.
- [Sledgehammer/cache()](http://sledgehammer.github.io/api/function-Sledgehammer.cache.html) : Easy caching api using closures.
- [Json](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Json.html) : Reliable JSON encoding and decoding.
- [Autoloader](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Debug.Autoloader.html) : Detects classes and interfaces in any php file and load them when needed. no more includes.
- [DebugR](http://sledgehammer.github.io/api/class-Sledgehammer.Core.Debug.DebugR.html) : Sending debugging information alongside XMLHttpRequests.
- [more...](http://sledgehammer.github.io/api/namespace-Sledgehammer.Core.html)

Installation
------------

[](#installation)

Use [composer](http://getcomposer.org/) to install sledgehammer modules.

```
composer 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](http://sledgehammer.github.com/api/function-dump.html) function: `dump($var);` to check if the installation is successful.

ErrorHandler
------------

[](#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

[](#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

[](#autoloader)

```
\Sledgehammer\Core\Debug\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.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity21

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 99.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~106 days

Recently: every ~721 days

Total

47

Last Release

108d ago

Major Versions

15.08.0 → 16.05.02016-04-19

16.11.0 → 18.04.02018-04-25

18.08.0 → 20.01.02021-01-16

20.01.0 → 22.07.02022-07-23

22.07.0 → 26.03.02026-03-17

PHP version history (5 changes)12.10.1PHP &gt;=5.3.0

16.05.0PHP &gt;=5.5

18.04.0PHP &gt;=7.1

20.01.0PHP &gt;=7.4

22.07.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/207248?v=4)[Bob Fanger](/maintainers/bfanger)[@bfanger](https://github.com/bfanger)

---

Top Contributors

[![bfanger](https://avatars.githubusercontent.com/u/207248?v=4)](https://github.com/bfanger "bfanger (433 commits)")[![Hyra](https://avatars.githubusercontent.com/u/380836?v=4)](https://github.com/Hyra "Hyra (1 commits)")

---

Tags

coretoolkitsledgehammer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sledgehammer-core/health.svg)

```
[![Health](https://phpackages.com/badges/sledgehammer-core/health.svg)](https://phpackages.com/packages/sledgehammer-core)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[fidry/cpu-core-counter

Tiny utility to get the number of CPU cores.

243171.4M39](/packages/fidry-cpu-core-counter)[typo3/cms-composer-installers

TYPO3 CMS Installers

6114.7M69](/packages/typo3-cms-composer-installers)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

69201.9k121](/packages/codeigniter4-devkit)[compwright/codeigniter-installers

Composer installers for CodeIgniter

3484.3k4](/packages/compwright-codeigniter-installers)[contao-bootstrap/core

Core of Contao Bootstrap extension

1791.6k24](/packages/contao-bootstrap-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
