From a6a1522a8d276712fa3e3a93e7ad2d98f360d31b Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 25 May 2008 15:50:15 +0000 Subject: [PATCH] File file level phpdoc from jacobsantos. see #7037 git-svn-id: http://svn.automattic.com/wordpress/trunk@7991 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- index.php | 16 ++++++++- wp-app.php | 83 +++++++++++++++++++++++++++++++++++++------- wp-atom.php | 11 ++++++ wp-blog-header.php | 7 +++- wp-comments-post.php | 10 +++++- wp-commentsrss2.php | 13 +++++++ wp-cron.php | 22 ++++++++++-- wp-feed.php | 14 ++++++++ wp-links-opml.php | 12 +++++++ wp-load.php | 26 +++++++++++--- wp-login.php | 52 ++++++++++++++++++++++++++- wp-mail.php | 12 ++++++- wp-pass.php | 8 +++++ wp-rdf.php | 15 +++++++- wp-register.php | 12 +++++-- wp-rss.php | 13 +++++++ wp-rss2.php | 11 ++++++ wp-trackback.php | 13 ++++++- xmlrpc.php | 55 +++++++++++++++++++++++++---- 19 files changed, 369 insertions(+), 36 deletions(-) diff --git a/index.php b/index.php index b1c655cd5206..50e2a278895c 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,19 @@ \ No newline at end of file diff --git a/wp-app.php b/wp-app.php index 5ea5f1d888ac..03f5d6b8c2aa 100644 --- a/wp-app.php +++ b/wp-app.php @@ -1,26 +1,60 @@ + * @author Modified by Dougal Campbell + * @version 1.0.5-dc */ +/** + * WordPress is handling an Atom Publishing Protocol request. + * + * @var bool + */ define('APP_REQUEST', true); +/** Set up WordPress environment */ require_once('./wp-load.php'); + +/** Post Template API */ require_once(ABSPATH . WPINC . '/post-template.php'); + +/** Atom Publishing Protocol Class */ require_once(ABSPATH . WPINC . '/atomlib.php'); + +/** Feed Handling API */ require_once(ABSPATH . WPINC . '/feed.php'); $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); +/** + * Whether to enable Atom Publishing Protocol Logging. + * + * @name app_logging + * @var int|bool + */ $app_logging = 0; -// TODO: Should be an option somewhere +/** + * Whether to always authenticate user. Permanently set to true. + * + * @name always_authenticate + * @var int|bool + * @todo Should be an option somewhere + */ $always_authenticate = 1; +/** + * log_app() - Writes logging info to a file. + * + * @uses $app_logging + * @package WordPress + * @subpackage Logging + * + * @param string $label Type of logging + * @param string $msg Information describing logging reason. + */ function log_app($label,$msg) { global $app_logging; if ($app_logging) { @@ -32,6 +66,18 @@ function log_app($label,$msg) { } if ( !function_exists('wp_set_current_user') ) : +/** + * wp_set_current_user() - Sets the current WordPress User + * + * Pluggable function which is also found in pluggable.php. + * + * @see wp-includes/pluggable.php Documentation for this function. + * @uses $current_user Global of current user to test whether $id is the same. + * + * @param int $id The user's ID + * @param string $name Optional. The username of the user. + * @return WP_User Current user's User object + */ function wp_set_current_user($id, $name = '') { global $current_user; @@ -44,13 +90,26 @@ function wp_set_current_user($id, $name = '') { } endif; +/** + * wa_posts_where_include_drafts_filter() - Filter to add more post statuses + * + * @param string $where SQL statement to filter + * @return string Filtered SQL statement with added post_status for where clause + */ function wa_posts_where_include_drafts_filter($where) { - $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where); - return $where; + $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where); + return $where; } add_filter('posts_where', 'wa_posts_where_include_drafts_filter'); +/** + * @internal + * Left undocumented to work on later. If you want to finish, then please do so. + * + * @package WordPress + * @subpackage Publishing + */ class AtomServer { var $ATOM_CONTENT_TYPE = 'application/atom+xml'; @@ -170,9 +229,9 @@ function get_service() { $entries_url = attribute_escape($this->get_entries_url()); $categories_url = attribute_escape($this->get_categories_url()); $media_url = attribute_escape($this->get_attachments_url()); - foreach ($this->media_content_types as $med) { - $accepted_media_types = $accepted_media_types . "" . $med . ""; - } + foreach ($this->media_content_types as $med) { + $accepted_media_types = $accepted_media_types . "" . $med . ""; + } $atom_prefix="atom"; $atom_blogname=get_bloginfo('name'); $service_doc = <<handle_request(); -?> +?> \ No newline at end of file diff --git a/wp-atom.php b/wp-atom.php index 179ffa270781..9e20eb68ee2e 100644 --- a/wp-atom.php +++ b/wp-atom.php @@ -1,4 +1,15 @@ +?> \ No newline at end of file diff --git a/wp-comments-post.php b/wp-comments-post.php index aa6184b66a94..e0a06dc755e4 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -1,10 +1,18 @@ +?> \ No newline at end of file diff --git a/wp-commentsrss2.php b/wp-commentsrss2.php index 50e241f0dac6..9c3b230f626f 100644 --- a/wp-commentsrss2.php +++ b/wp-commentsrss2.php @@ -1,4 +1,17 @@ time()) return; + foreach ($crons as $timestamp => $cronhooks) { if ($timestamp > time()) break; foreach ($cronhooks as $hook => $keys) { @@ -32,4 +50,4 @@ update_option('doing_cron', 0); -?> +?> \ No newline at end of file diff --git a/wp-feed.php b/wp-feed.php index 260ddd4751e6..d4f1a5bff0bf 100644 --- a/wp-feed.php +++ b/wp-feed.php @@ -1,4 +1,18 @@ +?> \ No newline at end of file diff --git a/wp-login.php b/wp-login.php index 9de2cb8d2f4c..8910ba6c9b3e 100644 --- a/wp-login.php +++ b/wp-login.php @@ -1,7 +1,29 @@ element. + * @param string $message Optional. Message to display in header. + * @param WP_Error $wp_error Optional. WordPress Error Object + */ function login_header($title = 'Login', $message = '', $wp_error = '') { global $error; @@ -56,6 +78,15 @@ function focusit() { } } // End of login_header() +/** + * retrieve_password() - Handles sending password retrieval email to user + * + * {@internal Missing Long Description}} + * + * @uses $wpdb WordPress Database object + * + * @return bool|WP_Error True: when finish. WP_Error on error + */ function retrieve_password() { global $wpdb; @@ -110,6 +141,16 @@ function retrieve_password() { return true; } +/** + * reset_password() - Handles resetting the user's password + * + * {@internal Missing Long Description}} + * + * @uses $wpdb WordPress Database object + * + * @param string $key Hash to validate sending user's password + * @return bool|WP_Error + */ function reset_password($key) { global $wpdb; @@ -144,6 +185,15 @@ function reset_password($key) { return true; } +/** + * register_new_user() - Handles registering a new user + * + * {@internal Missing Long Description}} + * + * @param string $user_login User's username for logging in + * @param string $user_email User's email address to send password and add + * @return int|WP_Error Either user's ID or error on failure. + */ function register_new_user($user_login, $user_email) { $errors = new WP_Error(); diff --git a/wp-mail.php b/wp-mail.php index 0fe82a5be3d9..52d05cb8d3f1 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -1,8 +1,18 @@ quit(); -?> +?> \ No newline at end of file diff --git a/wp-pass.php b/wp-pass.php index 58647c235dd1..1be8095cc01a 100644 --- a/wp-pass.php +++ b/wp-pass.php @@ -1,4 +1,12 @@ insert_id); trackback_response(0); } -?> +?> \ No newline at end of file diff --git a/xmlrpc.php b/xmlrpc.php index cec79a00e9dc..179596d1cffd 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -1,5 +1,16 @@ + * @package WordPress + */ + +/** + * Whether this is a XMLRPC Request + * + * @var bool + */ define('XMLRPC_REQUEST', true); // Some browser-embedded clients send cookies. We don't want them. @@ -11,10 +22,11 @@ $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); } -# fix for mozBlog and other cases where ' +?> \ No newline at end of file