Index: devel-HEAD/devel.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel.module,v
retrieving revision 1.355
diff -u -p -r1.355 devel.module
--- devel-HEAD/devel.module	20 Sep 2009 02:35:25 -0000	1.355
+++ devel-HEAD/devel.module	22 Sep 2009 06:01:56 -0000
@@ -1805,3 +1805,19 @@ function devel_rebuild_node_comment_stat
   db_query_temporary("SELECT n.nid, n.changed, n.uid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE c.comment_count IS NULL", 'missing_nids');
   db_query("INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.changed, NULL, n.uid, 0 FROM missing_nids n");
 }
+
+/**
+ * Not sure if drupal_function_exists is gonna make it into 7 or not, so this is just provisional until then.
+ * 
+ * Pass a string funciton name, and return true if it is available, or false if not.
+ * 
+ * @todo: monitor this, it will probably need to be removed at some point.
+ * 
+ * @return boolean Whether the function is available for calling or not.
+ **/
+if ( ! function_exists('drupal_function_exists') ) {
+	function drupal_function_exists($function_name) {
+		return function_exists($function_name);
+	}
+}
+
Index: devel-HEAD/devel_themer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel_themer.module,v
retrieving revision 1.55
diff -u -p -r1.55 devel_themer.module
--- devel-HEAD/devel_themer.module	14 Aug 2009 11:23:47 -0000	1.55
+++ devel-HEAD/devel_themer.module	22 Sep 2009 06:01:56 -0000
@@ -48,7 +48,7 @@ function devel_themer_menu() {
  * A chunk of HTML with the devel_print_object() rendering of the variables.
  */
 function devel_themer_ajax_variables($request_id, $call) {
-  $file = file_directory_temp(). "/devel_themer_$request_id";
+  $file = drupal_realpath("temporary://devel_themer_$request_id");
   if ($data = unserialize(file_get_contents($file))) {
     $variables = $data[$call]['variables'];
     if (has_krumo()) {
@@ -121,7 +121,7 @@ function devel_themer_init() {
     devel_themer_popup();
 
     if (!devel_silent() && variable_get('devel_themer_log', FALSE)) {
-      register_shutdown_function('devel_themer_shutdown');
+     register_shutdown_function('devel_themer_shutdown');
     }
   }
 }
@@ -137,6 +137,7 @@ function devel_themer_shutdown() {
  *
  * @return void
  **/
+
 function devel_themer_theme_registry_alter($theme_registry) {
   foreach ($theme_registry as $hook => $data) {
     if (isset($theme_registry[$hook]['function'])) {
@@ -200,7 +201,7 @@ function devel_themer_get_extension() {
 
   if (!$extension) {
     $extension_function = $theme_engine .'_extension';
-    if (function_exists($extension_function)) {
+    if (drupal_function_exists($extension_function)) {
       $extension = $extension_function();
     }
     else {
@@ -425,11 +426,11 @@ function devel_themer_theme_twin() {
       // If theme or theme engine is implementing this, it may have
       // a different extension and a different renderer.
       if ($info['type'] != 'module') {
-        if (function_exists($theme_engine .'_render_template')) {
+        if (drupal_function_exists($theme_engine .'_render_template')) {
           $render_function = $theme_engine .'_render_template';
         }
         $extension_function = $theme_engine .'_extension';
-        if (function_exists($extension_function)) {
+        if (drupal_function_exists($extension_function)) {
           $extension = $extension_function();
         }
       }
@@ -487,11 +488,11 @@ function devel_themer_exit() {
     // Write the variables information to the a file. It will be retrieved on demand via AJAX.
     // We used to write this to DB but was getting 'Warning: Got a packet bigger than 'max_allowed_packet' bytes'
     // Writing to temp dir means we don't worry about folder existence/perms and cleanup is free.
-    file_put_contents(file_directory_temp(). "/devel_themer_$request_id", serialize($GLOBALS['devel_themer_server']));
+    file_unmanaged_save_data(serialize($GLOBALS['devel_themer_server']), "temporary://devel_themer_$request_id");
 
     $GLOBALS['devel_theme_calls']['request_id'] = $request_id;
     $GLOBALS['devel_theme_calls']['devel_themer_uri'] = url("devel_themer/variables/$request_id");
-    print '<script type="text/javascript">jQuery.extend(Drupal.settings, '.  drupal_to_js($GLOBALS['devel_theme_calls']) .");</script>\n";
+    print '<script type="text/javascript">jQuery.extend(Drupal.settings, '.  drupal_json_encode($GLOBALS['devel_theme_calls']) .");</script>\n";
   }
 }
 
@@ -602,8 +603,8 @@ EOT;
  *   void.
  */
 function devel_themer_cleanup() {
-  foreach (array_keys(file_scan_directory(file_directory_temp(), 'devel_themer_*', array('.', '..', 'CVS'), 0, FALSE)) as $file) {
-    file_delete($file);
+  foreach (array_keys(file_scan_directory(drupal_realpath('temporary://devel_themer_*'), array('.', '..', 'CVS'), 0, FALSE)) as $file) {
+    unlink($file);
   }
 }
 
