PHPackages                             parasek/concretecms\_utility - 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. parasek/concretecms\_utility

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

parasek/concretecms\_utility
============================

Few handy, opinionated helpers for dealing with Files/Images when generating Images/Galleries/Sliders/File Lists etc.

4.0.1(2y ago)4492↓66.7%MITPHPPHP &gt;=8.1

Since Oct 23Pushed 2y ago2 watchersCompare

[ Source](https://github.com/parasek/concretecms-utility)[ Packagist](https://packagist.org/packages/parasek/concretecms_utility)[ Docs](https://github.com/parasek/concretecms-utility)[ RSS](/packages/parasek-concretecms-utility/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (10)Used By (0)

Custom utility classes for Concrete CMS
=======================================

[](#custom-utility-classes-for-concrete-cms)

Few handy, opinionated helpers for dealing with Files, Images, Videos when generating Images/Galleries/Sliders/File Lists etc.

Requires Concrete 9 and PHP 8.1.

Most methods will return DTO objects or array of DTOs. Your Editor should help you with autocompletion. If not, add respective code:

```
// Hints for services
/** @var \ConcreteCmsUtility\FileUtility $fileUtility */
/** @var \ConcreteCmsUtility\ImageUtility $imageUtility */
/** @var \ConcreteCmsUtility\VideoUtility $videoUtility */

// Hints for returned objects
/** @var \ConcreteCmsUtility\DTO\FileData $file */
/** @var \ConcreteCmsUtility\DTO\GalleryImageData $image */
/** @var \ConcreteCmsUtility\DTO\ImageData $image */
/** @var \ConcreteCmsUtility\DTO\SliderImageData $image */
/** @var \ConcreteCmsUtility\DTO\VideoeData $video */

// Hints for arrays (when using foreach loop etc.).
/** @var \ConcreteCmsUtility\DTO\ImageData[] $images */
```

You can access returned values as objects:

```
$file->url;

$image->url;
$image->width;
$image->height;

$image->file->url;
```

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

[](#installation)

```
composer require parasek/concretecms_utility
```

Installation (without composer)
-------------------------------

[](#installation-without-composer)

Download the latest release and copy content of `src` folder into `application/src/ConcreteCmsUtility`.

Add code below in `application/bootstrap/app.php`:

```
$classLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader();
$classLoader->addPrefix('ConcreteCmsUtility', DIR_APPLICATION . '/' . DIRNAME_CLASSES . '/' . 'ConcreteCmsUtility');
$classLoader->register();
```

Visit  and download latest version of getID3 library.

Copy content of that repository into `application/src` and add load it somewhere (for example in `application/bootstrap/app.php`).

```
require_once( DIR_APPLICATION . '/' . DIRNAME_CLASSES . '/getID3/getid3/getid3.php');
```

Service provider
----------------

[](#service-provider)

You can register service provider in `application/config/app.php` in `providers` section

```
'providers' => [
    'concrete_cms_utility' => ConcreteCmsUtility\ServiceProvider::class,
],
```

Then you will be able to use shorthands like:

```
app('utils/image')->getPlaceholderString(width: 100, height: 100);
$app->make('utils/file')->getFile(file: 1)->url;
$this->app->make('utils/video')->getVideo(file: 1)->url;
```

Example usage
-------------

[](#example-usage)

How to load services:

```
use ConcreteCmsUtility\FileUtility;
use ConcreteCmsUtility\ImageUtility;

// Using Service container in controllers
$fileUtility = $this->app->make(FileUtility::class);
$imageUtility = $this->app->make(ImageUtility::class);

// Using Service container in view files
$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
$fileUtility = $app->make(FileUtility::class);
$imageUtility = $app->make(ImageUtility::class);

// Using app helper (everywhere)
$fileUtility = app(FileUtility::class);
$imageUtility = app(ImageUtility::class);

// Using dependency injection
class CustomClass
{
    protected FileUtility $fileUtility;
    protected ImageUtility $imageUtility;

    public function __construct(FileUtility $fileUtility, ImageUtility $imageUtility)
    {
        $this->fileUtility = $fileUtility;
        $this->imageUtility = $imageUtility;
    }
}
```

Example:

```

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~73 days

Recently: every ~89 days

Total

7

Last Release

852d ago

Major Versions

1.1.0 → 2.0.02023-04-13

2.0.0 → 3.0.02023-07-10

3.0.0 → 4.0.02023-07-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd8c88209897e63e3de05e87d1cb34596e90c342687443f97b04e5dd693668d3?d=identicon)[parasek](/maintainers/parasek)

---

Top Contributors

[![jarpen](https://avatars.githubusercontent.com/u/3670203?v=4)](https://github.com/jarpen "jarpen (31 commits)")[![parasek](https://avatars.githubusercontent.com/u/33052836?v=4)](https://github.com/parasek "parasek (15 commits)")

---

Tags

concrete5concreteCMSConcrete CMSc5concrete cms utility

### Embed Badge

![Health badge](/badges/parasek-concretecms-utility/health.svg)

```
[![Health](https://phpackages.com/badges/parasek-concretecms-utility/health.svg)](https://phpackages.com/packages/parasek-concretecms-utility)
```

PHPackages © 2026

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