the following is True: – Drupal is slow – PHP doesn’t scale – PHP was never designed for this • Isomorphic code • Separation of concerns (CMS vs API) 4 mandag den 29. oktober 12
* Validate that the user sesion is valid and matches the uid provided. 3 */ 4 function validate_session(uid, sid, callback) { 5 // Validate the user's session. 6 drupal.user.session_load(sid, function (err, session) { 7 // Load the user object from Drupal. 8 drupal.user.load(uid, function (err, user) { 9 drupal.user.role_permissions(user.roles, function (perms) { 10 user.permissions = perms; 11 callback(null, user); 12 }); 13 }); 14 }); 15 } mandag den 29. oktober 12