diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 81b5f6d3e..aa36b2a7f 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -18,6 +18,12 @@ $min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php'
$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
$ie6_no_scrollbar = true;
+/**
+ * Append 'minwidth' to value.
+ *
+ * @param mixed $c
+ * @return string
+ */
function add_minwidth($c) {
return $c . 'minwidth ';
}
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php
index 140d8f2bb..6164c1775 100644
--- a/wp-admin/import/blogger.php
+++ b/wp-admin/import/blogger.php
@@ -1,9 +1,46 @@
)\s*\n|', ' ', $s));
}
/**
- The Main Importer Class
-**/
+ * Dotclear Importer class
+ *
+ * Will process the WordPress eXtended RSS files that you upload from the export
+ * file.
+ *
+ * @package WordPress
+ * @subpackage Importer
+ *
+ * @since unknown
+ */
class Dotclear_Import {
function header()
@@ -742,5 +828,7 @@ class Dotclear_Import {
}
$dc_import = new Dotclear_Import();
+
register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog.'), array ($dc_import, 'dispatch'));
+
?>
diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php
index 58aa75771..9db705d99 100644
--- a/wp-admin/import/greymatter.php
+++ b/wp-admin/import/greymatter.php
@@ -1,5 +1,19 @@
';
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index c3fb1d78c..ea44611f4 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -1,10 +1,22 @@
diff --git a/wp-admin/import/utw.php b/wp-admin/import/utw.php
index 759809ecc..81470033a 100644
--- a/wp-admin/import/utw.php
+++ b/wp-admin/import/utw.php
@@ -1,5 +1,18 @@
posts, comments, custom fields, pages, and categories from a WordPress export file.'), array ($wp_import, 'dispatch'));
diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php
index 88008b36f..fdfa5a775 100644
--- a/wp-admin/import/wp-cat2tag.php
+++ b/wp-admin/import/wp-cat2tag.php
@@ -1,5 +1,19 @@
diff --git a/wp-admin/includes/class-ftp-sockets.php b/wp-admin/includes/class-ftp-sockets.php
index 99b405056..4026dd0bb 100644
--- a/wp-admin/includes/class-ftp-sockets.php
+++ b/wp-admin/includes/class-ftp-sockets.php
@@ -11,6 +11,20 @@
* @link http://www.phpclasses.org/browse/package/1743.html Site
* @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
*/
+
+/**
+ * Socket Based FTP implementation
+ *
+ * @package PemFTP
+ * @subpackage Socket
+ * @since 2.5
+ *
+ * @version 1.0
+ * @copyright Alexey Dotsenko
+ * @author Alexey Dotsenko
+ * @link http://www.phpclasses.org/browse/package/1743.html Site
+ * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ */
class ftp extends ftp_base {
function ftp($verb=FALSE, $le=FALSE) {
diff --git a/wp-admin/includes/class-ftp.php b/wp-admin/includes/class-ftp.php
index c10526bdd..0bf25e9c7 100644
--- a/wp-admin/includes/class-ftp.php
+++ b/wp-admin/includes/class-ftp.php
@@ -11,15 +11,75 @@
* @link http://www.phpclasses.org/browse/package/1743.html Site
* @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
*/
+
+/**
+ * Defines the newline characters, if not defined already.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var string
+ */
if(!defined('CRLF')) define('CRLF',"\r\n");
+
+/**
+ * Sets whatever to autodetect ASCII mode.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var int
+ */
if(!defined("FTP_AUTOASCII")) define("FTP_AUTOASCII", -1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5
+ * @var int
+ */
if(!defined("FTP_BINARY")) define("FTP_BINARY", 1);
+
+/**
+ *
+ * This can be redefined.
+ * @since 2.5
+ * @var int
+ */
if(!defined("FTP_ASCII")) define("FTP_ASCII", 0);
-if(!defined('FTP_FORCE')) define('FTP_FORCE', TRUE);
+
+/**
+ * Whether to force FTP.
+ *
+ * This can be redefined.
+ *
+ * @since 2.5
+ * @var bool
+ */
+if(!defined('FTP_FORCE')) define('FTP_FORCE', true);
+
+/**
+ * @since 2.5
+ * @var string
+ */
define('FTP_OS_Unix','u');
+
+/**
+ * @since 2.5
+ * @var string
+ */
define('FTP_OS_Windows','w');
+
+/**
+ * @since 2.5
+ * @var string
+ */
define('FTP_OS_Mac','m');
+/**
+ * PemFTP base class
+ *
+ */
class ftp_base {
/* Public variables */
var $LocalEcho;
@@ -838,5 +898,6 @@ if (!extension_loaded('sockets')) {
$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;
}
+
require_once "class-ftp-".($mod_sockets?"sockets":"pure").".php";
?>
diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php
index b49074444..fcc5351c5 100644
--- a/wp-admin/includes/class-pclzip.php
+++ b/wp-admin/includes/class-pclzip.php
@@ -1,51 +1,60 @@
define( 'PCLZIP_SEPARATOR', ' ' );
+ * Recommanded values for smart separation of filenames.
+ */
+define( 'PCLZIP_SEPARATOR', ',' );
- // ----- Error configuration
- // 0 : PclZip Class integrated error handling
- // 1 : PclError external library error handling. By enabling this
- // you must ensure that you have included PclError library.
- // [2,...] : reserved for futur use
- define( 'PCLZIP_ERROR_EXTERNAL', 0 );
+/**
+ * Error configuration
+ *
+ * 0 : PclZip Class integrated error handling
+ * 1 : PclError external library error handling. By enabling this you must
+ * ensure that you have included PclError library.
+ * [2,...] : reserved for future use
+ */
+define( 'PCLZIP_ERROR_EXTERNAL', 0 );
// ----- Optional static temporary directory
// By default temporary files are generated in the script current
@@ -137,7 +146,7 @@
define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
define( 'PCLZIP_CB_PRE_ADD', 78003 );
define( 'PCLZIP_CB_POST_ADD', 78004 );
- /* For futur use
+ /* For future use
define( 'PCLZIP_CB_PRE_LIST', 78005 );
define( 'PCLZIP_CB_POST_LIST', 78006 );
define( 'PCLZIP_CB_PRE_DELETE', 78007 );
diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php
index 91b5e2872..9f39c8c8c 100644
--- a/wp-admin/includes/class-wp-filesystem-base.php
+++ b/wp-admin/includes/class-wp-filesystem-base.php
@@ -1,5 +1,17 @@
diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php
index 77a758266..cc0b6b61e 100644
--- a/wp-admin/includes/class-wp-filesystem-direct.php
+++ b/wp-admin/includes/class-wp-filesystem-direct.php
@@ -1,5 +1,19 @@
FTP_BINARY
);
- function WP_Filesystem_ftpsockets($opt='') {
+ function WP_Filesystem_ftpsockets($opt = '') {
$this->method = 'ftpsockets';
$this->errors = new WP_Error();
@@ -86,7 +101,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
$this->permission = $perm;
}
- function get_contents($file, $type = '', $resumepos = 0){
+ function get_contents($file, $type = '', $resumepos = 0) {
if( ! $this->exists($file) )
return false;
@@ -112,7 +127,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
return $contents;
}
- function get_contents_array($file){
+ function get_contents_array($file) {
return explode("\n", $this->get_contents($file) );
}
@@ -151,7 +166,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
return false;
}
- function chmod($file, $mode = false, $recursive = false ){
+ function chmod($file, $mode = false, $recursive = false ) {
if( ! $mode )
$mode = $this->permission;
if( ! $mode )
@@ -251,7 +266,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
return $this->ftp->filesize($file);
}
- function touch($file, $time = 0, $atime = 0 ){
+ function touch($file, $time = 0, $atime = 0 ) {
return false;
}
@@ -311,8 +326,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
return $ret;
}
- function __destruct(){
+ function __destruct() {
$this->ftp->quit();
}
}
+
?>
diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php
index 8a47fe6d2..f6910cb9f 100644
--- a/wp-admin/includes/comment.php
+++ b/wp-admin/includes/comment.php
@@ -1,5 +1,15 @@
+ * check_column('wp_links', 'link_description', 'mediumtext');
+ * if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
+ * echo "ok\n";
+ *
+ * $error_count = 0;
+ * $tablename = $wpdb->links;
+ * // check the column
+ * if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) {
+ * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
+ * $q = $wpdb->query($ddl);
+ * }
+ *
+ * if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
+ * $res .= $tablename . ' - ok
';
+ * } else {
+ * $res .= 'There was a problem with ' . $tablename . '
';
+ * ++$error_count;
+ * }
+ *
+ *
+ * @package WordPress
+ * @subpackage Plugins
+ */
/**
- ** maybe_create_table()
- ** Create db table if it doesn't exist.
- ** Returns: true if already exists or on successful completion
- ** false on error
+ * @global bool $wp_only_load_config
+ * @name $wp_only_load_config
+ * @var bool
+ * @since unknown
*/
+$wp_only_load_config = true;
+
+/** Load WordPress Bootstrap */
+require_once(dirname(dirname(__FILE__)).'/wp-load.php');
+
+/**
+ * Turn debugging on or off.
+ * @global bool|int $debug
+ * @name $debug
+ * @var bool|int
+ * @since unknown
+ */
+$debug = 0;
+
if ( ! function_exists('maybe_create_table') ) :
+/**
+ * Create database table, if it doesn't already exist.
+ *
+ * @since unknown
+ * @package WordPress
+ * @subpackage Plugins
+ * @uses $wpdb
+ *
+ * @param string $table_name Database table name.
+ * @param string $create_ddl Create database table SQL.
+ * @return bool False on error, true if already exists or success.
+ */
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
@@ -29,20 +90,29 @@ function maybe_create_table($table_name, $create_ddl) {
}
endif;
-/**
- ** maybe_add_column()
- ** Add column to db table if it doesn't exist.
- ** Returns: true if already exists or on successful completion
- ** false on error
- */
if ( ! function_exists('maybe_add_column') ) :
+/**
+ * Add column to database table, if column doesn't already exist in table.
+ *
+ * @since unknown
+ * @package WordPress
+ * @subpackage Plugins
+ * @uses $wpdb
+ * @uses $debug
+ *
+ * @param string $table_name Database table name
+ * @param string $column_name Table column name
+ * @param string $create_ddl SQL to add column to table.
+ * @return bool False on failure. True, if already exists or was successful.
+ */
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($debug) echo("checking $column == $column_name
");
- if ($column == $column_name) {
- return true;
- }
+
+ if ($column == $column_name) {
+ return true;
+ }
}
//didn't find it try to create it.
$wpdb->query($create_ddl);
@@ -57,10 +127,17 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
endif;
/**
- ** maybe_drop_column()
- ** Drop column from db table if it exists.
- ** Returns: true if it doesn't already exist or on successful drop
- ** false on error
+ * Drop column from database table, if it exists.
+ *
+ * @since unknown
+ * @package WordPress
+ * @subpackage Plugins
+ * @uses $wpdb
+ *
+ * @param string $table_name Table name
+ * @param string $column_name Column name
+ * @param string $drop_ddl SQL statement to drop column.
+ * @return bool False on failure, true on success or doesn't exist.
*/
function maybe_drop_column($table_name, $column_name, $drop_ddl) {
global $wpdb;
@@ -80,20 +157,30 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
return true;
}
-
/**
- ** check_column()
- ** Check column matches passed in criteria.
- ** Pass in null to skip checking that criteria
- ** Returns: true if it matches
- ** false otherwise
- ** (case sensitive) Column names returned from DESC table are:
- ** Field
- ** Type
- ** Null
- ** Key
- ** Default
- ** Extra
+ * Check column matches criteria.
+ *
+ * Uses the SQL DESC for retrieving the table info for the column. It will help
+ * understand the parameters, if you do more research on what column information
+ * is returned by the SQL statement. Pass in null to skip checking that
+ * criteria.
+ *
+ * Column names returned from DESC table are case sensitive and are listed:
+ * Field
+ * Type
+ * Null
+ * Key
+ * Default
+ * Extra
+ *
+ * @param string $table_name Table name
+ * @param string $col_name Column name
+ * @param string $col_type Column type
+ * @param bool $is_null Optional. Check is null.
+ * @param mixed $key Optional. Key info.
+ * @param mixed $default Optional. Default value.
+ * @param mixed $extra Optional. Extra value.
+ * @return bool True, if matches. False, if not matching.
*/
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
global $wpdb, $debug;
@@ -102,55 +189,33 @@ function check_column($table_name, $col_name, $col_type, $is_null = null, $key =
foreach ($results as $row ) {
if ($debug > 1) print_r($row);
- if ($row->Field == $col_name) {
- // got our column, check the params
- if ($debug) echo ("checking $row->Type against $col_type\n");
- if (($col_type != null) && ($row->Type != $col_type)) {
- ++$diffs;
- }
- if (($is_null != null) && ($row->Null != $is_null)) {
- ++$diffs;
- }
- if (($key != null) && ($row->Key != $key)) {
- ++$diffs;
- }
- if (($default != null) && ($row->Default != $default)) {
- ++$diffs;
- }
- if (($extra != null) && ($row->Extra != $extra)) {
- ++$diffs;
- }
- if ($diffs > 0) {
- if ($debug) echo ("diffs = $diffs returning false\n");
- return false;
- }
- return true;
- } // end if found our column
+
+ if ($row->Field == $col_name) {
+ // got our column, check the params
+ if ($debug) echo ("checking $row->Type against $col_type\n");
+ if (($col_type != null) && ($row->Type != $col_type)) {
+ ++$diffs;
+ }
+ if (($is_null != null) && ($row->Null != $is_null)) {
+ ++$diffs;
+ }
+ if (($key != null) && ($row->Key != $key)) {
+ ++$diffs;
+ }
+ if (($default != null) && ($row->Default != $default)) {
+ ++$diffs;
+ }
+ if (($extra != null) && ($row->Extra != $extra)) {
+ ++$diffs;
+ }
+ if ($diffs > 0) {
+ if ($debug) echo ("diffs = $diffs returning false\n");
+ return false;
+ }
+ return true;
+ } // end if found our column
}
return false;
}
-/*
-echo "
testing
"; -echo ""; - -//check_column('wp_links', 'link_description', 'mediumtext'); -//if (check_column($wpdb->comments, 'comment_author', 'tinytext')) -// echo "ok\n"; -$error_count = 0; -$tablename = $wpdb->links; -// check the column -if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) -{ - $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; - $q = $wpdb->query($ddl); -} -if (check_column($wpdb->links, 'link_description', 'varchar(255)')) { - $res .= $tablename . ' - ok"; -*/ ?> diff --git a/wp-admin/install.php b/wp-admin/install.php index 32ef35dc4..97eeb4566 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -1,14 +1,38 @@ diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index c93922bf5..fa9af22fc 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -1,4 +1,12 @@ %s category: this is the default one"), $cat_name)); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php index a2d6e4d56..f0565afa8 100644 --- a/wp-admin/link-import.php +++ b/wp-admin/link-import.php @@ -1,7 +1,14 @@ + * @author Mike Little
'; -} else { - $res .= 'There was a problem with ' . $tablename . '
'; - ++$error_count; -} -echo "