Giter Site home page Giter Site logo

maikuolan / cronable Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 3.0 46 KB

Cronable is a simple script that allows auto-updating CIDRAM and phpMussel via cronjobs.

License: MIT License

PHP 100.00%
cron cronjobs cronable cidram phpmussel php auto-update update updating

cronable's Introduction

PHP >= 5.4 License: MIT PRs Welcome

Cronable.

Cronable is a simple script that allows auto-updating CIDRAM >= 1.2 and phpMussel >= 1.1 < 3.0 via cronjobs.


How to install:

You can download the file containing the class, Cronable.php, directly from this repository, or, if you'd prefer, you can install it using Composer:

composer require maikuolan/cronable

Cronable is a stand-alone class that has no dependencies other than PHP, the cURL extension of PHP, and something to trigger it at the desired interval (generally, a cron manager of some description), and so, downloading it is all there really is to "installing" it.


How to use:

For auto-updating CIDRAM or phpMussel with Cronable, front-end management will need to be enabled. Create a new account from the accounts page for Cronable to use, and set the permissions for this new account to "Cronable" (the "Cronable" permissions type is intended only for Cronable, and shouldn't be used for anything else). Take note of the username and password that you choose for this new account, because you'll need it in a moment.

Next, check the examples.php file, and using the instructions and examples given in the file, create your update tasks as per necessary.

Using your cron manager or other triggering mechanism, create a new cron task with the desired update interval (please don't choose an excessively short interval, as the inbound requests received by the servers containing the updates may perceive this as abuse, and you may blocked by them as a consequence; checking for updates once a day should be more than enough; most updates tend to be released once per week or once per month anyhow), pointing to the file containing your Cronable update tasks.

That's everything. :-)


Other information:

Licensing:

MIT License.

For support:

Please use the issues page of this repository.


Last Updated: 21 November 2021 (2021.11.21).

cronable's People

Contributors

maikuolan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

cronable's Issues

Better error handling.

Requested as per discussions at Gitter. Creating this issue as a self-reminder. Will get this sorted out a little later.

another error when updating

i now get this

PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/cidram/vault/functions.php:769
Stack trace:
#0 /var/www/cidram/vault/frontend_functions.php(720): Maikuolan\Cronable\Cronable->{closure}()
#1 /var/www/cidram/vault/frontend_functions.php(707): Maikuolan\Cronable\Cronable->{closure}()
#2 /var/www/cidram/vault/frontend.php(1790): Maikuolan\Cronable\Cronable->{closure}()
#3 /var/www/cidram/loader.php(102): require('...')
#4 /var/www/cidram/src/Cronable.php(253): require('...')
#5 /var/www/cidram/examples.php(17): Maikuolan\Cronable\Cronable->localUpdate()
#6 {main}
thrown in /var/www/cidram/vault/functions.php on line 769

PHP Notice: error when updating

after the last few updates of cidram
I now get this error when updating

PHP Notice: Undefined index: MajorVersionNotice in /var/www/cidram/vault/frontend.php on line 1672

support for cidram v3

keep getting an error after updating to cidram v3

"An error occurred while attempting to update at [CIDRAM@/var/www/cidram/vault/loader.php]. :-(

my examples.php file is this


<?php
require __DIR__ . '/src/Cronable.php';


use \Maikuolan\Cronable\Cronable;

$Cronable = new Cronable;

$Cronable->execute();

$Cronable->localUpdate('CIDRAM', 'user', 'password', '/var/www/cidram/vault/loader.php', 'Everything');
echo $Cronable->Output;

error_log possible cronable issue

I see this in the main directory outside of public_html. I asked my host and he says it could be related to a script or cron.

[31-Jan-2018 01:00:01 America/Chicago] PHP Warning: Module 'timezonedb' already loaded in Unknown on line 0
[01-Feb-2018 01:00:01 America/Chicago] PHP Warning: Module 'timezonedb' already loaded in Unknown on line 0
[02-Feb-2018 01:00:01 America/Chicago] PHP Warning: Module 'timezonedb' already loaded in Unknown on line 0

Actually, looking at the time, it is related to cronable since that's the time it executes.

Stopped working

The Cronable was working fine for me. But it has stopped working, don't know since when.

When I execute Cronable, I get this:

Cronable v1.2.0 Time: Thu, 06 Sep 2018 04:09:23 +0000 === Everything already up-to-date at [[email protected]/loader.php]. :-) === Time: Thu, 06 Sep 2018 04:09:23 +0000

But, in the CIDRAM front-end I can see updates.

CIDRAM Update-Available

My update script is this:

<?php

/** Requiring the Cronable class file. */
require __DIR__ . '/src/Cronable.php';

/** Importing the Cronable class from its namespace. */
use \Maikuolan\Cronable\Cronable;

/** Instantiate a new object from the Cronable class. */
$Cronable = new Cronable;

$Cronable->createTask('CIDRAM', 'username', 'password', 'http://example.com/loader.php');

/** After you've created your tasks, you'll want to execute them all. */
$Cronable->execute();

echo $Cronable->Output;

Cron not working for CIDRAM in WordPress

Hi

I have spent some time trying to get CIDRAM to update via a cron job and I am still unsuccessful and I was hoping you could give me some assistance.

Here is how I have tried to get it to work.

I have downloaded the file Cronable.php and put it in the same directory as loader.php

I have used and modified the file examples.php to fit my directory structures adding the user created using the front end with permissions cronable.

To execute I am using the WordPress plugin WP Crontrol to set up a PHP cron event. The plugin is super simple and allows you to take the modified examples.php code and insert it in and set the execution frequency.

I have tried manipulating the examples.php file many times but nothing has worked.

The current errors I am getting is:

I am getting errors like ...

Warning ... No such file or directory in... eval()'d code on line 12

Fatal error: require(): Failed opening required .... eval()'d code on line 12

I am not sure if I should be posting the full errors here but would send them to you privately if needed.

The line 12 constantly referred to is:

require DIR . '/src/Cronable.php';

I have tried changing the path shown in line 12 and I always get errors. I have tried creating the dir src in the directory structure where WP Crontrol lives and put cronable.php in that directory and all errors go away but CIDRAM is not updated...

Any ideas?

Would be nice if the WordPress install just created the cron job like other WordPress plugins do. I have never had to manually create one before. I use WP Crontrol to easily change the frequency or disable jobs as needed.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.