Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
package_manager_trim.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/package_manager.inc';
18 
32 {
33 
34 
40  {
41  $this->_full_path = SQ_PACKAGES_PATH.'/trim';
42  $this->Package_Manager();
43 
44  }//end constructor
45 
46 
56  {
57  if ($GLOBALS['SQ_SYSTEM']->am->installed('cron_job_update_trim_record')) {
58  return Array('cron_job_update_trim_record');
59  } else {
60  return Array();
61  }
62 
63  }//end getSystemAssetTypes()
64 
65 
73  {
74  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
75  if (is_null($cron_manager)) {
76  trigger_error('Couldn\'t get cron manager, couldn\'t create Update Trim Record cron job', E_USER_WARNING);
77  $null = NULL;
78  return $null;
79  }//end if
80 
81  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_update_trim_record');
82 
83  $cron_job = new Cron_Job_Update_Trim_Record();
84  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
85  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
86  trigger_error('Update Trim Record Cron Job NOT CREATED', E_USER_ERROR);
87  }//end if
88  pre_echo('Update Trim Record Cron Job Id: '.$cron_job->id);
89 
90  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_update_trim_record', $cron_job->id);
91 
92  return $cron_job;
93 
94  }//end createCronJobUpdateTRIMRecord()
95 
96 
97 }//end class
98 ?>