• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 483
  • Last Modified:

might pay for this if it's to much work.

I am trying to make a pseudo cron job php script.

i found this site

but it write to a txt file how can i change it to write to a data base ?
0
armasmike
Asked:
armasmike
  • 3
  • 2
1 Solution
 
Jagadishwor DulalBraces MediaCommented:
What do you want to write in database the pseudo cron code or ???
0
 
armasmikeAuthor Commented:
I would like the code to not use a text file at all to store all the info and read the info from a db.
0
 
Slick812Commented:
greetings   armasmike, , I looked at the code for the pseudo-cron  job , that you gave a link to, and I do not nderstand your question, based on what this pseudo-cron is designed to do.
First, the pseudo-cron  does write to a text file as a "Log" recorder (maybe only in DEBUG mode). . It uses a rather bad way to record job "LastRun" time, by using a time modified on a "Job" file, not sure if it actually writes anything to that file. So the code that I looked at does not do any Data writes to a file, that I noticed.

What this does do, , is READ a text file, that has a list of PHP files that you want to run as cron jobs, and reads a date and time for the cron-job, and tests if the scheduled time, is in the past or future, if it is in the past, it calls -
include($job[PC_CMD]);

the  $job[PC_CMD]  would be the PHP file name and Path , like -
/php_cmd/delete_temp.php

If you are wanting to do a cron job list - READ - from a Database, instead of a file, it would require several many changes to the pseudo-cron code, and may take some effort, just working through this pseudo-cron code for and over view, took some time for me.
But as far as I can see, it uses a File to read the job list from, so you can set-up and change the cron jobs, by writing your cron job list to file , or change the cron job list file.
You may have a good reason to want a database read, but I can not think of any reason not to use the file read that this is set up to do.

ALSO, it is my opinion that this uses an Older PHP coding style, with alot of  GLOBAL variables, which these days are considered Bad PHP coding?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
armasmikeAuthor Commented:
Thank you for your input i am trying to make a plugin for a cms program. Wordpress has one build in called wp-cron.php. That users and set jobs to run with out having to use crontab in there cpanel.

This way the plugin can be install on a win server and still work. I am trying to find someone i pay or some free code that can be changed a bit for my plugin to work.

If you have time or if you know some one that does i would be willing to pay to get this done.
0
 
Slick812Commented:
Sorry, I do not have time in the near future, to Redo this "pseudo cron job" code for a database, I would NOT want to use his code methods anyway. I would think that a "DataBase" use code might be tricky, because of the specific Table structure you would need to have in this May not be available in wordpress standard database tables, I can not see a "One Size Fits All" Table read write code as very possible for this kind of thing. I would think that someone would need to do alot of testing and error checking to make a successful WordPress Database Cron-Job plugin that works in different situations.

I do not know anyone that can do this at this time. There is a section in EE where you can hire an EE expert.
0
 
armasmikeAuthor Commented:
Thank you i will look at hiring a EE expert
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now