Ticket #7496: 7496.phpdoc.r8623.patch
| File 7496.phpdoc.r8623.patch, 22.7 KB (added by , 17 years ago) |
|---|
-
admin-header.php
18 18 $the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']); 19 19 $ie6_no_scrollbar = true; 20 20 21 /** 22 * Append 'minwidth' to value. 23 * 24 * @param mixed $c 25 * @return string 26 */ 21 27 function add_minwidth($c) { 22 28 return $c . 'minwidth '; 23 29 } -
install-helper.php
1 1 <?php 2 /** 3 * Plugins may load this file to gain access to special helper functions for 4 * plugin installation. This file is not included by WordPress and it is 5 * recommended, to prevent fatal errors, that this file is included using 6 * require_once(). 7 * 8 * These functions are not optimized for speed, but they should only be used 9 * once in a while, so speed shouldn't be a concern. If it is and you are 10 * needing to use these functions a lot, you might experience time outs. If you 11 * do, then it is advised to just write the SQL code yourself. 12 * 13 * You can turn debugging on, by setting $debug to 1 after you include this 14 * file. 15 * 16 * <code> 17 * check_column('wp_links', 'link_description', 'mediumtext'); 18 * if (check_column($wpdb->comments, 'comment_author', 'tinytext')) 19 * echo "ok\n"; 20 * 21 * $error_count = 0; 22 * $tablename = $wpdb->links; 23 * // check the column 24 * if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) { 25 * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; 26 * $q = $wpdb->query($ddl); 27 * } 28 * 29 * if (check_column($wpdb->links, 'link_description', 'varchar(255)')) { 30 * $res .= $tablename . ' - ok <br />'; 31 * } else { 32 * $res .= 'There was a problem with ' . $tablename . '<br />'; 33 * ++$error_count; 34 * } 35 * </code> 36 * 37 * @package WordPress 38 * @subpackage Plugins 39 */ 40 41 /** 42 * @global bool $wp_only_load_config 43 * @name $wp_only_load_config 44 * @var bool 45 * @since unknown 46 */ 2 47 $wp_only_load_config = true; 48 49 /** Load WordPress Bootstrap */ 3 50 require_once(dirname(dirname(__FILE__)).'/wp-load.php'); 51 52 /** 53 * Turn debugging on or off. 54 * @global bool|int $debug 55 * @name $debug 56 * @var bool|int 57 * @since unknown 58 */ 4 59 $debug = 0; 5 60 61 if ( ! function_exists('maybe_create_table') ) : 6 62 /** 7 ** maybe_create_table() 8 ** Create db table if it doesn't exist. 9 ** Returns: true if already exists or on successful completion 10 ** false on error 63 * Create database table, if it doesn't already exist. 64 * 65 * @since unknown 66 * @package WordPress 67 * @subpackage Plugins 68 * @uses $wpdb 69 * 70 * @param string $table_name Database table name. 71 * @param string $create_ddl Create database table SQL. 72 * @return bool False on error, true if already exists or success. 11 73 */ 12 if ( ! function_exists('maybe_create_table') ) :13 74 function maybe_create_table($table_name, $create_ddl) { 14 75 global $wpdb; 15 76 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { … … 29 90 } 30 91 endif; 31 92 93 if ( ! function_exists('maybe_add_column') ) : 32 94 /** 33 ** maybe_add_column() 34 ** Add column to db table if it doesn't exist. 35 ** Returns: true if already exists or on successful completion 36 ** false on error 95 * Add column to database table, if column doesn't already exist in table. 96 * 97 * @since unknown 98 * @package WordPress 99 * @subpackage Plugins 100 * @uses $wpdb 101 * @uses $debug 102 * 103 * @param string $table_name Database table name 104 * @param string $column_name Table column name 105 * @param string $create_ddl SQL to add column to table. 106 * @return bool False on failure. True, if already exists or was successful. 37 107 */ 38 if ( ! function_exists('maybe_add_column') ) :39 108 function maybe_add_column($table_name, $column_name, $create_ddl) { 40 109 global $wpdb, $debug; 41 110 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 42 111 if ($debug) echo("checking $column == $column_name<br />"); 43 if ($column == $column_name) { 44 return true; 45 } 112 113 if ($column == $column_name) { 114 return true; 115 } 46 116 } 47 117 //didn't find it try to create it. 48 118 $wpdb->query($create_ddl); … … 57 127 endif; 58 128 59 129 /** 60 ** maybe_drop_column() 61 ** Drop column from db table if it exists. 62 ** Returns: true if it doesn't already exist or on successful drop 63 ** false on error 130 * Drop column from database table, if it exists. 131 * 132 * @since unknown 133 * @package WordPress 134 * @subpackage Plugins 135 * @uses $wpdb 136 * 137 * @param string $table_name Table name 138 * @param string $column_name Column name 139 * @param string $drop_ddl SQL statement to drop column. 140 * @return bool False on failure, true on success or doesn't exist. 64 141 */ 65 142 function maybe_drop_column($table_name, $column_name, $drop_ddl) { 66 143 global $wpdb; … … 80 157 return true; 81 158 } 82 159 83 84 160 /** 85 ** check_column() 86 ** Check column matches passed in criteria. 87 ** Pass in null to skip checking that criteria 88 ** Returns: true if it matches 89 ** false otherwise 90 ** (case sensitive) Column names returned from DESC table are: 91 ** Field 92 ** Type 93 ** Null 94 ** Key 95 ** Default 96 ** Extra 161 * Check column matches criteria. 162 * 163 * Uses the SQL DESC for retrieving the table info for the column. It will help 164 * understand the parameters, if you do more research on what column information 165 * is returned by the SQL statement. Pass in null to skip checking that 166 * criteria. 167 * 168 * Column names returned from DESC table are case sensitive and are listed: 169 * Field 170 * Type 171 * Null 172 * Key 173 * Default 174 * Extra 175 * 176 * @param string $table_name Table name 177 * @param string $col_name Column name 178 * @param string $col_type Column type 179 * @param bool $is_null Optional. Check is null. 180 * @param mixed $key Optional. Key info. 181 * @param mixed $default Optional. Default value. 182 * @param mixed $extra Optional. Extra value. 183 * @return bool True, if matches. False, if not matching. 97 184 */ 98 185 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 99 186 global $wpdb, $debug; … … 102 189 103 190 foreach ($results as $row ) { 104 191 if ($debug > 1) print_r($row); 105 if ($row->Field == $col_name) { 106 // got our column, check the params 107 if ($debug) echo ("checking $row->Type against $col_type\n"); 108 if (($col_type != null) && ($row->Type != $col_type)) { 109 ++$diffs; 110 } 111 if (($is_null != null) && ($row->Null != $is_null)) { 112 ++$diffs; 113 } 114 if (($key != null) && ($row->Key != $key)) { 115 ++$diffs; 116 } 117 if (($default != null) && ($row->Default != $default)) { 118 ++$diffs; 119 } 120 if (($extra != null) && ($row->Extra != $extra)) { 121 ++$diffs; 122 } 123 if ($diffs > 0) { 124 if ($debug) echo ("diffs = $diffs returning false\n"); 125 return false; 126 } 127 return true; 128 } // end if found our column 192 193 if ($row->Field == $col_name) { 194 // got our column, check the params 195 if ($debug) echo ("checking $row->Type against $col_type\n"); 196 if (($col_type != null) && ($row->Type != $col_type)) { 197 ++$diffs; 198 } 199 if (($is_null != null) && ($row->Null != $is_null)) { 200 ++$diffs; 201 } 202 if (($key != null) && ($row->Key != $key)) { 203 ++$diffs; 204 } 205 if (($default != null) && ($row->Default != $default)) { 206 ++$diffs; 207 } 208 if (($extra != null) && ($row->Extra != $extra)) { 209 ++$diffs; 210 } 211 if ($diffs > 0) { 212 if ($debug) echo ("diffs = $diffs returning false\n"); 213 return false; 214 } 215 return true; 216 } // end if found our column 129 217 } 130 218 return false; 131 219 } 132 220 133 /* 134 echo "<p>testing</p>"; 135 echo "<pre>"; 136 137 //check_column('wp_links', 'link_description', 'mediumtext'); 138 //if (check_column($wpdb->comments, 'comment_author', 'tinytext')) 139 // echo "ok\n"; 140 $error_count = 0; 141 $tablename = $wpdb->links; 142 // check the column 143 if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) 144 { 145 $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; 146 $q = $wpdb->query($ddl); 147 } 148 if (check_column($wpdb->links, 'link_description', 'varchar(255)')) { 149 $res .= $tablename . ' - ok <br />'; 150 } else { 151 $res .= 'There was a problem with ' . $tablename . '<br />'; 152 ++$error_count; 153 } 154 echo "</pre>"; 155 */ 156 ?> 221 ?> 222 No newline at end of file -
install.php
1 1 <?php 2 /** 3 * WordPress Installer 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * We are installing WordPress. 11 * 12 * @since unknown 13 * @var bool 14 */ 2 15 define('WP_INSTALLING', true); 3 16 17 /** Load WordPress Bootstrap */ 4 18 require_once('../wp-load.php'); 19 20 /** Load WordPress Administration Upgrade API */ 5 21 require_once('./includes/upgrade.php'); 6 22 7 23 if (isset($_GET['step'])) 8 24 $step = $_GET['step']; 9 25 else 10 26 $step = 0; 11 function display_header(){ 27 28 /** 29 * Display install header. 30 * 31 * @since unknown 32 * @package WordPress 33 * @subpackage Installer 34 */ 35 function display_header() { 12 36 header( 'Content-Type: text/html; charset=utf-8' ); 13 37 ?> 14 38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -
link-add.php
1 1 <?php 2 /** 3 * Add Link Administration Panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** Load WordPress Administration Bootstrap */ 2 10 require_once('admin.php'); 3 11 4 12 $title = __('Add Link'); -
link-category.php
1 1 <?php 2 /** 3 * Manage link category administration actions. 4 * 5 * This page is accessed by the link management pages and handles the forms and 6 * AJAX processes for category actions. 7 * 8 * @package WordPress 9 * @subpackage Administration 10 */ 11 12 /** Load WordPress Administration Bootstrap */ 2 13 require_once('admin.php'); 3 14 4 15 wp_reset_vars(array('action', 'cat')); … … 31 42 $default_cat_id = get_option('default_link_category'); 32 43 33 44 // Don't delete the default cats. 34 if ( $cat_ID == $default_cat_id )45 if ( $cat_ID == $default_cat_id ) 35 46 wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 36 47 37 48 wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); … … 86 97 break; 87 98 } 88 99 89 ?> 100 ?> 101 No newline at end of file -
link-import.php
1 1 <?php 2 // Links 3 // Copyright (C) 2002 Mike Little -- mike@zed1.com 2 /** 3 * Links Import Administration Panel. 4 * 5 * @copyright 2002 Mike Little <mike@zed1.com> 6 * @author Mike Little <mike@zed1.com> 7 * @package WordPress 8 * @subpackage Administration 9 */ 4 10 11 /** Load WordPress Administration Bootstrap */ 5 12 require_once('admin.php'); 6 13 $parent_file = 'edit.php'; 7 14 $title = __('Import Blogroll'); … … 98 105 $opml = file_get_contents($opml_url); 99 106 } 100 107 108 /** Load OPML Parser */ 101 109 include_once('link-parse-opml.php'); 102 110 103 111 $link_count = count($names); -
link-manager.php
1 1 <?php 2 /** 3 * Link Management Administration Panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** Load WordPress Administration Bootstrap */ 3 10 require_once ('admin.php'); 4 11 5 12 // Handle bulk deletes -
link-parse-opml.php
1 1 <?php 2 /** 3 * Parse OPML XML files and store in globals. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** Load WordPress Bootstrap */ 2 10 require_once('../wp-load.php'); 3 11 4 12 // columns we wish to find are: link_url, link_name, link_target, link_description … … 15 23 $map = $opml_map; 16 24 17 25 /** 18 ** startElement() 19 ** Callback function. Called at the start of a new xml tag. 20 **/ 26 * XML callback function for the start of a new XML tag. 27 * 28 * @since unknown 29 * @access private 30 * 31 * @uses $updated_timestamp Not used inside function. 32 * @uses $all_links Not used inside function. 33 * @uses $map Stores names of attributes to use. 34 * @global array $names 35 * @global array $urls 36 * @global array $targets 37 * @global array $descriptions 38 * @global array $feeds 39 * 40 * @param mixed $parser XML Parser resource. 41 * @param string $tagName XML element name. 42 * @param array $attrs XML element attributes. 43 */ 21 44 function startElement($parser, $tagName, $attrs) { 22 45 global $updated_timestamp, $all_links, $map; 23 46 global $names, $urls, $targets, $descriptions, $feeds; … … 41 64 } 42 65 43 66 /** 44 ** endElement() 45 ** Callback function. Called at the end of an xml tag. 46 **/ 67 * XML callback function that is called at the end of a XML tag. 68 * 69 * @since unknown 70 * @access private 71 * @package WordPress 72 * @subpackage Dummy 73 * 74 * @param mixed $parser XML Parser resource. 75 * @param string $tagName XML tag name. 76 */ 47 77 function endElement($parser, $tagName) { 48 78 // nothing to do. 49 79 } … … 62 92 63 93 // Free up memory used by the XML parser 64 94 xml_parser_free($xml_parser); 65 ?> 95 ?> 96 No newline at end of file -
link.php
1 1 <?php 2 /** 3 * Manage link administration actions. 4 * 5 * This page is accessed by the link management pages and handles the forms and 6 * AJAX processes for link actions. 7 * 8 * @package WordPress 9 * @subpackage Administration 10 */ 11 12 /** Load WordPress Administration Bootstrap */ 2 13 require_once ('admin.php'); 3 14 4 15 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); -
media-upload.php
1 1 <?php 2 /** 3 * Manage media uploaded file. 4 * 5 * There are many filters in here for media. Plugins can extend functionality 6 * by hooking into the filters. 7 * 8 * @package WordPress 9 * @subpackage Administration 10 */ 11 12 /** Load WordPress Administration Bootstrap */ 2 13 require_once('admin.php'); 3 14 wp_enqueue_script('swfupload'); 4 15 wp_enqueue_script('swfupload-degrade'); … … 11 22 wp_die(__('You do not have permission to upload files.')); 12 23 13 24 // IDs should be integers 14 $ID = isset($ID) ? (int) $ID : 0;25 $ID = isset($ID) ? (int) $ID : 0; 15 26 $post_id = isset($post_id)? (int) $post_id : 0; 16 27 17 28 // Require an ID for the edit screen … … 38 49 else 39 50 do_action("media_upload_$tab"); 40 51 41 ?> 52 ?> 53 No newline at end of file -
media.php
1 1 <?php 2 /** 3 * Media management action handler. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** Load WordPress Administration Bootstrap */ 3 10 require_once('admin.php'); 4 11 5 12 $parent_file = 'edit.php'; … … 116 123 endswitch; 117 124 118 125 119 ?> 126 ?> 127 No newline at end of file -
menu-header.php
1 1 <?php 2 /** 3 * Displays Administration Menu. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * The current page. 11 * 12 * @global string $self 13 * @name $self 14 * @var string 15 */ 2 16 $self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']); 3 17 $self = preg_replace('|^.*/plugins/|i', '', $self); 4 18 -
menu.php
1 1 <?php 2 // This array constructs the admin menu bar. 3 // 4 // Menu item name 5 // The minimum level the user needs to access the item: between 0 and 10 6 // The URL of the item's file 2 /** 3 * Build Administration Menu. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * Constructs the admin menu bar. 11 * 12 * The elements in the array are : 13 * 0: Menu item name 14 * 1: Minimum level or capability required. 15 * 2: The URL of the item's file 16 * 17 * @global array $menu 18 * @name $menu 19 * @var array 20 */ 7 21 $menu[0] = array(__('Dashboard'), 'read', 'index.php'); 8 22 9 23 if (strpos($_SERVER['REQUEST_URI'], 'edit-pages.php') !== false) -
moderation.php
1 1 <?php 2 /** 3 * Comment Moderation Administration Panel. 4 * 5 * Redirects to edit-comments.php?comment_status=moderated. 6 * 7 * @package WordPress 8 * @subpackage Administration 9 */ 2 10 require_once('../wp-load.php'); 3 11 wp_redirect('edit-comments.php?comment_status=moderated'); 4 12 ?> -
options-head.php
1 <?php wp_reset_vars(array('action', 'standalone', 'option_group_id')); ?> 1 <?php 2 /** 3 * WordPress Options Header. 4 * 5 * Resets variables: 'action', 'standalone', and 'option_group_id'. Displays 6 * updated message, if updated variable is part of the URL query. 7 * 8 * @package WordPress 9 * @subpackage Administration 10 */ 2 11 12 wp_reset_vars(array('action', 'standalone', 'option_group_id')); 13 ?> 14 3 15 <?php if (isset($_GET['updated'])) : ?> 4 16 <div id="message" class="updated fade"><p><strong><?php _e('Settings saved.') ?></strong></p></div> 5 17 <?php endif; ?> 18 No newline at end of file -
options-privacy.php
1 1 <?php 2 /** 3 * Privacy Options Settings Administration Panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** Load WordPress Administration Bootstrap */ 2 10 require_once('./admin.php'); 3 11 4 12 $title = __('Privacy Settings'); -
post-new.php
1 1 <?php 2 /** 3 * New Post Administration Panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** Load WordPress Administration Bootstrap */ 2 10 require_once('admin.php'); 3 11 $title = __('Create New Post'); 4 12 $parent_file = 'post-new.php'; -
profile.php
1 1 <?php 2 /** 3 * User Profile Administration Panel. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * This is a profile page. 11 * 12 * @since unknown 13 * @var bool 14 */ 2 15 define('IS_PROFILE_PAGE', true); 16 17 /** Load User Editing Page */ 3 18 require_once('user-edit.php'); 4 ?> 19 ?> 20 No newline at end of file -
setup-config.php
1 1 <?php 2 /** 3 * Retrieves and creates the wp-config.php file. 4 * 5 * The permissions for the base directory must allow for writing files in order 6 * for the wp-config.php to be created using this page. 7 * 8 * @package WordPress 9 * @subpackage Administration 10 */ 11 12 /** 13 * We are installing. 14 * 15 * @since unknown 16 * @package WordPress 17 */ 2 18 define('WP_INSTALLING', true); 3 19 //These three defines are required to allow us to use require_wp_db() to load the database class while being wp-content/wp-db.php aware 4 20 define('ABSPATH', dirname(dirname(__FILE__)).'/'); … … 30 46 else 31 47 $step = 0; 32 48 33 function display_header(){ 49 /** 50 * Display setup wp-config.php file header. 51 * 52 * @since unknown 53 * @package WordPress 54 * @subpackage Installer_WP_Config 55 */ 56 function display_header() { 34 57 header( 'Content-Type: text/html; charset=utf-8' ); 35 58 ?> 36 59 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -
update-links.php
1 1 <?php 2 /** 3 * Send blog links to pingomatic.com to update. 4 * 5 * You can disable this feature by deleting the option 'use_linksupdate' or 6 * setting the option to false. If no links exist, then no links are sent. 7 * 8 * Snoopy is included, but is not used. Fsockopen() is used instead to send link 9 * URLs. 10 * 11 * @package WordPress 12 * @subpackage Administration 13 */ 14 15 /** Load WordPress Bootstrap */ 2 16 require_once('../wp-load.php'); 17 18 /** Load Snoopy HTTP Client class */ 3 19 require_once( ABSPATH . 'wp-includes/class-snoopy.php'); 4 20 5 21 if ( !get_option('use_linksupdate') ) … … 41 57 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time, $uri) ); 42 58 endforeach; 43 59 } 44 ?> 60 ?> 61 No newline at end of file -
upgrade-functions.php
1 1 <?php 2 // Deprecated. Use includes/upgrade.php. 2 /** 3 * WordPress Upgrade Functions. Old file, must not be used. Include 4 * wp-admin/includes/upgrade.php instead. 5 * 6 * @deprecated 2.5 7 * @package WordPress 8 * @subpackage Administration 9 */ 10 3 11 _deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/upgrade.php' ); 4 12 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 5 ?> 13 ?> 14 No newline at end of file -
upgrade.php
1 1 <?php 2 /** 3 * Upgrade WordPress Page. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * We are upgrading WordPress. 11 * 12 * @since unknown 13 * @var bool 14 */ 2 15 define('WP_INSTALLING', true); 3 16 17 /** Load WordPress Bootstrap */ 4 18 require('../wp-load.php'); 19 5 20 timer_start(); 6 21 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 7 22