Changeset - 3c5b498b2a1b
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-02-09 23:29:02
ohnobinki@ohnopublishing.net
Avoid using an anonymous function to support <php-5.3 (i.e., normaldotcom's old servers).
1 file changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
inc/admin.inc
Show inline comments
 
@@ -138,16 +138,13 @@ function school_cache($schools)
 
	  /*
 
	   * Try to presort the semesters into the proper order based
 
	   * on time_start/time_end. We want the older semesters to be
 
	   * nearer to the end of the list. This way, the crawler
 
	   * doesn't have to decide how to sort the semesters itself:
 
	   */
 
	  usort($semesters, function ($sem_a, $sem_b)
 
		{
 
		  return $sem_a->time_start_get() - $sem_b->time_start_get();
 
		});
 
	  usort($semesters, 'school_cache_semesters_sort');
 

	
 
	  foreach ($school['crawled_semesters'] as $semester)
 
	    {
 
	      $semesters[$semester->id()] = array(
 
						  'id' => $semester->id(),
 
						  'time_start' => $semester->time_start_get(),
 
@@ -214,12 +211,21 @@ function school_cache($schools)
 

	
 
  return 0;
 
}
 

	
 
/**
 
 * \brief
 
 *   To support usort() call in school_cache() to sort semesters.
 
 */
 
function school_cache_semesters_sort (Semester $sem_a, Semester $sem_b)
 
{
 
  return $sem_a->time_start_get() - $sem_b->time_start_get();
 
}
 

	
 
/**
 
 * \brief
 
 *   Invoke a school's registration data crawler.
 
 *
 
 * Each school may export registration data on publically accessible
 
 * websites. Thus, we populate some autocomplete information by
 
 * crawling these pages and storing the information in a special set
 
 * of caches.
0 comments (0 inline, 0 general)