Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

PHP-controlled CronJobs like Wordpress #1099

Closed
Deesen opened this issue Dec 13, 2016 · 18 comments
Closed

PHP-controlled CronJobs like Wordpress #1099

Deesen opened this issue Dec 13, 2016 · 18 comments

Comments

@Deesen
Copy link
Contributor

Deesen commented Dec 13, 2016

https://github.com/WordPress/WordPress/blob/master/wp-cron.php

Related to issues

@modx-developer
Copy link
Contributor

nice idea !

@nick0
Copy link

nick0 commented Dec 14, 2016

+10. Great stuff, thanks Deesen

@Nicola1971
Copy link
Contributor

@Deesen check this:
http://www.phpjobscheduler.co.uk/

@Deesen
Copy link
Contributor Author

Deesen commented Jan 10, 2017

Thanks. And there are a lot of other scripts https://www.google.de/search?q=php+job+scheduler . Question is how to exactly implement a cronjobs-feature into Evo.

  • How will the user-interface look like, which options will it have?
  • Will it have a list of predefined options delivered by custom modules like "EvoBackup" or "EvoCheck"?
  • Or will users have to define the URL / parameters manually, that should be called by a cronjob?
  • etc.

@Nicola1971
Copy link
Contributor

I'm not a cron expert, but i think we need to add two features

  • Cronjob support for backup (so you can set your crons from server panel)

  • A Fake Cronjob Module: for users without cronjob access (like wordpress), ie phpjobscheduler

@Nicola1971
Copy link
Contributor

this a snippet based on AutoEvoBackup, we could use with cron (not tested).
https://github.com/Nicola1971/CronEvoBackup

  1. install
  2. create a page cron.html with this call [!CronEvoBackup? &mode=`dbonly` &zipdb=`0` &rootfiles=`0` &deletesql=`0` &customfiles=`0` !]
  3. run the page

you can call the page with parameters in url:
www.domain.com/cron.html&mode=light&zipdb=1&deletesql=1&customfiles=1&customfold1=shop

@bossloper
Copy link
Contributor

www.domain.com/cron.html would need to be secured in some way.

@Nicola1971
Copy link
Contributor

another way is a fakecron module, that runs the snippet ($modx->runSnippet) inside the manager

@Nicola1971
Copy link
Contributor

Nicola1971 commented Jan 10, 2017

i started to trying to convert phpjobscheduler to a evo module, but a lot of things still not working :) :

@nick0
Copy link

nick0 commented Jan 11, 2017

I really like the idea of the "fake cron" module, so it can all be done within Evo, preferably in the current backup section so its all together. This would be more seamless and slicker and consistent with WordPress' ease of backup scheduling (with a WP plugin of course :) ).
I personally don't know how to do Cron jobs, and won't always have access to do them either. I am sure many other Evo users are in the same boat.
Something that works within Evo for non technical users would be amazing.
Thanks so much for your great work.

@Nicola1971
Copy link
Contributor

OK, i got a very alpha, but working phpjobscheduler "fake cron" module. :-)

The package includes:

  1. A basic phpjobscheduler module
  2. A CronEvoBackup snippet (to create backups like EvoBackups)
  3. A small plugin firepjs to render the invisible image on frontend
  4. An example php file to run the CronEvoBackup snippet (thank @pmfx for the tip ) https://github.com/Nicola1971/JobScheduler/blob/master/assets/modules/jobscheduler/cron-backup-sqlonly.php

In this way we can run any snippet with Fake Crons

I think is a nice starting point.

Anyone want to try?
https://github.com/Nicola1971/JobScheduler

Just install with Package Manager and try

@Nicola1971
Copy link
Contributor

updates:
by2xsj2yrevbaaaaaelftksuqmcc

f3gykd4jxzpoaaaaaelftksuqmcc

bz9hcoq3h2udaaaaaelftksuqmcc

jsqbm15on0qaaaaasuvork5cyii

@nick0
Copy link

nick0 commented Jan 13, 2017

Awesome @Nicola1971, I cant wait to test it.

Can I please ask a basic question? Up above you mentioned "Just install with Package Manager and try".
Where can I actually download the package manager?
Is this it?: http://extras.evolution-cms.com/packages/utilityi/packagemanager.html
Thanks

@bossloper
Copy link
Contributor

'Is it this?' - Yes, just install from 'Extras' module.
As an aside - To me as 'Package Manager' is now [depreciated] https://github.com/Jako/PackageManager I'd like to see it merged into Extras functionality as one module for all package management needs.

@nick0
Copy link

nick0 commented Jan 14, 2017

Beauty, thanks for confirming that @bossloper, I will give the depreciated Package manager a crack. Cheers

@Nicola1971
Copy link
Contributor

Agree with @bossloper - for my way to work with Evo, Package Manager is the most important extra. I always work with custom packages: templates, sets of chunks, snippets and plugins.

I've tried @Dmi3yy Install Manager, but cant get it work

@bossloper
Copy link
Contributor

@Nicola1971 - getting an error as my MODX install is in a sub-directory.
https://github.com/Nicola1971/JobScheduler/blob/master/assets/modules/jobscheduler/pjsfiles/config.inc.php#L6
Think this needs to be using MODX_BASE_PATH ?

@Nicola1971
Copy link
Contributor

Nicola1971 commented Jan 14, 2017

@bossloper yes, need more integration with modx api, for base path and manager path (actually does not support alternative manager folder names too) and requires hardcoded path to work in my windows wamp localhost,
include_once ($_SERVER['DOCUMENT_ROOT'].'evo-test/manager/includes/config.inc.php');
so, i suppose need the something similiar in subdomains enviroments

before more api integrations and any other improvements from this beta1 - i need to be sure that phpjobscheduler satisfy our needs for Evo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants