PHPackages                             dcarbone/ugly-queue - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. dcarbone/ugly-queue

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

dcarbone/ugly-queue
===================

A simple file-based queue system for PHP 5.3.3+

0.4.0(10y ago)023GPLv3PHPPHP &gt;=5.3.3

Since Aug 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dcarbone/ugly-queue)[ Packagist](https://packagist.org/packages/dcarbone/ugly-queue)[ Docs](https://github.com/dcarbone/ugly-queue)[ RSS](/packages/dcarbone-ugly-queue/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (2)Versions (8)Used By (0)

ugly-queue
==========

[](#ugly-queue)

A simple file-based FIFO queue system for PHP 5.3.3+

Build status: [![Build Status](https://camo.githubusercontent.com/beb6f328f8142519ba332294f1d3f42d203911111d983c6768db9ff15700f611/68747470733a2f2f7472617669732d63692e6f72672f64636172626f6e652f75676c792d71756575652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dcarbone/ugly-queue)

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

[](#installation)

This library is designed to be installed into your app using [https://getcomposer.org/](Composer). Simply copy-paste the following line into your `"requires:"` hash:

```
"dcarbone/ugly-queue": "0.4.*"
```

Basic Usage
-----------

[](#basic-usage)

Once installed, you must first initialize an instance of [src/UglyQueueManager.php](UglyQueueManager). This is done as such:

```
$queueBaseDir = 'path to where you would like queue files and directories to be stored';

$manager = new UglyQueueManager($queueBaseDir);
```

Once initialized, you can start adding queues!

```
$sandwichQueue = $manager->createQueue('sandwiches');

$sandwichQueue->lock();

$sandwichQueue->addItems(array(
    'bread',
    'meat',
    'cheese',
    'lettuce',
    'bread'
));

$sandwichQueue->unlock();
```

Once you have items added to the queue, you can either pull items out ad-hoc or set up some sort of cron or schedule task to process items regularly.

If the base directory for all of your queues remains the same, each initialization of `UglyQueueManager` will automatically find and initialize instances of pre-existing UglyQueues.

In a subsequent request, simply do the following:

```
$queueBaseDir = 'path to where you would like queue files and directories to be stored';

$manager = new UglyQueueManager($queueBaseDir);

$tastySandwich = $manager->getQueue('sandwiches');

// 'sandwiches' queue will exist now

$tastySandwich->lock();

// Specify the number of items you wish to retrieve from the queue

$items = $tastySandwich->retrieveItems(4);

// $items is now an array...

var_export($items);

/*
array (
  4 => 'bread',
  3 => 'lettuce',
  2 => 'cheese',
  1 => 'meat',
)
*/
```

The queue will then retain a single item, `0 => 'bread'` as the 5th item left in the queue.

At any time you can determine how many items remain in a queue by executing `count($queueObj);`

There are a few limitations currently:

1. This lib is designed for small values without much in the way of formatting or line breaks
2. It is designed to be atomic, meaning that only one process can be adding / retrieving items from a queue at a time. Reading actions (count, searching, etc) are NOT atomic, however.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~69 days

Recently: every ~104 days

Total

7

Last Release

3880d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/385c0c0eae1b51f1e81ee464ff6bfb3cce32589ac252ca68cc3a8aec2e3ada14?d=identicon)[dcarbone](/maintainers/dcarbone)

---

Top Contributors

[![dcarbone](https://avatars.githubusercontent.com/u/1392439?v=4)](https://github.com/dcarbone "dcarbone (29 commits)")

---

Tags

phpqueuefile queueugly queue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dcarbone-ugly-queue/health.svg)

```
[![Health](https://phpackages.com/badges/dcarbone-ugly-queue/health.svg)](https://phpackages.com/packages/dcarbone-ugly-queue)
```

###  Alternatives

[microsoft/azure-storage-queue

This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage Queue APIs.

142.6M17](/packages/microsoft-azure-storage-queue)[renoki-co/horizon-exporter

Export Laravel Horizon metrics using this Prometheus exporter.

24152.7k](/packages/renoki-co-horizon-exporter)[webparking/laravel-queue-ensurer

This composer package provides a Laravel queue ensurer.

6416.1k](/packages/webparking-laravel-queue-ensurer)

PHPackages © 2026

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