mode cron + base config in .example file #28#46
Closed
Asenar wants to merge 26 commits into
Closed
Conversation
A ping which is not possible resulted in a "0 ms" value which is not consistent with the reality. A "+Infinity" is more appropriate.
Since a ping may fail, it is relevant to use the w15p class in order to show if the ping was successful or not. Moreover, showing the time of a not valid ping is not relevant and it means the server is offline.
This will show the IP of the user and the connection date
like this: "Jan 27 2016 16:27:59" which is more appropriate
than the previous version ("Jan Wed +0100 27").
Default json config example should not have the name of the real file.
+ Make sure config is personal + Fix ping and lastlog
Misc::cache($name, $data = null, $lifetime = 0) is a simple cache filesystem
which will serialize $data to a file in write operation, or return
the values in read operation. Writes are made if the argument
`--save` is used when running the command.
Misc::exec() and Misc::shellexec() will first check if
a result is in cache for that command, and return it if exists.
Otherwise, command will be executed then eventually saved in cache
for next call (if `--save` argument has been used).
set version 2.6 Changes: + Config class is a singleton + mode «cron» (datas refreshed by cron, read only access for apache/php) + new lib : last_sftp_login + new lib : last_cron + various fixes (optimized for debian 7/8)
|
Nice improvements! I really appreciate the sftp addition (I will try this soon :) ) |
Author
|
I did that a long time ago and don't know if its "generic" enough. Tell me if some things are missing :) |
Author
|
Hi, I close this PR as I rebased everything in #50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
I modified your code to add a mode
cron: when enabled, you can call./cron/cron-monitoringwhich will run every php scripts in libs/ and save the result in a cache directory. The web interface uses theses files.This way, it's possible to disable exec/shell_exec/passthru/… functions in
php.ini@QuentinCG improvements are included
There is also some optimization (Config class works as singleton).