Пример #1
0
 /**
  * Removes expired tmp directories. It calls by WPL cronjobs
  * @author Howard <*****@*****.**>
  * @static
  */
 public static function delete_expired_tmp()
 {
     $path = wpl_global::get_tmp_path();
     $folders = wpl_folder::folders($path);
     $now = time();
     $_3days = 259200;
     #3days in seconds
     foreach ($folders as $folder) {
         $full_path = $path . $folder;
         $latest_modification_time = filemtime($full_path);
         if ($now - $latest_modification_time > $_3days) {
             wpl_folder::delete($full_path);
         }
     }
 }
Пример #2
0
 /**
  * get All Activities in Activity folder and remove Backend Activity
  * @author Kevin J <*****@*****.**>
  * @return array list of Frontend activity list
  */
 public static function get_available_activities()
 {
     $activities_folders = wpl_folder::folders(wpl_activity::get_activity_folder());
     $frontend_activity = array();
     foreach ($activities_folders as $activity) {
         if (wpl_activity::check_activity($activity, wpl_activity::ACTIVITY_FRONTEND)) {
             $frontend_activity[] = $activity;
         }
     }
     return $frontend_activity;
 }