Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
package_manager_core.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/package_manager.inc';
18 
31 {
32 
33 
39  {
40  $this->_full_path = SQ_CORE_PACKAGE_PATH;
41  $this->Package_Manager();
42 
43  }//end constructor
44 
45 
52  function getPackageName()
53  {
54  // need to override because we don't really want to have to name the Package_Manager___Core__ :)
55  return '__core__';
56 
57  }//end getPackageName()
58 
59 
69  function updatePackageDetails($update_assets=Array())
70  {
71  // If there were failures in core packages, return FALSE as dependency
72  // resolution won't work (if a core package relies on another package,
73  // what is the world coming to?)
74  if ($this->checkPackageDetails($update_assets) !== TRUE) {
75  return FALSE;
76  }
77 
78  // open the transaction
79  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
80  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
81 
82  // Now we can do the normal package update
83  if (!parent::updatePackageDetails($update_assets)) {
84  $GLOBALS['SQ_SYSTEM']->doTransaction('ROLLBACK');
85  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
86  return FALSE;
87  }
88 
89  // Commit the transaction if we got this far
90  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
91  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
92  return TRUE;
93 
94  }//end updatePackageDetails()
95 
96 
97  //-- FUNCTIONS TO CREATE SYSTEM ASSETS --//
98 
99 
109  {
110  return Array(
111  'root_folder',
112  'system_management_folder',
113  'log_manager',
114  'web_folder_designs',
115  'web_folder_media',
116  'web_folder_users',
117  'public_user',
118  'trash_folder',
119  'system_user_group',
120  'root_user',
121  'authentication_folder',
122  'cron_manager',
123  'trigger_manager',
124  'layout_manager',
125  'remap_manager',
126  'cache_manager',
127  'designs_folder',
128  'login_design',
129  'ees_login_design',
130  'password_change_design',
131  'cron_job_expired_workflow',
132  'cron_job_generate_log_reports',
133  'cron_job_escalate_safe_trash',
134  'tag_manager',
135  'cron_job_metadata_triggers',
136  'cron_job_expired_matrix_cache',
137  'cron_job_expired_matrix_locks',
138  );
139 
140  }//end getSystemAssetTypes()
141 
142 
149  function &createRootFolder()
150  {
151  $GLOBALS['SQ_SYSTEM']->am->includeAsset('root_folder');
152 
153  $root_folder = new Root_Folder();
154  $link = Array();
155  if (!$root_folder->create($link)) {
156  trigger_localised_error('CORE0001', E_USER_ERROR, 'Root Folder');
157  }
158 
159  pre_echo('Root Folder Asset Id : '.$root_folder->id);
160  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('root_folder', $root_folder->id);
161 
162  return $root_folder;
163 
164  }//end createRootFolder()
165 
166 
173  function &createTrashFolder()
174  {
175  $root_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_folder');
176 
177  $GLOBALS['SQ_SYSTEM']->am->includeAsset('trash_folder');
178  $trash_link = Array(
179  'asset' => &$root_folder,
180  'link_type' => SQ_LINK_TYPE_1,
181  'is_exclusive' => 1,
182  'sort_order' => 0,
183  'is_locked' => 1,
184  );
185  $trash_folder = new Trash_Folder();
186  if (!$trash_folder->create($trash_link)) {
187  trigger_localised_error('CORE0001', E_USER_ERROR, 'Trash Folder');
188  }
189  pre_echo('Trash Asset Id : '.$trash_folder->id);
190 
191  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('trash_folder', $trash_folder->id);
192  return $trash_folder;
193 
194  }//end createTrashFolder()
195 
196 
203  function &createPublicUser()
204  {
205  $users_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('web_folder_users');
206 
207  $GLOBALS['SQ_SYSTEM']->am->includeAsset('public_user');
208  $public_user = new Public_User();
209  $public_user_link = Array(
210  'asset' => &$users_folder,
211  'link_type' => SQ_LINK_TYPE_1,
212  'is_locked' => 1,
213  );
214  if (!$public_user->create($public_user_link)) {
215  trigger_localised_error('CORE0001', E_USER_ERROR, 'Public Access User');
216  }
217  pre_echo('Public Access User Asset Id : '.$public_user->id);
218 
219  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('public_user', $public_user->id);
220 
221  return $public_user;
222 
223  }//end createPublicUser()
224 
225 
233  {
234  $root_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_folder');
235 
236  $GLOBALS['SQ_SYSTEM']->am->includeAsset('system_management_folder');
237  $system_management_folder = new System_Management_Folder();
238  $system_management_folder_link = Array(
239  'asset' => &$root_folder,
240  'link_type' => SQ_LINK_TYPE_1,
241  'is_exclusive' => 1,
242  'sort_order' => 0,
243  'is_locked' => 1,
244  );
245  if (!$system_management_folder->create($system_management_folder_link)) {
246  trigger_localised_error('CORE0001', E_USER_ERROR, 'System Management Folder');
247  }
248  pre_echo('System Management Asset Id : '.$system_management_folder->id);
249 
250  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('system_management_folder', $system_management_folder->id);
251  return $system_management_folder;
252 
253  }//end createSystemManagementFolder()
254 
255 
263  {
264  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
265 
266  $GLOBALS['SQ_SYSTEM']->am->includeAsset('system_user_group');
267  $system_user_group = new System_User_Group();
268  $system_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
269  if (!$system_user_group->create($system_link)) {
270  trigger_localised_error('CORE0001', E_USER_ERROR, 'System Admin Group');
271  }
272  pre_echo('System Administrators User Group Asset Id : '.$system_user_group->id);
273 
274  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('system_user_group', $system_user_group->id);
275  return $system_user_group;
276 
277  }//end createSystemUserGroup()
278 
279 
286  function &createRootUser()
287  {
288  // turn off password validation
289  $current_run_level = $GLOBALS['SQ_SYSTEM']->getRunLevel();
290  $GLOBALS['SQ_SYSTEM']->setRunLevel($current_run_level - SQ_SECURITY_PASSWORD_VALIDATION);
291 
292  $system_user_group = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_user_group');
293 
294  $GLOBALS['SQ_SYSTEM']->am->includeAsset('root_user');
295  $root_user = new Root_User();
296  $user_link = Array('asset' => &$system_user_group, 'link_type' => SQ_LINK_TYPE_1);
297 
298  $root_pass = isset($_SESSION['install_root_pass']) ? $_SESSION['install_root_pass'] : 'root';
299 
300  $root_user->setAttrValue('password', $root_pass);
301  $root_user->setAttrValue('first_name', 'Root');
302  $root_user->setAttrValue('last_name', 'User');
303  $root_email = (SQ_CONF_DEFAULT_EMAIL) ? SQ_CONF_DEFAULT_EMAIL : ('root@'.((SQ_PHP_CLI) ? php_uname('n') : $_SERVER['HTTP_HOST']));
304  $root_user->setAttrValue('email', $root_email);
305 
306  if (!$root_user->create($user_link)) {
307  trigger_localised_error('CORE0001', E_USER_ERROR, 'Root User');
308  }
309 
310  pre_echo('Root User Asset Id : '.$root_user->id);
311 
312  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('root_user', $root_user->id);
313  $GLOBALS['SQ_SYSTEM']->restoreRunLevel();
314  return $root_user;
315 
316  }//end createRootUser()
317 
318 
325  function &createCronManager()
326  {
327  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
328 
329  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_manager');
330  $cron_manager = new Cron_Manager();
331  $cron_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
332  if (!$cron_manager->create($cron_manager_link)) {
333  trigger_localised_error('CORE0001', E_USER_ERROR, 'Cron Manager');
334  }
335  pre_echo('Cron Manager Asset Id : '.$cron_manager->id);
336 
337  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_manager', $cron_manager->id);
338  return $cron_manager;
339 
340  }//end createCronManager()
341 
342 
350  {
351  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
352 
353  $GLOBALS['SQ_SYSTEM']->am->includeAsset('trigger_manager');
354  $trigger_manager = new Trigger_Manager();
355  $trigger_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
356  if (!$trigger_manager->create($trigger_manager_link)) {
357  trigger_localised_error('CORE0001', E_USER_ERROR, 'Trigger Manager');
358  }
359  pre_echo('Trigger Manager Asset Id : '.$trigger_manager->id);
360 
361  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('trigger_manager', $trigger_manager->id);
362  return $trigger_manager;
363 
364  }//end createTriggerManager()
365 
366 
373  function &createLogManager()
374  {
375  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
376 
377  $GLOBALS['SQ_SYSTEM']->am->includeAsset('log_manager');
378  $log_manager = new Log_Manager();
379  $log_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
380  if (!$log_manager->create($log_manager_link)) {
381  trigger_localised_error('CORE0001', E_USER_ERROR, 'Trigger Manager');
382  }
383  pre_echo('Log Manager Asset Id : '.$log_manager->id);
384 
385  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('log_manager', $log_manager->id);
386  return $log_manager;
387 
388  }//end createLogManager()
389 
390 
398  {
399  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
400 
401  $GLOBALS['SQ_SYSTEM']->am->includeAsset('layout_manager');
402  $layout_manager = new Layout_Manager();
403  $layout_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
404  if (!$layout_manager->create($layout_manager_link)) {
405  trigger_localised_error('CORE0001', E_USER_ERROR, 'Layout Manager');
406  }
407  pre_echo('Layout Manager Asset Id : '.$layout_manager->id);
408 
409  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('layout_manager', $layout_manager->id);
410  return $layout_manager;
411 
412  }//end createLayoutManager()
413 
414 
421  function &createRemapManager()
422  {
423  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
424 
425  $GLOBALS['SQ_SYSTEM']->am->includeAsset('remap_manager');
426  $remap_manager = new Remap_Manager();
427  $remap_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
428  if (!$remap_manager->create($remap_manager_link)) {
429  trigger_localised_error('CORE0001', E_USER_ERROR, 'Remap Manager');
430  }
431  pre_echo('Remap Manager Asset Id : '.$remap_manager->id);
432 
433  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('remap_manager',$remap_manager->id);
434  return $remap_manager;
435 
436  }//end createRemapManager()
437 
438 
445  function &createCacheManager()
446  {
447  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
448 
449  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cache_manager');
450  $cache_manager = new Cache_Manager();
451  $cache_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
452  if (!$cache_manager->create($cache_manager_link)) {
453  trigger_localised_error('CORE0001', E_USER_ERROR, 'Cache Manager');
454  }
455  pre_echo('Cache Manager Asset Id : '.$cache_manager->id);
456 
457  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cache_manager', $cache_manager->id);
458  return $cache_manager;
459 
460  }//end createCacheManager()
461 
462 
470  {
471  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
472 
473  $GLOBALS['SQ_SYSTEM']->am->includeAsset('designs_folder');
474  $designs_folder = new Designs_Folder();
475  $designs_folder_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
476  if (!$designs_folder->create($designs_folder_link)) {
477  trigger_localised_error('CORE0001', E_USER_ERROR, 'Designs Folder');
478  }
479  pre_echo('Design Folder Asset Id : '.$designs_folder->id);
480 
481  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('designs_folder', $designs_folder->id);
482  return $designs_folder;
483 
484  }//end createDesignsFolder()
485 
486 
494  {
495  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
496 
497  $GLOBALS['SQ_SYSTEM']->am->includeAsset('authentication_folder');
498  $authentication_folder = new Authentication_Folder();
499  $authentication_folder_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
500  if (!$authentication_folder->create($authentication_folder_link)) {
501  trigger_localised_error('CORE0001', E_USER_ERROR, 'Authentication Folder');
502  }
503  pre_echo('Authentication Folder Asset Id : '.$authentication_folder->id);
504 
505  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('authentication_folder', $authentication_folder->id);
506  return $authentication_folder;
507 
508  }//end createAuthenticationFolder()
509 
510 
517  function &createLoginDesign()
518  {
519  $designs_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('designs_folder');
520 
521  $GLOBALS['SQ_SYSTEM']->am->includeAsset('login_design');
522  $login_design = new Login_Design();
523  $login_design_link = Array('asset' => &$designs_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
524  $login_design->setAttrValue('id_name', 'login_design');
525  if (!$login_design->create($login_design_link)) {
526  trigger_localised_error('CORE0001', E_USER_ERROR, 'Login Design');
527  }
528  pre_echo('Login Design Asset Id : '.$login_design->id);
529 
530  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('login_design', $login_design->id);
531  return $login_design;
532 
533  }//end createLoginDesign()
534 
535 
543  {
544  $designs_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('designs_folder');
545 
546  $GLOBALS['SQ_SYSTEM']->am->includeAsset('ees_login_design');
547  $login_design = new EES_Login_Design();
548  $login_design_link = Array('asset' => &$designs_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
549  $login_design->setAttrValue('id_name', 'ees_login_design');
550  if (!$login_design->create($login_design_link)) {
551  trigger_localised_error('CORE0001', E_USER_ERROR, 'EES Login Design');
552  }
553  pre_echo('EES Login Design Asset Id : '.$login_design->id);
554 
555  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('ees_login_design', $login_design->id);
556  return $login_design;
557 
558  }//end createLoginDesign()
559 
567  {
568  $designs_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('designs_folder');
569 
570  $GLOBALS['SQ_SYSTEM']->am->includeAsset('password_change_design');
571  $password_change_design = new Password_Change_Design();
572  $password_change_design_link = Array('asset' => &$designs_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
573  $password_change_design->setAttrValue('id_name', 'password_change_design');
574  if (!$password_change_design->create($password_change_design_link)) {
575  trigger_localised_error('CORE0001', E_USER_ERROR, 'Password Change Design');
576  }
577  pre_echo('Password Change Design Asset Id : '.$password_change_design->id);
578 
579  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('password_change_design', $password_change_design->id);
580  return $password_change_design;
581 
582  }//end createPasswordChangeDesign()
583 
584 
592  {
593  $root_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_folder');
594 
595  $GLOBALS['SQ_SYSTEM']->am->includeAsset('web_folder_designs');
596  $folder_link = Array(
597  'asset' => &$root_folder,
598  'link_type' => SQ_LINK_TYPE_1,
599  'is_exclusive' => 1,
600  'is_locked' => 1,
601  );
602  $designs_folder = new Web_Folder_Designs();
603  $designs_folder->setAttrValue('name', 'Designs Folder');
604  if (!$designs_folder->create($folder_link)) {
605  trigger_localised_error('CORE0001', E_USER_ERROR, 'Designs Folder');
606  }
607  pre_echo('Designs Folder Id : '.$designs_folder->id);
608 
609  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('web_folder_designs', $designs_folder->id);
610  return $designs_folder;
611 
612  }//end createWebFolderDesigns()
613 
614 
622  {
623  $root_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_folder');
624 
625  $GLOBALS['SQ_SYSTEM']->am->includeAsset('web_folder_media');
626  $folder_link = Array(
627  'asset' => &$root_folder,
628  'link_type' => SQ_LINK_TYPE_1,
629  'is_exclusive' => 1,
630  'is_locked' => 1,
631  );
632  $media_folder = new Web_Folder_Media();
633  $media_folder->setAttrValue('name', 'Media Folder');
634  if (!$media_folder->create($folder_link)) {
635  trigger_localised_error('CORE0001', E_USER_ERROR, 'Media Folder');
636  }
637  pre_echo('Media Folder Id : '.$media_folder->id);
638 
639  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('web_folder_media', $media_folder->id);
640  return $media_folder;
641 
642  }//end createWebFolderMedia()
643 
644 
652  {
653  $root_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_folder');
654 
655  $GLOBALS['SQ_SYSTEM']->am->includeAsset('web_folder_users');
656  $folder_link = Array(
657  'asset' => &$root_folder,
658  'link_type' => SQ_LINK_TYPE_1,
659  'is_exclusive' => 1,
660  'is_locked' => 1,
661  );
662  $users_folder = new Web_Folder_Users();
663  $users_folder->setAttrValue('name', 'Users Folder');
664  if (!$users_folder->create($folder_link)) {
665  trigger_localised_error('CORE0001', E_USER_ERROR, 'Users Folder');
666  }
667  pre_echo('Users Folder Id : '.$users_folder->id);
668 
669  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('web_folder_users', $users_folder->id);
670  return $users_folder;
671 
672  }//end createWebFolderUsers()
673 
674 
682  {
683  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
684  if (is_null($cron_manager)) {
685  trigger_localised_error('CORE0022', E_USER_WARNING);
686  $null = NULL;
687  return $null;
688  }
689 
690  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_expired_workflow');
691 
692  $cron_job = new Cron_Job_Expired_WorkFlow();
693  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
694  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
695  trigger_localised_error('CORE0001', E_USER_ERROR, 'Expired Workflow Cron Job');
696  }
697  pre_echo('Expired Workflow Cron Job Id: '.$cron_job->id);
698 
699  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_expired_workflow', $cron_job->id);
700 
701  return $cron_job;
702 
703  }//end createCronJobExpiredWorkflow()
704 
705 
713  {
714  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
715  if (is_null($cron_manager)) {
716  trigger_error('Couldn\'t get cron manager, couldn\'t create generate log reports cron job', E_USER_WARNING);
717  $null = NULL;
718  return $null;
719  }
720 
721  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_generate_log_reports');
722 
723  $cron_job = new Cron_Job_Generate_Log_Reports();
724  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
725  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
726  trigger_error('Generate Log Reports Cron Job NOT CREATED', E_USER_ERROR);
727  }
728  pre_echo('Generate Log Reports Cron Job Id: '.$cron_job->id);
729 
730  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_generate_log_reports', $cron_job->id);
731 
732  return $cron_job;
733 
734  }//end createCronJobGenerateLogReports()
735 
736 
744  {
745  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
746  if (is_null($cron_manager)) {
747  trigger_error('Couldn\'t get cron manager, couldn\'t create Escalate Safe Trash Cron Job', E_USER_WARNING);
748  $null = NULL;
749  return $null;
750  }
751 
752  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_generate_log_reports');
753 
754  $cron_job = new Cron_Job_Escalate_Safe_Trash();
755  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
756  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
757  trigger_error('Escalate Safe Trash Cron Job NOT CREATED', E_USER_ERROR);
758  }
759  pre_echo('Escalate Safe Trash Cron Job Id: '.$cron_job->id);
760 
761  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_escalate_safe_trash', $cron_job->id);
762 
763  return $cron_job;
764 
765  }//end createCronJobEscalateSafeTrash()
766 
767 
774  function &createTagManager()
775  {
776  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
777 
778  $GLOBALS['SQ_SYSTEM']->am->includeAsset('tag_manager');
779  $tag_manager = new Tag_Manager();
780  $tag_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
781  if (!$tag_manager->create($tag_manager_link)) {
782  trigger_localised_error('CORE0001', E_USER_ERROR, 'Trigger Manager');
783  }
784  pre_echo('Tag Manager Asset Id : '.$tag_manager->id);
785 
786  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('tag_manager', $tag_manager->id);
787  return $tag_manager;
788 
789  }//end createTagManager()
790 
791 
799  {
800  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
801  if (is_null($cron_manager)) {
802  trigger_error('Couldn\'t get cron manager, couldn\'t create Metadata Trigger cron job', E_USER_WARNING);
803  $null = NULL;
804  return $null;
805  }
806 
807  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_metadata_triggers');
808 
809  $cron_job = new Cron_Job_Metadata_Triggers();
810  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
811  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
812  trigger_error('Metadata Triggers Cron Job NOT CREATED', E_USER_ERROR);
813  }
814  pre_echo('Metadata Triggers Cron Job Id: '.$cron_job->id);
815 
816  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_metadata_triggers', $cron_job->id);
817 
818  return $cron_job;
819 
820  }//end createCronJobMetadataTriggers()
821 
822 
830  {
831  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
832  if (is_null($cron_manager)) {
833  trigger_error('Couldn\'t get cron manager, couldn\'t create Expired Matrix Cache cron job', E_USER_WARNING);
834  $null = NULL;
835  return $null;
836  }
837 
838  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_expired_matrix_cache');
839 
840  $cron_job = new Cron_Job_Expired_Matrix_Cache();
841  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
842  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
843  trigger_error('Expired Matrix Cache Cron Job NOT CREATED', E_USER_ERROR);
844  }
845  pre_echo('Expired Matrix Cache Cron Job Id: '.$cron_job->id);
846 
847  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_expired_matrix_cache', $cron_job->id);
848 
849  return $cron_job;
850 
851  }//end createCronJobExpiredMatrixCache()
852 
853 
861  {
862  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
863  if (is_null($cron_manager)) {
864  trigger_error('Couldn\'t get cron manager, couldn\'t create Expired Matrix Locks cron job', E_USER_WARNING);
865  $null = NULL;
866  return $null;
867  }
868 
869  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_expired_matrix_locks');
870 
871  $cron_job = new Cron_Job_Expired_Matrix_Locks();
872  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
873  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
874  trigger_error('Expired Matrix Locks Cron Job NOT CREATED', E_USER_ERROR);
875  }
876  pre_echo('Expired Matrix Locks Cron Job Id: '.$cron_job->id);
877 
878  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_expired_matrix_locks', $cron_job->id);
879 
880  return $cron_job;
881 
882  }//end createCronJobExpiredMatrixLocks()
883 
884 }//end class
885 
886 ?>