hfcorriez / croon Goto Github PK
View Code? Open in Web Editor NEWPHP Crontab
PHP Crontab
你好,
我在运行
Please provide a version constraint for the croon/croon requirement:
然后我就不知道该输入多少版本号了,上一步 composer install 是成功的。
曾尝试不做这一步,直接使用,新建了一个 croon.list 的文件 使用
PHP Fatal error: Class 'Pagon\ChildProcess\ChildProcess' not found in /root/croon/src/Croon/Croon.php on line 36
Fatal error: Class 'Pagon\ChildProcess\ChildProcess' not found in /root/croon/src/Croon/Croon.php on line 36
但是我查找了一下这个文件是存在的,
麻烦分析一下是什么问题导致的,我对composer 和 posix 及 pencl 都不是很了解。只是按相关的文档安装上的。
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Updating dependencies
[Composer\Downloader\TransportException]
Content-Length mismatch
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] []...
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Checking composer.json: FAIL
require.pagon/eventemitter : unbound version constraints () should be avoided
require.pagon/logger : unbound version constraints () should be avoided
require.pagon/argparser : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Warning: Accessing packagist.org over http which is an insecure protocol.
OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
如何daemon方式运行.另外有什么监控 的手段?
问题出在auto_write,如果不对这个设置值即采用默认的(false),这时候生成的日志会出现好多冗余数据,每一次的写入都会把以前的信息再加起来,好像是把所有的日志累加起来了,后来我尝试把auto_write设置成了 true 发现这个问题就不存在了。
下面是我的一段实际测试命令,通过wc -l 获取log日志的总行数,可以看出区别。
看了看日志功能的代码,功底太浅,被玩的快走火入魔了。。。。还是看不懂。
$ echo ''>cron.log
$ cat cron.list
* * * * * * ls
$ time bin/croon -l cron.log cron.list
^C
real 0m20.111s
user 0m0.359s
sys 0m0.279s
$ wc -l cron.log
548 cron.log
$ echo ''>cron.log
$ vim bin/croon
$ # 把 auto_write 设置成了 true
$ time bin/croon -l cron.log cron.list
^C
real 0m19.856s
user 0m0.353s
sys 0m0.317s
/Documents/phpcron$ wc -l cron.log
65 cron.log```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.