Download the PHP package nabeghe/cronark without Composer

On this page you can find all versions of the php package nabeghe/cronark. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cronark

Cronark

A lightweight, cron-based background job scheduler and worker manager for PHP.

Cronark provides a simple yet powerful solution for running background jobs in PHP applications. Unlike traditional queue systems that require external services (Redis, RabbitMQ, Beanstalkd), Cronark works with just cron and minimal storage; making it perfect for shared hosting, small to medium projects, or anywhere you want to avoid infrastructure complexity.


๐ŸŽฏ Why Cronark?

The Problem with Traditional Queue Systems

Most PHP queue solutions come with significant challenges:

The Cronark Solution

Cronark takes a different approach:


๐Ÿ“ฆ Installation

Install via Composer:

Requirements:

๐Ÿš€ Quick Start

1. Create a Job

2. Register the Job

Create a worker file (e.g., worker.php):

3. Setup Cron

Add to your crontab:

That's it! Your jobs will now run continuously in the background.

๐ŸŽจ Features

Multiple Workers Run different workers for different job types:

Process Management

Cronark automatically prevents duplicate workers:

Job Ordering

Control job execution order:

Custom Storage

Implement your own storage backend (Database, Redis, Memcached, etc.):

Built-in Storage:

Lifecycle Hooks

Customize worker behavior:

Performance Tuning

Control CPU usage by adding delay between job executions:

When to use delay:

When NOT to use delay:

Recommended values:

๐Ÿ“– How It Works

Architecture

Process Flow

Job Wrapping

Jobs execute in a circular fashion:

This ensures all jobs get executed repeatedly without any sitting idle.

๐Ÿ”ง Advanced Usage

Jobs can throw exceptions; they won't stop the worker:

Error Handling

Worker Isolation

Each worker maintains its own state:

Cron Schedule Examples

Deployment on Shared Hosting

Most shared hosting providers (cPanel, Plesk) offer cron job access:

cPanel:

  1. Go to "Cron Jobs"
  2. Add: * php /home/username/public_html/worker.php

Plesk:

  1. Go to "Scheduled Tasks"
  2. Add command: php /var/www/vhosts/domain.com/worker.php
  3. Set schedule: Every minute

๐Ÿงช Testing

Test Coverage: 67 tests with full coverage of all core functionality.

๐Ÿ›ก๏ธ Reliability

Duplicate Prevention

Cronark uses PID + Script Path verification to prevent duplicate workers:

Crash Recovery

If worker crashes, cron will restart it on next trigger:

Atomic Storage

File operations use LOCK_EX for atomic writes:

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ’ก Use Cases

Perfect for:

๐Ÿ“š Documentation

Core Classes

Key Methods

โš ๏ธ Important Notes

  1. Execution Time: Workers run indefinitely; ensure your hosting allows long-running processes
  2. Memory: Monitor memory usage if jobs process large datasets
  3. Error Handling: Always implement proper error handling in jobs
  4. Logging: Use the print() method or implement custom logging
  5. Database Connections: Reconnect to database in onJobCreating() hook to avoid timeout issues

๐ŸŒŸ Show Your Support

If you find Cronark useful, please:

๐Ÿ“– License

Licensed under the MIT license, see LICENSE.md for details.


Made with โค๏ธ by (Nabeghe)[https://github.com/nabeghe]

Cronark - Simple, Reliable, Zero-Dependency Background Jobs for PHP


All versions of cronark with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nabeghe/cronark contains the following files

Loading the files please wait ...