Skip to content

Commit

Permalink
File file level phpdoc from jacobsantos. see #7037
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@7991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed May 25, 2008
1 parent 62784a5 commit a6a1522
Show file tree
Hide file tree
Showing 19 changed files with 369 additions and 36 deletions.
16 changes: 15 additions & 1 deletion index.php
@@ -1,5 +1,19 @@
<?php
/* Short and sweet */
/**
* Front to the WordPress application. Most of WordPress is loaded through this
* file. This file doesn't do anything, but loads the file which does and tells
* WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
?>
83 changes: 71 additions & 12 deletions wp-app.php
@@ -1,26 +1,60 @@
<?php
/*
* wp-app.php - Atom Publishing Protocol support for WordPress
* Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/
* Modified by: Dougal Campbell, http://dougal.gunters.org/
/**
* Atom Publishing Protocol support for WordPress
*
* Version: 1.0.5-dc
* @author Original by Elias Torres <http://torrez.us/archives/2006/08/31/491/>
* @author Modified by Dougal Campbell <http://dougal.gunters.org/>
* @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) {
Expand All @@ -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;

Expand All @@ -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';
Expand Down Expand Up @@ -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 . "<accept>" . $med . "</accept>";
}
foreach ($this->media_content_types as $med) {
$accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>";
}
$atom_prefix="atom";
$atom_blogname=get_bloginfo('name');
$service_doc = <<<EOD
Expand Down Expand Up @@ -1124,4 +1183,4 @@ function get_publish_time($published) {
$server = new AtomServer();
$server->handle_request();

?>
?>
11 changes: 11 additions & 0 deletions wp-atom.php
@@ -1,4 +1,15 @@
<?php
/**
* Outputs the Atom feed XML format using the feed-atom.php file in wp-includes
* folder. This file only sets the feed format and includes the feed-atom.php.
*
* This file is no longer used in WordPress and while it is not deprecated now.
* This file will most likely be deprecated or removed in a later version.
*
* The link for the atom feed is /index.php?feed=atom with permalinks off.
*
* @package WordPress
*/

if (empty($wp)) {
require_once('./wp-load.php');
Expand Down
7 changes: 6 additions & 1 deletion wp-blog-header.php
@@ -1,4 +1,9 @@
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/

if ( !isset($wp_did_header) ) {

Expand All @@ -12,4 +17,4 @@

}

?>
?>
10 changes: 9 additions & 1 deletion wp-comments-post.php
@@ -1,10 +1,18 @@
<?php
/**
* Handles Comment Post to WordPress and prevents duplicate comment posting.
*
* @package @WordPress
*/

if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
header('Allow: POST');
header('HTTP/1.1 405 Method Not Allowed');
header('Content-Type: text/plain');
exit;
}

/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );

nocache_headers();
Expand Down Expand Up @@ -74,4 +82,4 @@

wp_redirect($location);

?>
?>
13 changes: 13 additions & 0 deletions wp-commentsrss2.php
@@ -1,4 +1,17 @@
<?php
/**
* Outputs the RSS2 XML format comment feed using the feed-rss2.php file in
* wp-includes folder. This file only sets the feed format and includes the
* feed-rss2-comments.php.
*
* This file is no longer used in WordPress and while it is not deprecated now.
* This file will most likely be deprecated or removed in a later version.
*
* The link for the rss2 comment feed is /index.php?feed=rss2&withcomments=1
* with permalinks off.
*
* @package WordPress
*/

if (empty($wp)) {
require_once('./wp-load.php');
Expand Down
22 changes: 20 additions & 2 deletions wp-cron.php
@@ -1,6 +1,23 @@
<?php
/**
* WordPress Cron Implementation for hosts, which do not offer CRON or for which
* the user has not setup a CRON job pointing to this file.
*
* The HTTP request to this file will not slow down the visitor who happens to
* visit when the cron job is needed to run.
*
* @package WordPress
*/

ignore_user_abort(true);
define('DOING_CRON', TRUE);

/**
* Tell WordPress we are doing the CRON task.
*
* @var bool
*/
define('DOING_CRON', true);
/** Setup WordPress environment */
require_once('./wp-load.php');

if ( $_GET['check'] != wp_hash('187425') )
Expand All @@ -15,6 +32,7 @@
$keys = array_keys($crons);
if (!is_array($crons) || $keys[0] > time())
return;

foreach ($crons as $timestamp => $cronhooks) {
if ($timestamp > time()) break;
foreach ($cronhooks as $hook => $keys) {
Expand All @@ -32,4 +50,4 @@

update_option('doing_cron', 0);

?>
?>
14 changes: 14 additions & 0 deletions wp-feed.php
@@ -1,4 +1,18 @@
<?php
/**
* Outputs the RSS2 feed XML format. This file is a shortcut or compatibility
* layer for easily finding the RSS feed for the site. It loads WordPress using
* the wp-blog-header.php file and running do_feed() function.
*
* @see do_feed() Used to display the RSS2 feed
*
* This file is no longer used in WordPress and while it is not deprecated now.
* This file will most likely be deprecated or removed in a later version.
*
* The link for the rss2 feed is /index.php?feed=rss2 with permalinks off.
*
* @package WordPress
*/

if (empty($doing_rss)) {
$doing_rss = 1;
Expand Down
12 changes: 12 additions & 0 deletions wp-links-opml.php
@@ -1,4 +1,16 @@
<?php
/**
* Outputs the OPML XML format for getting the links defined in the link
* administration. This can be used to export links from one blog over to
* another. Links aren't exported by the WordPress export, so this file handles
* that.
*
* This file is not added by default to WordPress theme pages when outputting
* feed links. It will have to be added manually for browsers and users to pick
* up that this file exists.
*
* @package WordPress
*/

if (empty($wp)) {
require_once('./wp-load.php');
Expand Down
26 changes: 21 additions & 5 deletions wp-load.php
@@ -1,16 +1,32 @@
<?php

// Define ABSPATH as this files directory
/**
* Bootstrap file for setting the ABSPATH constant
* and loading the wp-config.php file. The wp-config.php
* file will then load the wp-settings.php file, which
* will then set up the WordPress environment.
*
* If the wp-config.php file is not found then an error
* will be displayed asking the visitor to set up the
* wp-config.php file.
*
* Also made to work in the wp-admin/ folder, because it
* will look in the parent directory if the file is not
* found in the current directory.
*
* @package WordPress
*/

/** Define ABSPATH as this files directory */
define( 'ABSPATH', dirname(__FILE__) . '/' );

if ( file_exists( ABSPATH . 'wp-config.php') ) {

// The config file resides in ABSPATH
/** The config file resides in ABSPATH */
require_once( ABSPATH . 'wp-config.php' );

} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) ) {

// The config file resides one level below ABSPATH
/** The config file resides one level below ABSPATH */
require_once( dirname(ABSPATH) . '/wp-config.php' );

} else {
Expand All @@ -29,4 +45,4 @@

}

?>
?>

0 comments on commit a6a1522

Please sign in to comment.