From 585fe2e2d3e7f7a7e9ec37c2cf19dc8cd6185fa3 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 26 Nov 2010 14:43:21 +0000
Subject: [PATCH] Module: Ensure stable order of hook-functions.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2657 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Module.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 3ae590d50..3ef75889e 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -162,7 +162,9 @@ class SimpleSAML_Module {
 	public static function callHooks($hook, &$data = NULL) {
 		assert('is_string($hook)');
 
-		foreach (self::getModules() as $module) {
+		$modules = self::getModules();
+		sort($modules);
+		foreach ($modules as $module) {
 			if (!self::isModuleEnabled($module)) {
 				continue;
 			}
-- 
GitLab