PhpTaskDaemon
A deamon framework for running PHP continously and in daemon mode.
Install / Use
/learn @DirkEngels/PhpTaskDaemonREADME
#################################################################
DEPRECATED!!! DO NOT USE THIS. ONLY FOR EDUCATIONAL PURPOSES.
DOES NOT USE IN PRODUCTION.
#################################################################
PhpTaskDaemon
- PhpTaskDaemon Introduction
- Installation
- Usage
- Contribute
- License
- Contact Information
PhpTaskDaemon Introduction
PhpTaskDaemon is a library for creating php daemons for unix environments (requirement: pcntl and posix extension). It provides a simple api for defining queues and task executors. Tasks are run by managers, which define the way when and how tasks are executed. A single command line script is used to start, stop and monitor the daemon.
Features
- Start multiple workers/instances of tasks
- Supports multiple task managers:
- Interval
- Cron
- Forked
- Gearman
- Logs to one or more log files
- Manages state information of child processes using shared memory.
- Provides an easy api to request daemon state information.
Requirements
- PHP 5.3
- command line
- pcntl extension
- shared memory
- Zend Framework
- Zend_Log
- Zend_Console_GetOpt
- Zend_Config
Installation
Basic installation
- Extract the package
- Edit the configuration file: src/application/configs/daemon.ini
- Start the executable in src/bin
Startup on boot
- Edit the file (doc/files/init-script)
- Copy the edited init script file to /etc/init.d/phptaskdaemon
Restart by cron
- Add a crontab job:
-
-
-
-
-
- /path/to/phptaskdaemon/bin/phptaskdaemon --action start
-
-
-
-
-
Usage
A command line tool is provided to start, stop and monitor the daemon. Below a
Command line:
- Start: ./daemon --help
- Start: ./daemon --action start
- Stop: ./daemon --action stop
- Status ./daemon --action status
- Monitor ./daemon --action monitor
PHP API Example:
$daemon = new Dew_Daemon(); $status = $daemon->status(); var_dump($status);
Contact Information
For more info about the PhpTaskDAemonapplication see the website:
GitHub: https://github.com/DirkEngels/PhpTaskDaemon Blog: http://blog.dirkengels.com/category/phptaskdaemon/
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
