Skip to content

LibCommons

ImperaZim edited this page Jun 29, 2026 · 2 revisions

LibCommons

LibCommons is the official shared utility library for EasyLibrary 3.x.

It replaces the old pure utility helpers that used to live inside the EasyLibrary core, while keeping the 3.x core small enough to boot, repair config and install packages without depending on a large embedded utility layer.

Package

Field Value
Package id libcommons
Plugin name LibCommons
Namespace imperazim\commons
Package type classpath

Main Areas

  • imperazim\commons\collection\Arr
  • imperazim\commons\data\Base64
  • imperazim\commons\data\Hash
  • imperazim\commons\data\Json
  • imperazim\commons\diagnostics\Report
  • imperazim\commons\diagnostics\Table
  • imperazim\commons\filesystem\DataFile
  • imperazim\commons\filesystem\FileSystem
  • imperazim\commons\filesystem\Path
  • imperazim\commons\math\Aabb
  • imperazim\commons\math\Easing
  • imperazim\commons\math\Geometry
  • imperazim\commons\math\Interpolation
  • imperazim\commons\math\Shape
  • imperazim\commons\math\WeightedRandom
  • imperazim\commons\number\Number
  • imperazim\commons\result\Option
  • imperazim\commons\result\Result
  • imperazim\commons\text\Text
  • imperazim\commons\time\Clock
  • imperazim\commons\time\Duration
  • imperazim\commons\time\KeyCooldown
  • imperazim\commons\validation\Validator

Install Through EasyLibrary

/easylibrary packages bootstrap
/easylibrary packages bootstrap confirm

Or install it directly:

/easylibrary packages install libcommons stable confirm

Restart, then validate:

/easylibrary packages doctor
/easylibrary doctor
elprobe libcommons
elprobe run libcommons

Migration Note

Old EasyLibrary 2.x helpers such as components\utils\Text, components\utils\Number, components\utils\TimeUtils, components\utils\ValidationUtils, components\filesystem\File and components\filesystem\Path should move to LibCommons or to direct PMMP APIs depending on the use case.

Common replacements:

Old helper direction New LibCommons direction
Array/config helpers imperazim\commons\collection\Arr
Text/color/string helpers imperazim\commons\text\Text
Number formatting/ranges imperazim\commons\number\Number
Time/duration helpers imperazim\commons\time\Clock, Duration, KeyCooldown
Validation helpers imperazim\commons\validation\Validator
Plugin-owned files imperazim\commons\filesystem\DataFile
Path helpers imperazim\commons\filesystem\Path
Explicit success/failure values imperazim\commons\result\Result, Option

Path::normalize() and Path::isWithin() are lexical helpers for ordinary plugin-owned paths. They are useful for config/cache paths, but code that must defend against symlink tricks should still resolve paths with filesystem-aware checks.

Clone this wiki locally