coder_review_7x_reviews()Implements hook_reviews().
sites/all/modules/coder/coder_review/includes/coder_review_7x.inc, line 11
<?php
function coder_review_7x_reviews() {
$argex = '(((&?\$?)[a-zA-Z_]+((\([^)]*\))|\[[^\]]*\])?)|[0-9]+(\.[0-9]*)?|\'\'|"")';
$taxonomy_tables = '\{(term_data|term_hierarchy|term_node|term_relation|term_synonym|vocabulary|vocabulary_node_types)\}';
$rules = array(
// Module Info / Install
// N/A - in comment review - http://drupal.org/node/224333#afile --- Add Doxygen @file tag to all install files
// N/A - http://drupal.org/node/224333#module_file_during_install --- .module file available during install
// N/A - http://drupal.org/node/224333#module_version_dependencies --- Module .info files can now optionally specify the version number of the module it depends on
// NO TESTS - http://drupal.org/node/224333#registry
array(
'#type' => 'callback',
'#value' => '_coder_review_7x_info_file_review_callback',
// @NOTE: this warning_callback isn't used. It only exists to catch
// potential errors in the code.
'#warning_callback' => '_coder_review_7x_info_file_review_callback_warning',
),
// http://drupal.org/node/224333#api_php --- Code documentation to module.api.php
// http://drupal.org/node/224333#update_php --- Update functions in .install files must include a Doxygen style comment
// System
// N/A - http://drupal.org/node/224333#variable_get_default_null --- Default parameter when getting variables
// N/A - http://drupal.org/node/224333#hook_modules_action --- New hooks: hook_modules_installed, hook_modules_enabled, hook_modules_disabled, and hook_modules_uninstalled</a>
// N/A - http://drupal.org/node/224333#static_variable_api --- Standardized API for static variables and resetting them
// http://drupal.org/node/224333#module_implements_not_module_list --- use module_implements not module_list when calling hook implementations
array(
'#type' => 'callback',
'#value' => '_coder_review_7x_module_implements_review_callback',
// @NOTE: this warning_callback isn't used. It only exists to catch
// potential errors in the code.
'#warning_callback' => '_coder_review_7x_module_implements_callback_warning',
),
// http://drupal.org/node/224333#absolute_includes
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '((require|include)(_once)?).+[\'"]\.\/',
'#warning_callback' => '_coder_review_7x_absolute_includes_warning',
),
// TODO - http://drupal.org/node/224333#drupal_set_session
array(
'#type' => 'grep',
'#value' => '$_SESSION',
'#warning_callback' => '_coder_review_7x_session_warning',
),
// http://drupal.org/node/224333#time
array(
'#type' => 'regex',
'#value' => '[\s\(]time\s*\([\w\d\'"]*\)',
'#warning_callback' => '_coder_review_7x_time_warning',
),
// http://drupal.org/node/224333#rebuild_functions
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_rebuild_code_registry\s*\(',
'#warning_callback' => '_coder_review_7x_code_registry_rebuild_function_warning',
),
// http://drupal.org/node/224333#drupal_uninstall_modules
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_uninstall_module\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_uninstall_modules_warning',
),
// http://drupal.org/node/224333#drupal_http_request_parameters
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_http_request\s*\(\s*(' . $argex . '\s*,\s*){2,}(' . $argex . ')\s*\)',
'#warning_callback' => '_coder_review_7x_drupal_http_request_parameters_warning',
),
// http://drupal.org/node/224333#moved_statistics_settings
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => 'admin\/reports\/settings',
'#warning_callback' => '_coder_review_7x_moved_statistics_settings_warning',
),
// http://drupal.org/node/224333#system_get_module_data
array(
'#type' => 'regex',
'#value' => '[\s\(]module_rebuild_cache\s*\(',
'#warning_callback' => '_coder_review_7x_module_rebuild_cache_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]system_theme_data\s*\(',
'#warning_callback' => '_coder_review_7x_system_theme_data_warning',
),
// http://drupal.org/node/224333#drupal_set_html_head
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_set_html_head\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_set_html_head_warning',
),
// http://drupal.org/node/224333#php_eval
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_eval\s*\(',
'#warning_callback' => '_coder_review_7x_php_eval_warning',
),
// http://drupal.org/node/224333#http_header_functions
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]drupal_set_header\s*\(\s*(\$_SERVER\[[\'"]SERVER_PROTOCOL[\'"]|[\'"][a-zA-Z_-\s]+:.*?[\'"])',
'#warning_callback' => '_coder_review_7x_http_header_functions_warning',
),
// http://drupal.org/node/224333#drupal_set_content
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_set_content\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_set_content_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_get_content\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_get_content_warning',
),
// NO TESTS - http://drupal.org/node/224333#cache_implementation
array(
'#type' => 'callback',
'#value' => '_coder_review_7x_cache_implementation_review_callback',
// @NOTE: this warning_callback isn't used. It only exists to catch
// potential errors in the code.
'#warning_callback' => '_coder_review_7x_cache_implementation_review_callback_warning',
),
// http://drupal.org/node/224333#time_limit
array(
'#type' => 'regex',
'#value' => '[\s\(]set_time_limit\s*\(',
'#function-not' => '^drupal_set_time_limit$',
'#warning_callback' => '_coder_review_7x_time_limit_warning',
),
// Permissions and Access
// N/A - http://drupal.org/node/224333#moved_statistics_settings --- Added a new 'administer statistics' permission
// UNCLEAR - http://drupal.org/node/224333#hook_node_access_records --- hook_node_access_records() now applies to unpublished nodes; 'view own unpublished content' permission added
// UNCLEAR - http://drupal.org/node/224333#bypass_node_access --- "administer nodes" permission split into "administer nodes" and "bypass node access"
// http://drupal.org/node/224333#descriptions_permissions
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_permission$',
'#value' => '\s+array\s*\(\s*([\'"][a-zA-Z\s]+[\'"]\s*[,\)]\s*){1,}\s*;',
'#warning_callback' => '_coder_review_7x_descriptions_permissions_warning',
),
// http://drupal.org/node/224333#sorting_permissions --- Permissions are no longer sorted alphabetically
// http://drupal.org/node/224333#permission_tables
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => '^(select\s+.*\s+from\s+{permission}|insert\s+into\s+{permission}|update\s+{permission}\s+set|delete\s+from\s+{permission})',
'#warning_callback' => '_coder_review_7x_permission_tables_warning',
),
// http://drupal.org/node/224333#node_access_alter_hooks --- Node access hooks now have drupal_alter() functions
// http://drupal.org/node/224333#hook_permission
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(perm)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_perm_warning',
),
// http://drupal.org/node/224333#php_permissions --- "use PHP for settings" permission should be used for all PHP settings rights (replaces "use PHP for block visibility")
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => '^use PHP for block visibility$',
'#warning_callback' => '_coder_review_7x_php_permissions_warning',
),
// http://drupal.org/node/224333#node_access
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(access)\s*\(',
'#function-not' => '^\w+_node_access$',
'#warning_callback' => '_coder_review_7x_hook_access_warning',
),
// http://drupal.org/node/224333#system_admin_menu_block_access --- Hide empty menu categories with access callback
// Database
// http://drupal.org/node/224333#dbtng --- A completely new database API has been added
// http://drupal.org/node/224333#schema_translation
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_(schema|update_\d+)$',
'#value' => '[\'"]description[\'"]\s*=>\s*(t|st)\(',
'#warning_callback' => '_coder_review_7x_schema_translation_warning',
),
// http://drupal.org/node/224333#db_rewrite_sql
array(
'#type' => 'regex',
'#value' => '[\s\(]db_rewrite_sql\s*\(',
'#warning_callback' => '_coder_review_7x_db_rewrite_sql_warning',
),
// http://drupal.org/node/224333#schema_html --- Schema descriptions are now plain text instead of HTML
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_(schema|update_\d+)$',
'#value' => '[\'"]description[\'"]\s*=>\s*.*?<.*?>',
'#warning_callback' => '_coder_review_7x_schema_html_warning',
),
// http://drupal.org/node/224333#select_count --- Do not use SELECT COUNT(*) to check for existence of rows
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => 'db_query\s*\(\s*[\'"]select\s+count\s*\(\s*\*\s*\)\s+from\s+',
'#warning_callback' => '_coder_review_7x_select_count_warning',
'#severity' => 'minor'
),
// http://drupal.org/node/224333#foreign-keys-added --- Foreign keys added to core database table schema
// Menu
// N/A - http://drupal.org/node/224333#international_item --- Added a new top level admin item, 'international'.
// http://drupal.org/node/224333#menu_callback_array --- Menu callbacks should return an array; hello hook_page_alter()
// http://drupal.org/node/224333#hook_menu_link_alter
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(menu_link_alter)\s*\(\s*(' . $argex . '\s*,\s*){1,}(' . $argex . ')\s*\)',
'#warning_callback' => '_coder_review_7x_hook_menu_link_alter_warning',
),
// http://drupal.org/node/224333#system_admin_menu_block_access --- Hide empty menu categories with access callback
// Block
// http://drupal.org/node/224333#block_optional --- Block module now optional
// http://drupal.org/node/224333#remove_op
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(block)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_block_op_warning',
),
// http://drupal.org/node/224333#hook_block_list_alter --- Added hook_block_list_alter()
// Comment
// N/A - http://drupal.org/node/224333#comment_load_multiple --- New comment_load_multiple()
// N/A - http://drupal.org/node/224333#comment_save_refactor --- comment_save() now supports programatic saving
// http://drupal.org/node/224333#comment_load
array(
'#type' => 'regex',
'#value' => '[\s\(]_comment_load\s*\(',
'#warning_callback' => '_coder_review_7x_comment_load_warning',
),
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_menu$|_menu_alter$',
'#value' => '%_comment',
'#warning_callback' => '_coder_review_7x_comment_wildcard_warning',
),
// http://drupal.org/node/224333#comment_status
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => '\{comments\}\s+WHERE\s+.*?\s*status\s*(!=|=|<>|>|<)\s*(0|1)',
'#warning_callback' => '_coder_review_7x_comment_status_warning',
),
// http://drupal.org/node/224333#comment_validate_removed
array(
'#type' => 'regex',
'#value' => '[\s\(]comment_validate\s*\(',
'#warning_callback' => '_coder_review_7x_comment_validate_warning',
),
// http://drupal.org/node/224333#comment_node_url
array(
'#type' => 'regex',
'#value' => '[\s\(]comment_node_url\s*\(',
'#warning_callback' => '_coder_review_7x_comment_node_url_warning',
),
// Input Sanitization & Input Formats
// http://drupal.org/node/224333#check_markup_params
array(
'#type' => 'regex',
'#value' => '[\s\(]check_markup\s*\(\s*(' . $argex . '\s*,\s*){2}(\$check|FALSE|TRUE)',
'#warning_callback' => '_coder_review_7x_check_markup_warning',
),
// http://drupal.org/node/224333#drupal_set_title
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]drupal_set_title\s*\(\s*(check_plain\s*\(|t\s*\(\s*[\'"][^@%]*(@\w|\%\w))',
'#never' => 'PASS_THROUGH',
'#warning_callback' => '_coder_review_7x_drupal_set_title_warning',
),
// http://drupal.org/node/224333#hook_filter_info
array(
'#type' => 'regex',
'#value' => 'function\s+\w+_(filter)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_filter_warning',
),
array(
'#type' => 'regex',
'#value' => 'function\s+\w+_(filter_tips)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_filter_tips_warning',
),
// http://drupal.org/node/224333#text_format
array(
'#type' => 'regex',
'#value' => '\$form\[.+?=\s*filter_form\(',
'#warning_callback' => '_coder_review_7x_text_format_warning',
),
// http://drupal.org/node/224333#filter_urls
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => 'admin\/settings\/filters(\/.*?)?',
'#warning_callback' => '_coder_review_7x_filter_urls_warning',
),
// Taxonomy
// N/A - http://drupal.org/node/224333#taxonomy_term_load_multiple --- taxonomy_term_load() and taxonomy_term_load_multiple()
// N/A - http://drupal.org/node/224333#taxonomy_hooks --- New hooks: hook_taxonomy_term_load(), hook_taxonomy_term_insert(), hook_taxonomy_term_update(), hook_taxonomy_term_delete() and hook_taxonomy_vocabulary_load(), hook_taxonomy_vocabulary_insert(), hook_taxonomy_vocabulary_update(), hook_taxonomy_vocabulary_delete()
// N/A - http://drupal.org/node/224333#vocabulary_load_multiple --- Added taxonomy_vocabulary_load_multiple()
// http://drupal.org/node/224333#taxonomy_get_tree
array(
'#type' => 'regex',
'#source' => 'php',
'#value' => '[\s\(]taxonomy_get_tree\s*\(\s*(' . $argex . '\s*,\s*){2}(\$depth|-1)\s*[,\)]',
'#warning_callback' => '_coder_review_7x_taxonomy_get_tree_warning',
),
// http://drupal.org/node/224333#taxonomy_tables
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => '^(select\s+.*\s+from\s+' . $taxonomy_tables . '|insert\s+into\s+' . $taxonomy_tables . '|update\s+' . $taxonomy_tables . '\s+set|delete\s+from\s+' . $taxonomy_tables . ')',
'#warning_callback' => '_coder_review_7x_taxonomy_tables_warning',
),
// http://drupal.org/node/224333#taxonomy_crud
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_get_term\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_get_term_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_save_term\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_save_term_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_term_save\s*\(\s*array\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_save_term_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_del_term\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_del_term_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_save_vocabulary\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_save_vocabulary_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_vocabulary_save\s*\(\s*array\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_save_vocabulary_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_del_vocabulary\s*\(',
'#warning_callback' => '_coder_review_7x_taxonomy_del_vocabulary_warning',
),
// http://drupal.org/node/224333#taxonomy_paths
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => 'taxonomy\/term\/\d+(\+\d+|\,\d+|\/\d+)',
'#warning_callback' => '_coder_review_7x_taxonomy_paths_warning',
),
// http://drupal.org/node/224333#related_terms
array(
'#type' => 'regex',
'#value' => '[\s\(]taxonomy_get_related\s*\(',
'#warning_callback' => '_coder_review_7x_related_terms_warning',
),
// Javascript
// N/A - http://drupal.org/node/224333#jquery_ui --- jQuery UI (1.7) was added into core
// N/A - http://drupal.org/node/224333#attached_js --- Attached JavaScript and CSS for forms
// N/A - http://drupal.org/node/224333#drupal_add_library --- Ability to add multiple JavaScript/CSS files at once
// N/A - http://drupal.org/node/224333#drupal_add_js_css_reset --- Ability to reset JavaScript/CSS
// N/A - http://drupal.org/node/224333#local_settings_behaviors --- Settings passed locally to JavaScript Behaviors
// NO TESTS - http://drupal.org/node/224333#drupal_behaviors
array(
'#type' => 'regex',
'#value' => 'Drupal\.behaviors\..+?\s*=\s*function\s*\(',
'#filename' => array('js'),
'#warning_callback' => '_coder_review_7x_drupal_behaviors_warning',
),
array(
'#type' => 'callback',
'#value' => '_coder_review_7x_drupal_behaviors_review_callback',
'#filename' => array('js'),
// @NOTE: this warning_callback isn't used. It only exists to catch
// potential errors in the code.
'#warning_callback' => '_coder_review_7x_drupal_behaviors_warning',
),
// http://drupal.org/node/224333#drupal_add_js_weight
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]drupal_add_js\s*\(\s*' . $argex . '\s*,\s*[\'"](module|theme|core)[\'"]\s*[,\)]',
'#warning_callback' => '_coder_review_7x_drupal_add_js_weight_warning',
),
// http://drupal.org/node/224333#drupal_add_js_options
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_add_js\s*\(\s*(' . $argex . '\s*,\s*){2,}(' . $argex . ')\s*\)',
'#warning_callback' => '_coder_review_7x_drupal_add_js_parameters_warning',
),
// http://drupal.org/node/224333#hook_js_alter
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\'"]scripts[\'"]',
'#function' => '_preprocess_page$',
'#warning_callback' => '_coder_review_7x_hook_js_alter_warning',
),
// NO TESTS - http://drupal.org/node/224333#javascript_compatibility
array(
'#type' => 'grep_invert',
'#value' => '(function ($) {',
'#filename' => array('js'),
'#warning_callback' => '_coder_review_7x_javascript_compatibility_warning',
),
// http://drupal.org/node/224333#drupal_add_js_external
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]drupal_add_html_head\s*\(\s*[\'"].*?<script\s.*?src\s*=\s*[\'"][a-zA-Z:\/\._\-0-9]+?\.js',
'#warning_callback' => '_coder_review_7x_drupal_add_js_external_warning',
),
// NO TESTS - http://drupal.org/node/224333#jquery_13
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '\[.*?@[a-zA-Z]+\s*(\^=|=|!=|\$=|\*=)\s*.+?\]',
'#filename' => array('js'),
'#warning_callback' => '_coder_review_7x_jquery_13_warning',
),
array(
'#type' => 'regex',
'#value' => '(\$|jQuery)\.(boxModel|browser.version|browser)',
'#filename' => array('js'),
'#warning_callback' => '_coder_review_7x_jquery_13_warning',
),
// NO TESTS - http://drupal.org/node/224333#no-jsenabled
array(
'#type' => 'regex',
'#value' => 'Drupal.jsEnabled',
'#filename' => array('js'),
'#warning_callback' => '_coder_review_7x_no_jsenabled_warning',
),
// CSS
// N/A - http://drupal.org/node/224333#attached_js --- Attached JavaScript and CSS for forms
// N/A - http://drupal.org/node/224333#drupal_add_css_inline --- Inline cascading style sheets from drupal_add_css()
// N/A - http://drupal.org/node/224333#drupal_add_library --- Ability to add multiple JavaScript/CSS files at once
// N/A - http://drupal.org/node/224333#drupal_add_js_css_reset --- Ability to reset JavaScript/CSS
// http://drupal.org/node/224333#drupal_add_js_options
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_add_css\s*\(\s*(' . $argex . '\s*,\s*){2,}(' . $argex . ')\s*\)',
'#warning_callback' => '_coder_review_7x_drupal_add_css_parameters_warning',
),
// Theming
// http://drupal.org/node/224333#rebuild_functions
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_rebuild_theme_registry\s*\(',
'#warning_callback' => '_coder_review_7x_theme_rebuild_function_warning',
),
// http://drupal.org/node/224333#theme_page
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]theme\s*\(\s*[\'"]page[\'"]',
'#warning_callback' => '_coder_review_7x_theme_page_warning',
),
// http://drupal.org/node/224333#hook_footer
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]theme\s*\(\s*[\'"]closure[\'"]',
'#warning_callback' => '_coder_review_7x_hook_footer_warning',
),
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(closure|footer)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_footer_warning',
),
// @NOTE: no simpletest for this because of #filename setting.
array(
'#type' => 'regex',
'#value' => '\$closure[^a-zA-Z_]',
'#filename' => array('tpl.php'),
'#warning_callback' => '_coder_review_7x_closure_warning',
),
// http://drupal.org/node/224333#element_theme_properties --- Element theming properties used by drupal_render() have changed
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_elements$',
'#value' => '[\'"]#type[\'"]',
'#warning_callback' => '_coder_review_7x_element_theme_properties_warning',
),
// http://drupal.org/node/224333#drupal_render_children --- Element theme functions should call drupal_render_children()
// Form API
// http://drupal.org/node/224333#poundtheme --- #theme recommended for specifying theme function
// http://drupal.org/node/224333#node_form
array(
'#type' => 'regex',
'#function' => '_form_alter$',
'#source' => 'allphp',
'#value' => '\$form\[[\'"]type[\'"]\]\[[\'"]\#value[\'"]\]\s*\.\s*[\'"]_node_form[\'"]',
'#warning_callback' => '_coder_review_7x_node_form_warning',
),
// No link - parameter change to hook_form_alter().
array(
'#type' => 'regex',
'#function' => '_form_alter$',
'#value' => 'function\s+[a-z0-9_]+_(form_alter)\s*\(\s*&\$form,\s*\$form_state,\s*\$form_id\s*\)',
'#warning_callback' => '_coder_review_7x_hook_form_alter_warning',
),
// http://drupal.org/node/224333#process_functions
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\'"]#process[\'"](\])?\s*=(>)?\s*[\'"](expand_password_confirm|expand_date|expand_radios|form_expand_ahah|expand_checkboxes|process_weight)[\'"]',
'#warning_callback' => '_coder_review_7x_process_functions_warning',
),
// http://drupal.org/node/224333#markup --- Use '#markup' not '#value' for markup.
// http://drupal.org/node/224333#drupal_execute_drupal_form_submit
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_execute\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_execute_renamed_warning',
),
// http://drupal.org/node/224333#unrendered --- drupal_get_form() returns an array
// http://drupal.org/node/224333#ahah_now_ajax
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\'"]#ahah[\'"]',
'#warning_callback' => '_coder_review_7x_ahah_now_ajax_warning',
),
// File API
// N/A - http://drupal.org/node/224333#file_load_multiple --- file_load_multiple()
// N/A - http://drupal.org/node/224333#file_check_directory_recursive --- file_check_directory() will now recursively create directories
// UNCLEAR - http://drupal.org/node/224333#file_validate_extensions --- file_validate_extensions() enforces check for uid=1
// UNCLEAR - http://drupal.org/node/224333#file_scan_directory_property_names --- file_scan_directory() now uses same property names as file_load()
// UNCLEAR - http://drupal.org/node/224333#unmanaged_files --- File operations that don't affect the database have been renamed
// UNCLEAR - http://drupal.org/node/224333#user_picture --- User pictures are now managed files
// http://drupal.org/node/224333#file_scan_directory_array-itize
array(
'#type' => 'regex',
'#value' => '[\s\(]file_scan_directory\s*\(\s*((' . $argex . '\s*,\s*){4,}(' . $argex . ')\s*\)|(' . $argex . '\s*,\s*){2,}\$nomask)',
'#warning_callback' => '_coder_review_7x_file_scan_directory_array_itize_warning',
),
// http://drupal.org/node/224333#file_scan_directory_nomask
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]file_scan_directory\s*\(\s*(\s*.*?,\s*){2,}array\(([\'"].*?[\'"](,)*){1,}\)\s*[,\)]',
'#warning_callback' => '_coder_review_7x_file_scan_directory_nomask_warning',
),
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]file_scan_directory\s*\(\s*(\s*.*?,\s*){2,}array\(.+?[\'"]nomask[\'"]\s*=>\s*array\(([\'"].*?[\'"](,)*){1,}\)\s*[,\)]',
'#warning_callback' => '_coder_review_7x_file_scan_directory_nomask_warning',
),
// http://drupal.org/node/224333#file_set_status
array(
'#type' => 'regex',
'#value' => '[\s\(]file_set_status\s*\(',
'#warning_callback' => '_coder_review_7x_file_set_status_warning',
),
// http://drupal.org/node/224333#remove_FILE_STATUS_TEMPORARY
array(
'#type' => 'grep',
'#value' => 'FILE_STATUS_TEMPORARY',
'#case-sensitive' => TRUE,
'#warning_callback' => '_coder_review_7x_file_status_temporary_warning',
),
// http://drupal.org/node/224333#preg_match
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]file_scan_directory\s*\(\s*([^,]+?\s*,\s*){1}[\'"].*?[\'"]\s*[,\)]',
'#never' => '[\s\(]file_scan_directory\s*\(\s*[^,]+?,\s*[\'"]\/.*?\/[\'"]\s*[,\)]',
'#warning_callback' => '_coder_review_7x_file_scan_directory_preg_match_warning',
),
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\s\(]drupal_system_listing\s*\(\s*[\'"][^\/].*?[^\/][\'"]\s*,',
'#never' => '[\s\(]drupal_system_listing\s*\(\s*[\'"]\/.*?\/[\'"]\s*,',
'#warning_callback' => '_coder_review_7x_drupal_system_listing_preg_match_warning',
),
// User API
// N/A - http://drupal.org/node/224333#specified_ids --- Save new users and nodes with specified IDS
// http://drupal.org/node/224333#user_cancel
array(
'#type' => 'regex',
'#value' => '[\s\(]user_delete\s*\(',
'#warning_callback' => '_coder_review_7x_user_delete_warning',
),
// http://drupal.org/node/224333#remove_op
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(user)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_user_op_warning',
),
// http://drupal.org/node/224333#logout_path
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => '[\'"]logout[\'"]',
'#warning_callback' => '_coder_review_7x_user_logout_warning',
),
// http://drupal.org/node/224333#user_load_multiple
array(
'#type' => 'regex',
'#value' => '[\s\(]user_load\s*\(\s*(array\s*\(|\(\s*array\s*\))',
'#warning_callback' => '_coder_review_7x_user_load_warning',
),
// http://drupal.org/node/224333#user_authenticate
array(
'#type' => 'regex',
'#value' => '[\s\(]user_authenticate\s*\(\s*' . $argex . '\s*\)',
'#warning_callback' => '_coder_review_7x_user_authenticate_warning',
),
// http://drupal.org/node/224333#hook-user-changes --- Removed several unecessary arguments to various hook_user_$op hooks and removed hook_profile_alter
// Node API
// N/A - http://drupal.org/node/224333#delete_multiple --- Add node_delete_multiple()
// N/A - http://drupal.org/node/224333#specified_ids --- Save new users and nodes with specified IDS
// No link - node_revisions table name changed.
array(
'#type' => 'regex',
'#source' => 'quote',
'#value' => '^(select\s+.*\s+from\s+{node_revisions}|insert\s+into\s+{node_revisions}|update\s+{node_revisions}\s+set|delete\s+from\s+{node_revisions})',
'#warning_callback' => '_coder_review_7x_node_revisions_table_warning',
),
// http://drupal.org/node/224333#node_links
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' => 'function\s+[a-z0-9_]+_(link)\s*\(\s*([\'"](node|taxonomy terms)[\'"]|' . $argex . '\s*,\s*\$node\s*,)',
'#warning_callback' => '_coder_review_7x_node_links_warning',
),
// http://drupal.org/node/224333#node_load_multiple
array(
'#type' => 'regex',
'#source' => 'allphp',
'#value' =>'[\s\(]node_load\s*\(\s*(\$param\s*[,\)]|array\s*\()',
'#warning_callback' => '_coder_review_7x_node_load_warning',
),
// http://drupal.org/node/224333#node_type_base
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_node_info$',
'#value' => '[\'"](module)[\'"]\s*=>\s*[\'"].*?[\'"]',
'#warning_callback' => '_coder_review_7x_hook_node_info_module_warning',
),
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_node_info$',
'#value' => '[\'"](module|base)[\'"]\s*=>\s*[\'"]node[\'"]',
'#warning_callback' => '_coder_review_7x_hook_node_info_node_content_warning',
),
// http://drupal.org/node/224333#remove_op
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(nodeapi)\s*\(',
'#warning_callback' => '_coder_review_7x_hook_nodeapi_op_warning',
),
// http://drupal.org/node/224333#node_invoke_nodeapi
array(
'#type' => 'regex',
'#value' => '[\s\(]node_invoke_nodeapi\s*\(',
'#warning_callback' => '_coder_review_7x_node_invoke_nodeapi_removed_warning',
),
// http://drupal.org/node/224333#node_view
array(
'#type' => 'regex',
'#value' => '[\s\(]node_view\s*\(',
'#warning_callback' => '_coder_review_7x_node_view_warning',
),
// http://drupal.org/node/224333#node_build_rss
array(
'#type' => 'regex',
'#source' => 'allphp',
'#function' => '_nodeapi$',
'#value' => '[\'"]rss item[\'"]',
'#warning_callback' => '_coder_review_7x_node_build_rss_warning',
),
// http://drupal.org/node/224333#node_type_get_functions
array(
'#type' => 'regex',
'#value' => '[\s\(]node_get_types\s*\(',
'#warning_callback' => '_coder_review_7x_node_type_get_functions_warning',
),
// http://drupal.org/node/224333#build_mode
array(
'#type' => 'regex',
'#value' => '[\s\(]\$node->build_mode',
'#warning_callback' => '_coder_review_7x_build_mode_warning',
),
array(
'#type' => 'regex',
'#value' => '[\s\(]NODE_BUILD_PREVIEW',
'#warning_callback' => '_coder_review_7x_node_build_preview_warning',
),
// http://drupal.org/node/224333#hook_node_xxx
array(
'#type' => 'regex',
'#value' => 'function\s+[a-z0-9_]+_(nodeapi)_[a-z]+\s*\(',
'#warning_callback' => '_coder_review_7x_hook_node_xxx_warning',
),
// Multilingual
// http://drupal.org/node/224333#locale_context --- Added string context support to t() and format_plural(), changed parameters
// Misc
// N/A - http://drupal.org/node/224333#sticky_headers --- Make sticky tableheaders optional
// N/A - http://drupal.org/node/224333#implementation_hook_comment --- Commenting style - use 'Implement hook_foo().' when documenting hooks.
// http://drupal.org/node/224333#book_toc_parameters
array(
'#type' => 'regex',
'#value' => '[\s\(]book_toc\s*\(\s*' . $argex . '\s*,\s*(array\s*\(|(\$?)[a-zA-Z_]+\s*,\s*\d+)',
'#warning_callback' => '_coder_review_7x_book_toc_warning',
),
// http://drupal.org/node/224333#referer_uri
array(
'#type' => 'regex',
'#value' => '[\s\(]referer_uri\s*\(',
'#warning_callback' => '_coder_review_7x_referer_uri_warning',
),
// http://drupal.org/node/224333#drupal_clone
array(
'#type' => 'regex',
'#value' => '[\s\(]drupal_clone\s*\(',
'#warning_callback' => '_coder_review_7x_drupal_clone_warning',
),
// http://drupal.org/node/224333#actions_synchronize
array(
'#type' => 'regex',
'#value' => '[\s\(]actions_synchronize\s*\((\$actions|[^,]+,)',
'#warning_callback' => '_coder_review_7x_actions_synchronize_warning',
),
// http://drupal.org/node/224333#distauth --- Login validation change for distributed authentication modules
);
$review = array(
'#title' => t('Converting 6.x modules to 7.x'),
'#link' => 'http://drupal.org/node/394070',
'#rules' => $rules,
'#severity' => 'critical',
);
return array('upgrade7x' => $review);
}
?>