Source Code Documentation


s2member\includes\classes\cron-jobs-in.inc.php


  1. <?php
  2. /**
  3. * Cron routines handled by s2Member (inner processing routines).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package s2Member\Cron_Jobs
  15. * @since 3.5
  16. */
  17. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  18. exit ("Do not access this file directly.");
  19.  
  20. if (!class_exists ("c_ws_plugin__s2member_cron_jobs_in"))
  21. {
  22. /**
  23. * Cron routines handled by s2Member (inner processing routines).
  24. *
  25. * @package s2Member\Cron_Jobs
  26. * @since 3.5
  27. */
  28. class c_ws_plugin__s2member_cron_jobs_in
  29. {
  30. /**
  31. * Extends WP-Cron schedules to support 10 minute intervals.
  32. *
  33. * @package s2Member\Cron_Jobs
  34. * @since 3.5
  35. *
  36. * @attaches-to ``add_filter("cron_schedules");``
  37. *
  38. * @param array $schedules Expects an array of WP_Cron schedules passed in by the Filter.
  39. * @return array Array of WP_Cron schedules after having added a 10 minute cycle.
  40. */
  41. public static function extend_cron_schedules ($schedules = array ())
  42. {
  43. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  44. do_action ("ws_plugin__s2member_before_extend_cron_schedules", get_defined_vars ());
  45. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  46.  
  47. $array = array ("every10m" => array ("interval" => 600, "display" => "Every 10 Minutes"));
  48.  
  49. return apply_filters ("ws_plugin__s2member_extend_cron_schedules", array_merge ($array, $schedules), get_defined_vars ());
  50. }
  51. /**
  52. * Allows the Auto-EOT Sytem to be processed through a server-side Cron Job.
  53. *
  54. * @package s2Member\Cron_Jobs
  55. * @since 3.5
  56. *
  57. * @attaches-to ``add_action("init");``
  58. *
  59. * @return null Or exits script execution after task completed.
  60. */
  61. public static function auto_eot_system_via_cron ()
  62. {
  63. do_action ("ws_plugin__s2member_before_auto_eot_system_via_cron", get_defined_vars ());
  64.  
  65. if /* Called through HTTP? */ (!empty ($_GET["s2member_auto_eot_system_via_cron"]))
  66. {
  67. if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"])
  68. {
  69. c_ws_plugin__s2member_auto_eots::auto_eot_system (); // Process.
  70.  
  71. do_action ("ws_plugin__s2member_during_auto_eot_system_via_cron", get_defined_vars ());
  72. }
  73. exit /* Clean exit. */ ();
  74. }
  75. do_action ("ws_plugin__s2member_after_auto_eot_system_via_cron", get_defined_vars ());
  76. }
  77. }
  78. }
  79. ?>

s2member\includes\classes\cron-jobs-in.inc.php

Source Code Documentation