diff --git a/includes/proxy.admin.inc b/includes/proxy.admin.inc
index 7982928..ad735f2 100644
--- a/includes/proxy.admin.inc
+++ b/includes/proxy.admin.inc
@@ -12,7 +12,7 @@
  *
  * @see system_settings_form()
  */
-function proxy_admin_settings() {
+function proxy_admin_settings($form, &$form_state) {
   module_load_include('processor.inc', 'proxy', 'includes/proxy');
   $form = array();
 
@@ -53,7 +53,7 @@ function proxy_admin_settings() {
   $form['proxy_whitelist']['proxy_whitelist_domains'] = array(
     '#type' => 'textarea',
     '#title' => t('Whitelist Domains'),
-    '#description' => t('The list of allowed domains for the proxy, when whitelisting is turned on.  Put each domain on a new line.  You can also use a %wildcard as a wildcard; for example, the following will allow all domains with the word Drupal in them: %example.', array('%wildcard' => '*',  '%example' => '*drupal*')),
+    '#description' => t('The list of allowed domains for the proxy, when whitelisting is turned on.  Put each domain on a new line.  You can also use a %wildcard as a wildcard; for example, the following will allow all domains with the word Drupal in them: %example.', array('%wildcard' => '*', '%example' => '*drupal*')),
     '#default_value' => variable_get('proxy_whitelist_domains', PROXY_WHITELIST_DOMAINS_DEFAULT),
   );
 
@@ -94,4 +94,4 @@ function proxy_admin_settings() {
 
   // Make a system setting form and return
   return system_settings_form($form);
-}
\ No newline at end of file
+}
diff --git a/includes/proxy.processor.inc b/includes/proxy.processor.inc
index 644c233..1928dd7 100644
--- a/includes/proxy.processor.inc
+++ b/includes/proxy.processor.inc
@@ -64,14 +64,14 @@ class proxy_processor {
   }
 
   /**
-  * Initiate any options
-  *
-  * Define any default options that can be stored
-  * in the options property of the class.
-  *
-  * @return
-  *   Array of options
-  */
+   * Initiate any options
+   *
+   * Define any default options that can be stored
+   * in the options property of the class.
+   *
+   * @return
+   *   Array of options
+   */
   function options_init() {
     return array();
   }
@@ -107,4 +107,4 @@ class proxy_processor {
   function render(&$content, $params) {
     // Process content here
   }
-}
\ No newline at end of file
+}
diff --git a/includes/proxy.proxy.inc b/includes/proxy.proxy.inc
index 4ecd45e..f27328f 100644
--- a/includes/proxy.proxy.inc
+++ b/includes/proxy.proxy.inc
@@ -91,7 +91,7 @@ function _proxy($params = array(), $reset = FALSE) {
     // Check Drupal cache.  Do not attempt to get cache if it is off
     if ($params['cache'] != PROXY_NO_CACHE) {
       $drupal_cache = cache_get($params['request_uri'], 'cache_proxy');
-      if ($drupal_cache && time() < $drupal_cache->expire && !empty($drupal_cache->data)) {
+      if ($drupal_cache && REQUEST_TIME < $drupal_cache->expire && !empty($drupal_cache->data)) {
         return $drupal_cache->data;
       }
     }
@@ -175,7 +175,7 @@ function _proxy($params = array(), $reset = FALSE) {
   }
   else {
     // Assume that we have a time amount in seconds
-    cache_set($params['request_uri'], $response, 'cache_proxy', time() + $params['cache']);
+    cache_set($params['request_uri'], $response, 'cache_proxy', REQUEST_TIME + $params['cache']);
   }
   // Set static cache
   $proxied[$params['request_uri']] = $response;
@@ -239,9 +239,17 @@ function _proxy_deny_host($host = '') {
 
   // Check if rul already exists
   $query = "SELECT aid FROM {access} WHERE mask = '%s' AND type = 'host' AND status = 0";
-  $aid = db_result(db_query($query, $host));
+  $aid = db_query("SELECT aid FROM {access} WHERE mask = :mask AND type = :type AND status = :status", array(':mask' => $host, ':type' => 'host', ':status' => 0))->fetchField();
   if (empty($aid)) {
     $query = "INSERT INTO {access} (mask, type, status) VALUES ('%s', 'host', 0)";
-    return db_query($query, $host);
+    // TODO Please review the conversion of this statement to the D7 database API syntax.
+    /* db_query($query, $host) */
+    return $id = db_insert('access')
+      ->fields(array(
+        'mask' => $host,
+        'type' => 'host',
+        'status' => 0,
+      ))
+      ->execute();
   }
 }
diff --git a/includes/proxy.router.inc b/includes/proxy.router.inc
index f6b62b1..bf41347 100644
--- a/includes/proxy.router.inc
+++ b/includes/proxy.router.inc
@@ -36,7 +36,7 @@ function proxy_router() {
       // Set headers
       if (is_array($response->headers)) {
         foreach ($response->headers as $header => $value) {
-          drupal_set_header($header . ': ' . $value);
+          drupal_add_http_header($header . ': ' . $value);
         }
       }
       else {
@@ -61,7 +61,7 @@ function proxy_router() {
   // Default is 404, which helps masks the fact that the proxy exists.
   // Also, reset a couple variables so that Drupal does not try to
   // redirect here
-  $_REQUEST['destination'] = '';
+  $_GET['destination'] = '';
   $_GET['q'] = '';
   drupal_not_found();
-}
\ No newline at end of file
+}
diff --git a/processors/proxy.processors.inc b/processors/proxy.processors.inc
index 8e63b27..6bb4002 100644
--- a/processors/proxy.processors.inc
+++ b/processors/proxy.processors.inc
@@ -8,7 +8,9 @@
  */
 
 /**
- * Implementation of hook_proxy_processors(). (Internal function)
+ * Implements hook_proxy_processors().
+ *
+ * (Internal function)
  */
 function _proxy_proxy_processors() {
   $processors = array();
@@ -27,4 +29,4 @@ function _proxy_proxy_processors() {
   );
 
   return $processors;
-}
\ No newline at end of file
+}
diff --git a/processors/proxy_processor_proxify_urls.inc b/processors/proxy_processor_proxify_urls.inc
index 126327f..9811918 100644
--- a/processors/proxy_processor_proxify_urls.inc
+++ b/processors/proxy_processor_proxify_urls.inc
@@ -12,14 +12,14 @@ class proxy_processor_proxify_urls {
   var $options;
 
   /**
-  * Initiate any options
-  *
-  * Define any default options that can be stored
-  * in the options property of the class.
-  *
-  * @return
-  *   Array of options
-  */
+   * Initiate any options
+   *
+   * Define any default options that can be stored
+   * in the options property of the class.
+   *
+   * @return
+   *   Array of options
+   */
   function options_init() {
     return array();
   }
@@ -80,16 +80,16 @@ class proxy_processor_proxify_urls {
 
     // Set up arrays for matching
     // Relative paths (needs work)
-    $matches[]='#(href|src|url)=["|\'](^([\/|http|https|ftp|ftps])[^"\']*)(["|\'])#';
+    $matches[] = '#(href|src|url)=["|\'](^([\/|http|https|ftp|ftps])[^"\']*)(["|\'])#';
     $replaces[] = '$1="' . $redirect_base . '/$2$3';
     // Absolute paths
-    $matches[]='#(href|src|url)=["|\'](\/[^"\']*)(["|\'])#';
+    $matches[] = '#(href|src|url)=["|\'](\/[^"\']*)(["|\'])#';
     $replaces[] = '$1="' . $redirect_base . '$2$3';
     // Full URLS
-    $matches[]='#(href|src|url)=["|\']([http|https|ftp|ftps][^"\']*)(["|\'])#';
+    $matches[] = '#(href|src|url)=["|\']([http|https|ftp|ftps][^"\']*)(["|\'])#';
     $replaces[] = '$1="' . $proxy_base . '$2$3';
 
     // Change content
     $response->data = preg_replace($matches, $replaces, $response->data);
   }
-}
\ No newline at end of file
+}
diff --git a/proxy.info b/proxy.info
index fceefc8..eea2de6 100644
--- a/proxy.info
+++ b/proxy.info
@@ -1,5 +1,9 @@
 name = Proxy
 description = A simple, yet powerful HTTP proxy API module.
-core = 6.x
+core = 7.x
 php = 5.2
 dependencies[] = ctools
+
+files[] = proxy.test
+files[] = includes/proxy.processor.inc
+files[] = processors/proxy_processor_proxify_urls.inc
diff --git a/proxy.install b/proxy.install
index 7d5ffb7..26e090b 100644
--- a/proxy.install
+++ b/proxy.install
@@ -9,21 +9,24 @@
  */
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function proxy_install() {
   // Install scheme, specifically cache table
-  drupal_install_schema('proxy');
+  // TODO The drupal_(un)install_schema functions are called automatically in D7.
+  // drupal_install_schema('proxy')
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function proxy_uninstall() {
   // Uninstall schema (delete db tables)
-  drupal_uninstall_schema('proxy');
+  // TODO The drupal_(un)install_schema functions are called automatically in D7.
+  // drupal_uninstall_schema('proxy')
 
   // Get module variables
+  // TODO Please convert this statement to the D7 database API syntax.
   $results = db_query("SELECT v.name FROM {variable} AS v WHERE v.name LIKE '%s%%'", 'proxy_');
   // Remove variables
   while ($row = db_fetch_array($results)) {
@@ -32,7 +35,7 @@ function proxy_uninstall() {
 }
 
 /**
- * Implementation of hook_schema().
+ * Implements hook_schema().
  */
 function proxy_schema() {
   $schema = array();
diff --git a/proxy.module b/proxy.module
index 5164db8..88d556e 100644
--- a/proxy.module
+++ b/proxy.module
@@ -69,33 +69,46 @@ define('PROXY_WHITELIST_CONTROL_DEFAULT', TRUE);
 define('PROXY_WHITELIST_DOMAINS_DEFAULT', '');
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  */
 function proxy_help($path, $arg) {
   $output = '';
 
   switch ($path) {
     case 'admin/help#proxy':
-      $output = '<p>'. t('The Proxy module provides an API to get content from other sites.') .'</p>';
+      $output = '<p>' . t('The Proxy module provides an API to get content from other sites.') . '</p>';
 
-    case 'admin/settings/proxy':
-      $output = '<p>'. t('The Proxy module provides a basic <a href="@url">HTTP proxy</a> for various requests.  Without any attempt at limiting use of this proxy, it can be easily abused and have severe consequences.  The defaults provided are meant to ensure that abuse can be contained.  Please have some understanding of the changes that will happen if you alter these settings.', array(
+    case 'admin/config/proxy':
+      $output = '<p>' . t('The Proxy module provides a basic <a href="@url">HTTP proxy</a> for various requests.  Without any attempt at limiting use of this proxy, it can be easily abused and have severe consequences.  The defaults provided are meant to ensure that abuse can be contained.  Please have some understanding of the changes that will happen if you alter these settings.', array(
         '@url' => 'http://en.wikipedia.org/wiki/Proxy_server#Web_proxy',
-      )) .'</p>';
+      )) . '</p>';
   }
 
   return $output;
 }
 
 /**
- * Implementation of hook_perm().
+ * Implements hook_permission().
  */
-function proxy_perm() {
-  return array('administer proxy', 'access proxy router', 'reset cache via router');
+function proxy_permission() {
+  return array(
+    'administer proxy' => array(
+      'title' => t('administer proxy'),
+      'description' => t('Administer proxy settings'),
+    ),
+    'access proxy router' => array(
+      'title' => t('access proxy router'),
+      'description' => t('Access proxy router'),
+    ),
+    'reset cache via router' => array(
+      'title' => t('reset cache via router'),
+      'description' => t('Reset cache via router'),
+    ),
+  );
 }
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function proxy_menu() {
   $items = array();
@@ -107,16 +120,16 @@ function proxy_menu() {
     'page arguments' => array(1),
     'access arguments' => array('access proxy router'),
     'file' => 'includes/proxy.router.inc',
-    'type' => MENU_CALLBACK
+    'type' => MENU_CALLBACK,
   );
-  $items['admin/settings/proxy'] = array(
+  $items['admin/config/proxy'] = array(
     'title' => 'Proxy',
     'description' => 'Main settings for Proxy.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('proxy_admin_settings'),
     'access arguments' => array('administer proxy'),
     'file' => 'includes/proxy.admin.inc',
-    'type' => MENU_NORMAL_ITEM
+    'type' => MENU_NORMAL_ITEM,
   );
 
   return $items;
@@ -175,7 +188,7 @@ function proxy($params = array(), $reset = FALSE) {
 }
 
 /**
- * Implementation of hook_flush_caches().
+ * Implements hook_flush_caches().
  */
 function proxy_flush_caches() {
   return array('cache_proxy');
@@ -229,9 +242,9 @@ function _proxy_debug($message = '', $var = array()) {
 }
 
 /**
- * Implementation of hook_proxy_processors().
+ * Implements hook_proxy_processors().
  */
 function proxy_proxy_processors() {
   module_load_include('processors.inc', 'proxy', 'processors/proxy');
   return _proxy_proxy_processors();
-}
\ No newline at end of file
+}
diff --git a/proxy.test b/proxy.test
index b501334..1690bcc 100644
--- a/proxy.test
+++ b/proxy.test
@@ -71,7 +71,7 @@ class ProxyTest extends DrupalWebTestCase {
     $url = 'http://drupal.org/';
     $params['request_uri'] = $url;
     // Set cache to 5 minutes
-    $params['cache'] = time() + (60 * 5);
+    $params['cache'] = REQUEST_TIME + (60 * 5);
 
     // Go to path
     $content_orig = proxy($params);
