ECI: Developer Guide
This guide is aimed at supporting developers and will act like an operating manual. As I write this a lot of standard user support content is still required especially videos. New content will be added here in response to questions that I feel require text on this page to answer them fully. Please contact the webmaster@webtechglobal.co.uk with any questions you have that you feel is developer related.
ECI Maximum Execution Time Limit
June 2011 I added a global variable called ECIMAXEXE and that holds the users server maximum execution time minus five seconds. The five seconds are to ensure that the end of a process has plenty time to finish. ECIMAXEXE is used to count from the beginning of a function to the end of a loop within that function. Such functions are those that create posts, update posts, import data and update data. Such events can happen automatically and before the functions that do these events are called some amount of processing will take place. That processing is not counted and so the 5 seconds also helps to cover that.
The aim here is to use the timer to break a loop no matter when the users settings are. This now means that users should not be able to bring their site down for a few minutes by pushing the blog hard.
Schedule System
The schedule system is a cron alternative and does not use CRON directly. I decided that Easy CSV Importer needs it’s own approach to scheduling due to the size of tasks we’re dealing with. Speed profiles control when events are automatically processed. Scheduling of posts is handled by WordPress CRON simply by applying a publish date in the future. ECI checks the final publish date /time and also makes a final decision on post status based on that date. If the date is in the future then the status is set to scheduled.
Schedule Types
Schedule types are used in the eci_eventschedulecheck() function, which checks for due events and triggers them to be actioned. The schedule type is what runs the required function or includes the required scripts in order to perform the scheduled operation.
- Import - first time data import operation, only on staggered projects.
- Extractor - triggers the extraction of csv files in compressed folders.
- UpdateStaggered – data update action on a staggered mode.
- UpdateEventsMany – data update, one of multiple events, sql insert query per record.
- UpdateFullMany – data update, entire file at once, sql insert query per record.
- ModificationCheck - compares all csv file modification dates against the last known date in array.
- Posts - makes posts, currently for staggered only, all other methods are manual right now.