diff --git a/.htaccess b/.htaccess
deleted file mode 100644
index 1427d97fb6..0000000000
--- a/.htaccess
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-# For licensing, see LICENSE.html or http://ckeditor.com/license
-#
-
-#
-# On some specific Linux installations you could face problems with Firefox.
-# It could give you errors when loading the editor saying that some illegal
-# characters were found (three strange chars in the beginning of the file).
-# This could happen if you map the .js or .css files to PHP, for example.
-#
-# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files.
-# All FCKeditor files are Unicode encoded.
-#
-
-AddType application/x-javascript .js
-AddType text/css .css
-
-#
-# If PHP is mapped to handle XML files, you could have some issues. The
-# following will disable it.
-#
-
-AddType text/xml .xml
diff --git a/CHANGES.html b/CHANGES.html
deleted file mode 100644
index 0fc8f68a71..0000000000
--- a/CHANGES.html
+++ /dev/null
@@ -1,1445 +0,0 @@
-
-
-
-
- Changelog — CKEditor
-
-
-
-
-
- CKEditor Changelog
-
-
- CKEditor 3.6.3 (SVN)
-
- New features:
-
-
-
-
- Fixed issues:
-
-
-
-
- CKEditor 3.6.2
-
- New features:
-
-
#6089 : The editor is now enabled on iOS 5 (iPad and iPhone).
-
#7354 : It is now possible to exit from blockquotes by using the Enter key on empty paragraphs.
-
#7931 : The mode event now carries the previous editor mode.
#7991 : Introduce the controlStyle and inputStyle definitions to allow fine-grained controlling of dialog window element styles.
-
-
- Fixed issues:
-
-
#7914 : ATTENTION! The signature for the setReadOnly() function has been changed, reversing the meaning of the parameter to be passed to it. Please make sure to update your code when upgrading.
-
#7657 : Wrong margin mirroring when creating a list from RTL paragraphs.
-
#7620 : A glitch in list pasting from Microsoft Word caused by broken child references when filtering.
-
#7811 : [IE] Deleting table row throws a JavaScript error.
-
#6962 : Changed the CKEDITOR.CTRL, CKEDITOR.SHIFT and CKEDITOR.ALT constant values to avoid collision with any possible Unicode character.
-
#6263 : Some table cell context menu options may be incorrectly disabled.
-
#6247 : Focus is not restored properly after a drop-down menu is closed.
-
#7334 : [IE7] Indentation style does not apply to RTL lists.
-
#6845 : Spaces inside the URL field in the Link dialog window will now be removed.
-
#7840 : [IE] Opening the Table Properties dialog window via the context menu causes a JavaScript error.
-
#7733 : Flash movies inserted with the Flash Properties dialog window are not displaying properly when injected into the page.
-
#7837 : [IE<8] Inserting a page break results in an error.
-
#7804 : The HTML5 wbr tag is now recognized by the editor.
-
#7867 : The file browser for the background image in the Document Properties plugin dialog window does not work.
-
#7130 : The column resizer gripping area is invading adjacent table cells.
-
#7844 : [FF] Calling setData() on a hidden editor caused editor not to display.
-
#7860 : The BBCode plugin was stripping BBCode tags that were not implemented in the plugin, but from now on they will be handled as simple text.
-
#7321 : [IE6] Contents inside the RTL fields in dialog windows are overflowing.
-
#7323 : [IE Quirks] Some fields are not centered in the dialog window.
-
#5955 : Editor accessibility issue with JAWS when a drop-down menu is placed as the first item in the toolbar.
-
#6671 : [FF] Selection of an item from the Styles drop-down list is not refreshed after the style is removed.
-
#7879 : The Style and Height/Width fields of the Table Properties dialog window are not synchronized.
-
#7581 : [IE] The Enter key pressed at the end of a list item containing the start attribute crashes the browser.
-
#7266 : Dialog window fields that did not pass validation are now ARIA-compatible with aria-invalid.
-
#7742 : [WebKit] Indentation, alignment, and language direction are not applied on an empty document without the editor being in focus.
-
#7801 : [Opera] Pasted paragraphs now split partially selected blocks.
-
#6663 : Table caption that contains rich text is corrupted after an edit done with the Table Properties dialog window.
-
#7893 : [WebKit, Opera, IE<8] It is impossible to link to anchors in the document.
-
#7637 : Cursor position might in some cases cause problems after inserting a page break.
-
#5314 : The aria-selected attribute is not removed when toolbar drop-down menu items are deselected.
-
#7749 : Small check introduced to avoid issues with custom data processors and the insertHtml function.
-
#7269 : [WebKit] Paste from Word is including the full file:// URL path for anchor links.
-
#7584 : Start number of the List dialog window now works with numbered list items.
-
#6975 : [IE6, IE7] A definition list crashes Internet Explorer on HTML output.
-
#7841 : Deleting a column with a cell deleted in one of the rows does not work.
-
#7944 : The Enter key should not split or create new paragraphs inside caption elements.
-
#7639 : [IE9] Browser might crash when an object is selected in the document.
-
#7847 : [IE8] Inserting an image with non-secure source in a HTTPS page breaks the dialog window.
-
#7953 : [IE] Text selection lost after the browser context menu is opened.
-
#5239 : Inconsistent focus behavior after closing a toolbar drop-down menu.
-
#6470 : The Start attribute of a Numbered List is rendered incorrectly if the field is left empty.
-
#7324 : [IE6 Quirks] Context menus are not displayed correctly.
-
#7566 : BiDi: Increasing indentation of a list item changes the language direction.
-
#7839 : [IE] Pasting multi-level numbered lists from Microsoft Word does not work properly.
-
#188 : [IE] Object selection was making the toolbar inactive in some situations.
#7044 : New BBCode sample plugin that makes the editor output (one dialect of) BBCode format.
-
#5647 : Accessibility enhancements to the structure of the toolbar.
-
#5647 : The Kama skin now presents separators for the toolbar items, making it easier to group buttons and have a cleaner layout.
-
#5647 : Usability enhancements to keyboard navigation on the toolbar. The Tab key is now used to jump between toolbar groups, while the Arrow keys can be used to cycle within the group. The new toolbarGroupCycling setting can be used to change the Arrow keys behavior.
#3582 : New presentation of anchor elements in the WYSIWYG mode.
-
#6737 : The Format drop-down list will now display the preview of its contents exactly as defined in their style configurations.
-
#6654 : A new autoParagraph configuration setting is added to disable the auto paragraphing feature.
-
#901 : New Stylesheet Parser (stylesheetparser) plugin that fills the Styles drop-down list based on the CSS classes available for the content. Check the new sample to learn how to use it.
-
#2988 : New Document Properties (docprops) plugin that sets the metadata of the page in the Full Page mode.
-
#7240 : New Developer Tools (devtools) plugin that shows information about dialog window UI elements to allow for easier customization.
-
#6841 : Pressing the Enter key at the end of a pre-formatted block will now exit from it.
-
#6850 : The About CKEditor dialog window now contains a link to CKEditor User's Guide.
-
#5745 : Extra configuration options for the iframeDialog can now be passed.
-
#6589 : The onDialogEvent function will now be used automatically in the iframeDialog contents if no callback is used on creation.
#6869 : The data-cke-nostyle attribute (which was introduced for escaping the element from been influenced by the style system since 3.5) is deprecated in favor of the new data-nostyle attribute.
-
Revised sample pages with code examples and clarifications.
-
-
- Fixed issues:
-
-
#5855 : Updating a link multiple times generates wrong href attribute.
-
#6166 : Error on Maximize command, when the toolbar button is not shown.
-
#6607 : Table cell "merge down" and "merge right" commands work only once.
-
#6228 : Merge down does not work, throwing a JavasSript error.
-
#6625 : BIDI: Mixed LTR/RTL direction causes incorrect behavior.
-
#6881 : IFrame capitalization is now consistent throughout labels.
-
#6686 : BIDI: [FF] When we apply explicit language direction to a numbered/bulleted list, the corresponding language direction toolbar icon is not highlighted.
-
#6566 : It is now possible to exit a blockquote using ENTER_BR.
-
#6868 : Partial (invalid) list structure crashes the editor on load.
-
#6804 : Buggy behavior when editing the legend element inside a fieldset.
-
#6724 : [IE7] Nested list display bug on empty list item.
-
#6715 : List items do not create paragraphs after the list placed in a table cell is removed.
-
#6695 : [Webkit] Display bug after the editor is restored from the full screen mode.
-
#6661 : [IE] Pre-formatted style does not preserve applied text direction.
-
#6655 : Using the editor resize grip causes small visual offsets.
-
#6604 : The div element should be used as a formatting block in ENTER_BR.
-
#6249 : BIDI: List item bullets are off viewport with RTL text direction.
-
#6610 : BIDI: ENTER_BR change direction in one line out of multiple.
-
#6872 : [IE] Link target field is not populated properly when no target is set.
-
#6880 : Samples: Added a user-friendly message for users on servers without PHP support.
#6103 : It's now possible to control the styling of inline read-only elements with the disableReadonlyStyling setting. It's also possible to avoid inline-styling any element by setting its "data-cke-nostyle" attribute to "1".
#6099 : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.
-
#6100 : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.
-
#6376 : BIDI: buttons should not toggle the base language direction.
-
#6235 : BIDI: Applying direction to multi-paragraph selection within a div.
-
#6187 : [IE6] Multi-instance loading produces 404s on background images.
-
#5446 : Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links.
-
#5626 : CKeditor 3.2.1 : html content attached makes ckeditor crash the browser FF/IE.
#6118 : Initial focus is now set to the tabs in the table properties dialog.
-
#6135 : The dialogadvtab plugin now uses the correct label.
-
#6125 : Focus was lost after applying commands in Opera.
-
#6137 : The table dialog was missing the default width value on second opening.
-
-
- CKEditor 3.4 Beta
-
- New features:
-
-
#5909 : New BiDi feature, making it possible to switch the base language direction of block elements.
-
#5268 : Introducing the "tableresize" plugin, which makes it possible to resize tables columns by mouse drag. It's not enabled by default, so it must be enabled in the configurations file.
-
#979 : New enableTabKeyTools configuration to allow using the TAB key to navigate through table cells.
-
#4606 : Introduce the "autogrow" plugin, which makes the editor resize automatically, based on the contents size.
#5418 : New "Advanced" tab introduced on the Table Properties dialog. It's based on the new dialogadvtab plugin.
-
#6082 : Introduced the useComputedState setting, making it possible to control whether toolbar features, like alignment and direction, should reflect the "computed" selection states, even when the effective feature value is not applied.
-
-
- Fixed issues:
-
-
#5911 : BiDi: List items should support and retain correct base language direction
-
#5689 : Make it possible to run CKEditor inside of Firefox chrome.
-
#6042 : It wasn't possible to align a paragraph with the dir attribute to the opposite direction.
-
#6058 : Fixed a small style glitch with file upload fields in IE+Quirks.
-
-
- CKEditor 3.3.2
-
- New features:
-
-
#5882 : Introduce the dialog#selectPage event, replicating the OnDialogTabChange feature available in FCKeditor 2.
-
#5927 : The native controls in ui.dialog.elements can be styled with the controlStyle definition.
-
-
- Fixed issues:
-
-
#1644 : Removed references to cursor:hand in the stylesheets.
-
#5411 : Anchor, hidden fields and Page-Break objects can no longer be resized.
-
#5456 : Initial focus incorect in api_dialog sample page.
#5780 : Text selection lost when opening some of the dialogs.
-
#5787 : Liststyle plugin wasn't packaged into the core (CKEDITOR.resourceManager.load exception).
-
#5637 : Fix wrong nesting that generated "<head> must be a child of <html>" warning in Webkit.
-
#5790 : Internal only attributes output on fullpage <html> tag.
-
#5761 : [IE] Color dialog matrix buttons are barely clickable in quirks mode.
-
#5759 : [IE] Clicking on the scrollbar and then on the host page causes error.
-
#5772 : List style dialog is missing tab page ids.
-
#5782 : [FF] Wysiwyg mode is broken by 'display' style changes on editor's parent DOM tree.
-
#5801 : [IE] contentEditable="false" doesn't apply in effect on inline-elements.
-
#5794 : Empty find matching twice results in JavaScript error.
-
#5732 : If it isn't possible to connect to the SCAYT servers the dialogs might hang in Firefox. Fix for Firefox>=3.6.
-
#5807 : [FF2] New page command results in uneditable document.
-
#5807 : [FF2] SCAYT plugin is disabled in Firefox2 due to selection interference.
-
#5772 : [IE] Some numbered list style types are not supported by IE6/7 and causes JavaScript error.
-
-
- CKEditor 3.3
-
- New features:
-
-
#635 : The properties dialog will now open when double clicking on objects.
-
#3893 : It's now possible to indent/outdent lists when selecting the first list item.
-
#4968 : The contentsLangDirection setting now has a default value 'ui' which inherit language direction from the editor UI language.
-
#4649 : The color picker dialog is now accessible.
-
#3593 : The editing area is now enabled by contentEditable="true" instead of designMode="on" to allow creating uneditable content elements in all browsers.
-
#4056 : Hidden fields will now be displayed as fake element just like in FCKeditor 2.
-
-
- CKEditor 3.2.2
-
- New features:
-
-
The SCAYT spell checker is now enabled by default through the autoStartup setting.
#4478 : Enable the SelectAll command in source mode.
-
#5150 : Allow names in the CKEDITOR.config.colorButton_colors setting.
-
#4810 : Adding configuration option for image dialog preview area filling text.
-
#536 : Object style now could be applied on any parent element of current selection.
-
#5290 : Unified stylesSet loading removing dependencies from the styles combo.
- Now the configuration entry is named 'config.stylesSet' instead of config.stylesCombo_stylesSet and the default location
- is under the 'styles' plugin instead of 'stylescombo'.
-
#5352 : Allow to define the stylesSet array in the config object for the editor.
- CKEditor is a text editor to be used inside web pages. It's not a replacement
- for desktop text editors like Word or OpenOffice, but a component to be used as
- part of web applications and web sites.
-
- Installation
-
- Installing CKEditor is an easy task. Just follow these simple steps:
-
-
Download the latest version of the editor from our web site: http://ckeditor.com. You should have already completed
- this step, but be sure you have the very latest version.
-
Extract (decompress) the downloaded file into the root of your
- web site.
-
-
- Note: CKEditor is by default installed in the "ckeditor"
- folder. You can place the files in whichever you want though.
-
- Checking Your Installation
-
-
- The editor comes with a few sample pages that can be used to verify that installation
- proceeded properly. Take a look at the _samples directory.
-
- To test your installation, just call the following page at your web site:
- You are not required to, but if you want to explicitly declare the license you have
- chosen to be bound to when using, reproducing, modifying and distributing this software,
- just include a text file titled "LEGAL" in your version of this software, indicating
- your license choice. In any case, your choice will not restrict any recipient of
- your version of this software to use, reproduce, modify and distribute this software
- under any of the above licenses.
-
-
- Sources of Intellectual Property Included in CKEditor
-
-
- Where not otherwise indicated, all CKEditor content is authored by CKSource engineers
- and consists of CKSource-owned intellectual property. In some specific instances,
- CKEditor will incorporate work done by developers outside of CKSource with their
- express permission.
-
- CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product
- names are trademarks, registered trademarks or service marks of their respective
- holders.
-
-
-
diff --git a/_dev/_thirdparty/console_getopt/Getopt.php b/_dev/_thirdparty/console_getopt/Getopt.php
deleted file mode 100644
index 41a87bbb75..0000000000
--- a/_dev/_thirdparty/console_getopt/Getopt.php
+++ /dev/null
@@ -1,290 +0,0 @@
- |
-// +----------------------------------------------------------------------+
-//
-// $Id: Getopt.php,v 1.4 2007/06/12 14:58:56 cellog Exp $
-
-require_once 'PEAR.php';
-
-/**
- * Command-line options parsing class.
- *
- * @author Andrei Zmievski
- *
- */
-class Console_Getopt {
- /**
- * Parses the command-line options.
- *
- * The first parameter to this function should be the list of command-line
- * arguments without the leading reference to the running program.
- *
- * The second parameter is a string of allowed short options. Each of the
- * option letters can be followed by a colon ':' to specify that the option
- * requires an argument, or a double colon '::' to specify that the option
- * takes an optional argument.
- *
- * The third argument is an optional array of allowed long options. The
- * leading '--' should not be included in the option name. Options that
- * require an argument should be followed by '=', and options that take an
- * option argument should be followed by '=='.
- *
- * The return value is an array of two elements: the list of parsed
- * options and the list of non-option command-line arguments. Each entry in
- * the list of parsed options is a pair of elements - the first one
- * specifies the option, and the second one specifies the option argument,
- * if there was one.
- *
- * Long and short options can be mixed.
- *
- * Most of the semantics of this function are based on GNU getopt_long().
- *
- * @param array $args an array of command-line arguments
- * @param string $short_options specifies the list of allowed short options
- * @param array $long_options specifies the list of allowed long options
- *
- * @return array two-element array containing the list of parsed options and
- * the non-option arguments
- *
- * @access public
- *
- */
- function getopt2($args, $short_options, $long_options = null)
- {
- return Console_Getopt::doGetopt(2, $args, $short_options, $long_options);
- }
-
- /**
- * This function expects $args to start with the script name (POSIX-style).
- * Preserved for backwards compatibility.
- * @see getopt2()
- */
- function getopt($args, $short_options, $long_options = null)
- {
- return Console_Getopt::doGetopt(1, $args, $short_options, $long_options);
- }
-
- /**
- * The actual implementation of the argument parsing code.
- */
- function doGetopt($version, $args, $short_options, $long_options = null)
- {
- // in case you pass directly readPHPArgv() as the first arg
- if (PEAR::isError($args)) {
- return $args;
- }
- if (empty($args)) {
- return array(array(), array());
- }
- $opts = array();
- $non_opts = array();
-
- settype($args, 'array');
-
- if ($long_options) {
- sort($long_options);
- }
-
- /*
- * Preserve backwards compatibility with callers that relied on
- * erroneous POSIX fix.
- */
- if ($version < 2) {
- if (isset($args[0]{0}) && $args[0]{0} != '-') {
- array_shift($args);
- }
- }
-
- reset($args);
- while (list($i, $arg) = each($args)) {
-
- /* The special element '--' means explicit end of
- options. Treat the rest of the arguments as non-options
- and end the loop. */
- if ($arg == '--') {
- $non_opts = array_merge($non_opts, array_slice($args, $i + 1));
- break;
- }
-
- if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
- $non_opts = array_merge($non_opts, array_slice($args, $i));
- break;
- } elseif (strlen($arg) > 1 && $arg{1} == '-') {
- $error = Console_Getopt::_parseLongOption(substr($arg, 2), $long_options, $opts, $args);
- if (PEAR::isError($error))
- return $error;
- } elseif ($arg == '-') {
- // - is stdin
- $non_opts = array_merge($non_opts, array_slice($args, $i));
- break;
- } else {
- $error = Console_Getopt::_parseShortOption(substr($arg, 1), $short_options, $opts, $args);
- if (PEAR::isError($error))
- return $error;
- }
- }
-
- return array($opts, $non_opts);
- }
-
- /**
- * @access private
- *
- */
- function _parseShortOption($arg, $short_options, &$opts, &$args)
- {
- for ($i = 0; $i < strlen($arg); $i++) {
- $opt = $arg{$i};
- $opt_arg = null;
-
- /* Try to find the short option in the specifier string. */
- if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':')
- {
- return PEAR::raiseError("Console_Getopt: unrecognized option -- $opt");
- }
-
- if (strlen($spec) > 1 && $spec{1} == ':') {
- if (strlen($spec) > 2 && $spec{2} == ':') {
- if ($i + 1 < strlen($arg)) {
- /* Option takes an optional argument. Use the remainder of
- the arg string if there is anything left. */
- $opts[] = array($opt, substr($arg, $i + 1));
- break;
- }
- } else {
- /* Option requires an argument. Use the remainder of the arg
- string if there is anything left. */
- if ($i + 1 < strlen($arg)) {
- $opts[] = array($opt, substr($arg, $i + 1));
- break;
- } else if (list(, $opt_arg) = each($args)) {
- /* Else use the next argument. */;
- if (Console_Getopt::_isShortOpt($opt_arg) || Console_Getopt::_isLongOpt($opt_arg)) {
- return PEAR::raiseError("Console_Getopt: option requires an argument -- $opt");
- }
- } else {
- return PEAR::raiseError("Console_Getopt: option requires an argument -- $opt");
- }
- }
- }
-
- $opts[] = array($opt, $opt_arg);
- }
- }
-
- /**
- * @access private
- *
- */
- function _isShortOpt($arg)
- {
- return strlen($arg) == 2 && $arg[0] == '-' && preg_match('/[a-zA-Z]/', $arg[1]);
- }
-
- /**
- * @access private
- *
- */
- function _isLongOpt($arg)
- {
- return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
- preg_match('/[a-zA-Z]+$/', substr($arg, 2));
- }
-
- /**
- * @access private
- *
- */
- function _parseLongOption($arg, $long_options, &$opts, &$args)
- {
- @list($opt, $opt_arg) = explode('=', $arg, 2);
- $opt_len = strlen($opt);
-
- for ($i = 0; $i < count($long_options); $i++) {
- $long_opt = $long_options[$i];
- $opt_start = substr($long_opt, 0, $opt_len);
- $long_opt_name = str_replace('=', '', $long_opt);
-
- /* Option doesn't match. Go on to the next one. */
- if ($long_opt_name != $opt) {
- continue;
- }
-
- $opt_rest = substr($long_opt, $opt_len);
-
- /* Check that the options uniquely matches one of the allowed
- options. */
- if ($i + 1 < count($long_options)) {
- $next_option_rest = substr($long_options[$i + 1], $opt_len);
- } else {
- $next_option_rest = '';
- }
- if ($opt_rest != '' && $opt{0} != '=' &&
- $i + 1 < count($long_options) &&
- $opt == substr($long_options[$i+1], 0, $opt_len) &&
- $next_option_rest != '' &&
- $next_option_rest{0} != '=') {
- return PEAR::raiseError("Console_Getopt: option --$opt is ambiguous");
- }
-
- if (substr($long_opt, -1) == '=') {
- if (substr($long_opt, -2) != '==') {
- /* Long option requires an argument.
- Take the next argument if one wasn't specified. */;
- if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) {
- return PEAR::raiseError("Console_Getopt: option --$opt requires an argument");
- }
- if (Console_Getopt::_isShortOpt($opt_arg) || Console_Getopt::_isLongOpt($opt_arg)) {
- return PEAR::raiseError("Console_Getopt: option requires an argument --$opt");
- }
- }
- } else if ($opt_arg) {
- return PEAR::raiseError("Console_Getopt: option --$opt doesn't allow an argument");
- }
-
- $opts[] = array('--' . $opt, $opt_arg);
- return;
- }
-
- return PEAR::raiseError("Console_Getopt: unrecognized option --$opt");
- }
-
- /**
- * Safely read the $argv PHP array across different PHP configurations.
- * Will take care on register_globals and register_argc_argv ini directives
- *
- * @access public
- * @return mixed the $argv PHP array or PEAR error if not registered
- */
- function readPHPArgv()
- {
- global $argv;
- if (!is_array($argv)) {
- if (!@is_array($_SERVER['argv'])) {
- if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
- return PEAR::raiseError("Console_Getopt: Could not read cmd args (register_argc_argv=Off?)");
- }
- return $GLOBALS['HTTP_SERVER_VARS']['argv'];
- }
- return $_SERVER['argv'];
- }
- return $argv;
- }
-
-}
-
-?>
diff --git a/_dev/_thirdparty/console_getopt/PEAR.php b/_dev/_thirdparty/console_getopt/PEAR.php
deleted file mode 100644
index 1eb990bac1..0000000000
--- a/_dev/_thirdparty/console_getopt/PEAR.php
+++ /dev/null
@@ -1,1118 +0,0 @@
-
- * @author Stig Bakken
- * @author Tomas V.V.Cox
- * @author Greg Beaver
- * @copyright 1997-2008 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: PEAR.php,v 1.104 2008/01/03 20:26:34 cellog Exp $
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 0.1
- */
-
-/**#@+
- * ERROR constants
- */
-define('PEAR_ERROR_RETURN', 1);
-define('PEAR_ERROR_PRINT', 2);
-define('PEAR_ERROR_TRIGGER', 4);
-define('PEAR_ERROR_DIE', 8);
-define('PEAR_ERROR_CALLBACK', 16);
-/**
- * WARNING: obsolete
- * @deprecated
- */
-define('PEAR_ERROR_EXCEPTION', 32);
-/**#@-*/
-define('PEAR_ZE2', (function_exists('version_compare') &&
- version_compare(zend_version(), "2-dev", "ge")));
-
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- define('OS_WINDOWS', true);
- define('OS_UNIX', false);
- define('PEAR_OS', 'Windows');
-} else {
- define('OS_WINDOWS', false);
- define('OS_UNIX', true);
- define('PEAR_OS', 'Unix'); // blatant assumption
-}
-
-// instant backwards compatibility
-if (!defined('PATH_SEPARATOR')) {
- if (OS_WINDOWS) {
- define('PATH_SEPARATOR', ';');
- } else {
- define('PATH_SEPARATOR', ':');
- }
-}
-
-$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
-$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
-$GLOBALS['_PEAR_destructor_object_list'] = array();
-$GLOBALS['_PEAR_shutdown_funcs'] = array();
-$GLOBALS['_PEAR_error_handler_stack'] = array();
-
-@ini_set('track_errors', true);
-
-/**
- * Base class for other PEAR classes. Provides rudimentary
- * emulation of destructors.
- *
- * If you want a destructor in your class, inherit PEAR and make a
- * destructor method called _yourclassname (same name as the
- * constructor, but with a "_" prefix). Also, in your constructor you
- * have to call the PEAR constructor: $this->PEAR();.
- * The destructor method will be called without parameters. Note that
- * at in some SAPI implementations (such as Apache), any output during
- * the request shutdown (in which destructors are called) seems to be
- * discarded. If you need to get any debug information from your
- * destructor, use error_log(), syslog() or something similar.
- *
- * IMPORTANT! To use the emulated destructors you need to create the
- * objects by reference: $obj =& new PEAR_child;
- *
- * @category pear
- * @package PEAR
- * @author Stig Bakken
- * @author Tomas V.V. Cox
- * @author Greg Beaver
- * @copyright 1997-2006 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.7.1
- * @link http://pear.php.net/package/PEAR
- * @see PEAR_Error
- * @since Class available since PHP 4.0.2
- * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
- */
-class PEAR
-{
- // {{{ properties
-
- /**
- * Whether to enable internal debug messages.
- *
- * @var bool
- * @access private
- */
- var $_debug = false;
-
- /**
- * Default error mode for this object.
- *
- * @var int
- * @access private
- */
- var $_default_error_mode = null;
-
- /**
- * Default error options used for this object when error mode
- * is PEAR_ERROR_TRIGGER.
- *
- * @var int
- * @access private
- */
- var $_default_error_options = null;
-
- /**
- * Default error handler (callback) for this object, if error mode is
- * PEAR_ERROR_CALLBACK.
- *
- * @var string
- * @access private
- */
- var $_default_error_handler = '';
-
- /**
- * Which class to use for error objects.
- *
- * @var string
- * @access private
- */
- var $_error_class = 'PEAR_Error';
-
- /**
- * An array of expected errors.
- *
- * @var array
- * @access private
- */
- var $_expected_errors = array();
-
- // }}}
-
- // {{{ constructor
-
- /**
- * Constructor. Registers this object in
- * $_PEAR_destructor_object_list for destructor emulation if a
- * destructor object exists.
- *
- * @param string $error_class (optional) which class to use for
- * error objects, defaults to PEAR_Error.
- * @access public
- * @return void
- */
- function PEAR($error_class = null)
- {
- $classname = strtolower(get_class($this));
- if ($this->_debug) {
- print "PEAR constructor called, class=$classname\n";
- }
- if ($error_class !== null) {
- $this->_error_class = $error_class;
- }
- while ($classname && strcasecmp($classname, "pear")) {
- $destructor = "_$classname";
- if (method_exists($this, $destructor)) {
- global $_PEAR_destructor_object_list;
- $_PEAR_destructor_object_list[] = &$this;
- if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
- register_shutdown_function("_PEAR_call_destructors");
- $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
- }
- break;
- } else {
- $classname = get_parent_class($classname);
- }
- }
- }
-
- // }}}
- // {{{ destructor
-
- /**
- * Destructor (the emulated type of...). Does nothing right now,
- * but is included for forward compatibility, so subclass
- * destructors should always call it.
- *
- * See the note in the class desciption about output from
- * destructors.
- *
- * @access public
- * @return void
- */
- function _PEAR() {
- if ($this->_debug) {
- printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
- }
- }
-
- // }}}
- // {{{ getStaticProperty()
-
- /**
- * If you have a class that's mostly/entirely static, and you need static
- * properties, you can use this method to simulate them. Eg. in your method(s)
- * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
- * You MUST use a reference, or they will not persist!
- *
- * @access public
- * @param string $class The calling classname, to prevent clashes
- * @param string $var The variable to retrieve.
- * @return mixed A reference to the variable. If not set it will be
- * auto initialised to NULL.
- */
- function &getStaticProperty($class, $var)
- {
- static $properties;
- if (!isset($properties[$class])) {
- $properties[$class] = array();
- }
- if (!array_key_exists($var, $properties[$class])) {
- $properties[$class][$var] = null;
- }
- return $properties[$class][$var];
- }
-
- // }}}
- // {{{ registerShutdownFunc()
-
- /**
- * Use this function to register a shutdown method for static
- * classes.
- *
- * @access public
- * @param mixed $func The function name (or array of class/method) to call
- * @param mixed $args The arguments to pass to the function
- * @return void
- */
- function registerShutdownFunc($func, $args = array())
- {
- // if we are called statically, there is a potential
- // that no shutdown func is registered. Bug #6445
- if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
- register_shutdown_function("_PEAR_call_destructors");
- $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
- }
- $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
- }
-
- // }}}
- // {{{ isError()
-
- /**
- * Tell whether a value is a PEAR error.
- *
- * @param mixed $data the value to test
- * @param int $code if $data is an error object, return true
- * only if $code is a string and
- * $obj->getMessage() == $code or
- * $code is an integer and $obj->getCode() == $code
- * @access public
- * @return bool true if parameter is an error
- */
- function isError($data, $code = null)
- {
- if (is_a($data, 'PEAR_Error')) {
- if (is_null($code)) {
- return true;
- } elseif (is_string($code)) {
- return $data->getMessage() == $code;
- } else {
- return $data->getCode() == $code;
- }
- }
- return false;
- }
-
- // }}}
- // {{{ setErrorHandling()
-
- /**
- * Sets how errors generated by this object should be handled.
- * Can be invoked both in objects and statically. If called
- * statically, setErrorHandling sets the default behaviour for all
- * PEAR objects. If called in an object, setErrorHandling sets
- * the default behaviour for that object.
- *
- * @param int $mode
- * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
- * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
- * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
- *
- * @param mixed $options
- * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
- * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
- *
- * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
- * to be the callback function or method. A callback
- * function is a string with the name of the function, a
- * callback method is an array of two elements: the element
- * at index 0 is the object, and the element at index 1 is
- * the name of the method to call in the object.
- *
- * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
- * a printf format string used when printing the error
- * message.
- *
- * @access public
- * @return void
- * @see PEAR_ERROR_RETURN
- * @see PEAR_ERROR_PRINT
- * @see PEAR_ERROR_TRIGGER
- * @see PEAR_ERROR_DIE
- * @see PEAR_ERROR_CALLBACK
- * @see PEAR_ERROR_EXCEPTION
- *
- * @since PHP 4.0.5
- */
-
- function setErrorHandling($mode = null, $options = null)
- {
- if (isset($this) && is_a($this, 'PEAR')) {
- $setmode = &$this->_default_error_mode;
- $setoptions = &$this->_default_error_options;
- } else {
- $setmode = &$GLOBALS['_PEAR_default_error_mode'];
- $setoptions = &$GLOBALS['_PEAR_default_error_options'];
- }
-
- switch ($mode) {
- case PEAR_ERROR_EXCEPTION:
- case PEAR_ERROR_RETURN:
- case PEAR_ERROR_PRINT:
- case PEAR_ERROR_TRIGGER:
- case PEAR_ERROR_DIE:
- case null:
- $setmode = $mode;
- $setoptions = $options;
- break;
-
- case PEAR_ERROR_CALLBACK:
- $setmode = $mode;
- // class/object method callback
- if (is_callable($options)) {
- $setoptions = $options;
- } else {
- trigger_error("invalid error callback", E_USER_WARNING);
- }
- break;
-
- default:
- trigger_error("invalid error mode", E_USER_WARNING);
- break;
- }
- }
-
- // }}}
- // {{{ expectError()
-
- /**
- * This method is used to tell which errors you expect to get.
- * Expected errors are always returned with error mode
- * PEAR_ERROR_RETURN. Expected error codes are stored in a stack,
- * and this method pushes a new element onto it. The list of
- * expected errors are in effect until they are popped off the
- * stack with the popExpect() method.
- *
- * Note that this method can not be called statically
- *
- * @param mixed $code a single error code or an array of error codes to expect
- *
- * @return int the new depth of the "expected errors" stack
- * @access public
- */
- function expectError($code = '*')
- {
- if (is_array($code)) {
- array_push($this->_expected_errors, $code);
- } else {
- array_push($this->_expected_errors, array($code));
- }
- return sizeof($this->_expected_errors);
- }
-
- // }}}
- // {{{ popExpect()
-
- /**
- * This method pops one element off the expected error codes
- * stack.
- *
- * @return array the list of error codes that were popped
- */
- function popExpect()
- {
- return array_pop($this->_expected_errors);
- }
-
- // }}}
- // {{{ _checkDelExpect()
-
- /**
- * This method checks unsets an error code if available
- *
- * @param mixed error code
- * @return bool true if the error code was unset, false otherwise
- * @access private
- * @since PHP 4.3.0
- */
- function _checkDelExpect($error_code)
- {
- $deleted = false;
-
- foreach ($this->_expected_errors AS $key => $error_array) {
- if (in_array($error_code, $error_array)) {
- unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
- $deleted = true;
- }
-
- // clean up empty arrays
- if (0 == count($this->_expected_errors[$key])) {
- unset($this->_expected_errors[$key]);
- }
- }
- return $deleted;
- }
-
- // }}}
- // {{{ delExpect()
-
- /**
- * This method deletes all occurences of the specified element from
- * the expected error codes stack.
- *
- * @param mixed $error_code error code that should be deleted
- * @return mixed list of error codes that were deleted or error
- * @access public
- * @since PHP 4.3.0
- */
- function delExpect($error_code)
- {
- $deleted = false;
-
- if ((is_array($error_code) && (0 != count($error_code)))) {
- // $error_code is a non-empty array here;
- // we walk through it trying to unset all
- // values
- foreach($error_code as $key => $error) {
- if ($this->_checkDelExpect($error)) {
- $deleted = true;
- } else {
- $deleted = false;
- }
- }
- return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
- } elseif (!empty($error_code)) {
- // $error_code comes alone, trying to unset it
- if ($this->_checkDelExpect($error_code)) {
- return true;
- } else {
- return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
- }
- } else {
- // $error_code is empty
- return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
- }
- }
-
- // }}}
- // {{{ raiseError()
-
- /**
- * This method is a wrapper that returns an instance of the
- * configured error class with this object's default error
- * handling applied. If the $mode and $options parameters are not
- * specified, the object's defaults are used.
- *
- * @param mixed $message a text error message or a PEAR error object
- *
- * @param int $code a numeric error code (it is up to your class
- * to define these if you want to use codes)
- *
- * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
- * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
- * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
- *
- * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
- * specifies the PHP-internal error level (one of
- * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
- * If $mode is PEAR_ERROR_CALLBACK, this
- * parameter specifies the callback function or
- * method. In other error modes this parameter
- * is ignored.
- *
- * @param string $userinfo If you need to pass along for example debug
- * information, this parameter is meant for that.
- *
- * @param string $error_class The returned error object will be
- * instantiated from this class, if specified.
- *
- * @param bool $skipmsg If true, raiseError will only pass error codes,
- * the error message parameter will be dropped.
- *
- * @access public
- * @return object a PEAR error object
- * @see PEAR::setErrorHandling
- * @since PHP 4.0.5
- */
- function &raiseError($message = null,
- $code = null,
- $mode = null,
- $options = null,
- $userinfo = null,
- $error_class = null,
- $skipmsg = false)
- {
- // The error is yet a PEAR error object
- if (is_object($message)) {
- $code = $message->getCode();
- $userinfo = $message->getUserInfo();
- $error_class = $message->getType();
- $message->error_message_prefix = '';
- $message = $message->getMessage();
- }
-
- if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
- if ($exp[0] == "*" ||
- (is_int(reset($exp)) && in_array($code, $exp)) ||
- (is_string(reset($exp)) && in_array($message, $exp))) {
- $mode = PEAR_ERROR_RETURN;
- }
- }
- // No mode given, try global ones
- if ($mode === null) {
- // Class error handler
- if (isset($this) && isset($this->_default_error_mode)) {
- $mode = $this->_default_error_mode;
- $options = $this->_default_error_options;
- // Global error handler
- } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
- $mode = $GLOBALS['_PEAR_default_error_mode'];
- $options = $GLOBALS['_PEAR_default_error_options'];
- }
- }
-
- if ($error_class !== null) {
- $ec = $error_class;
- } elseif (isset($this) && isset($this->_error_class)) {
- $ec = $this->_error_class;
- } else {
- $ec = 'PEAR_Error';
- }
- if (intval(PHP_VERSION) < 5) {
- // little non-eval hack to fix bug #12147
- include 'PEAR/FixPHP5PEARWarnings.php';
- return $a;
- }
- if ($skipmsg) {
- $a = new $ec($code, $mode, $options, $userinfo);
- } else {
- $a = new $ec($message, $code, $mode, $options, $userinfo);
- }
- return $a;
- }
-
- // }}}
- // {{{ throwError()
-
- /**
- * Simpler form of raiseError with fewer options. In most cases
- * message, code and userinfo are enough.
- *
- * @param string $message
- *
- */
- function &throwError($message = null,
- $code = null,
- $userinfo = null)
- {
- if (isset($this) && is_a($this, 'PEAR')) {
- $a = &$this->raiseError($message, $code, null, null, $userinfo);
- return $a;
- } else {
- $a = &PEAR::raiseError($message, $code, null, null, $userinfo);
- return $a;
- }
- }
-
- // }}}
- function staticPushErrorHandling($mode, $options = null)
- {
- $stack = &$GLOBALS['_PEAR_error_handler_stack'];
- $def_mode = &$GLOBALS['_PEAR_default_error_mode'];
- $def_options = &$GLOBALS['_PEAR_default_error_options'];
- $stack[] = array($def_mode, $def_options);
- switch ($mode) {
- case PEAR_ERROR_EXCEPTION:
- case PEAR_ERROR_RETURN:
- case PEAR_ERROR_PRINT:
- case PEAR_ERROR_TRIGGER:
- case PEAR_ERROR_DIE:
- case null:
- $def_mode = $mode;
- $def_options = $options;
- break;
-
- case PEAR_ERROR_CALLBACK:
- $def_mode = $mode;
- // class/object method callback
- if (is_callable($options)) {
- $def_options = $options;
- } else {
- trigger_error("invalid error callback", E_USER_WARNING);
- }
- break;
-
- default:
- trigger_error("invalid error mode", E_USER_WARNING);
- break;
- }
- $stack[] = array($mode, $options);
- return true;
- }
-
- function staticPopErrorHandling()
- {
- $stack = &$GLOBALS['_PEAR_error_handler_stack'];
- $setmode = &$GLOBALS['_PEAR_default_error_mode'];
- $setoptions = &$GLOBALS['_PEAR_default_error_options'];
- array_pop($stack);
- list($mode, $options) = $stack[sizeof($stack) - 1];
- array_pop($stack);
- switch ($mode) {
- case PEAR_ERROR_EXCEPTION:
- case PEAR_ERROR_RETURN:
- case PEAR_ERROR_PRINT:
- case PEAR_ERROR_TRIGGER:
- case PEAR_ERROR_DIE:
- case null:
- $setmode = $mode;
- $setoptions = $options;
- break;
-
- case PEAR_ERROR_CALLBACK:
- $setmode = $mode;
- // class/object method callback
- if (is_callable($options)) {
- $setoptions = $options;
- } else {
- trigger_error("invalid error callback", E_USER_WARNING);
- }
- break;
-
- default:
- trigger_error("invalid error mode", E_USER_WARNING);
- break;
- }
- return true;
- }
-
- // {{{ pushErrorHandling()
-
- /**
- * Push a new error handler on top of the error handler options stack. With this
- * you can easily override the actual error handler for some code and restore
- * it later with popErrorHandling.
- *
- * @param mixed $mode (same as setErrorHandling)
- * @param mixed $options (same as setErrorHandling)
- *
- * @return bool Always true
- *
- * @see PEAR::setErrorHandling
- */
- function pushErrorHandling($mode, $options = null)
- {
- $stack = &$GLOBALS['_PEAR_error_handler_stack'];
- if (isset($this) && is_a($this, 'PEAR')) {
- $def_mode = &$this->_default_error_mode;
- $def_options = &$this->_default_error_options;
- } else {
- $def_mode = &$GLOBALS['_PEAR_default_error_mode'];
- $def_options = &$GLOBALS['_PEAR_default_error_options'];
- }
- $stack[] = array($def_mode, $def_options);
-
- if (isset($this) && is_a($this, 'PEAR')) {
- $this->setErrorHandling($mode, $options);
- } else {
- PEAR::setErrorHandling($mode, $options);
- }
- $stack[] = array($mode, $options);
- return true;
- }
-
- // }}}
- // {{{ popErrorHandling()
-
- /**
- * Pop the last error handler used
- *
- * @return bool Always true
- *
- * @see PEAR::pushErrorHandling
- */
- function popErrorHandling()
- {
- $stack = &$GLOBALS['_PEAR_error_handler_stack'];
- array_pop($stack);
- list($mode, $options) = $stack[sizeof($stack) - 1];
- array_pop($stack);
- if (isset($this) && is_a($this, 'PEAR')) {
- $this->setErrorHandling($mode, $options);
- } else {
- PEAR::setErrorHandling($mode, $options);
- }
- return true;
- }
-
- // }}}
- // {{{ loadExtension()
-
- /**
- * OS independant PHP extension load. Remember to take care
- * on the correct extension name for case sensitive OSes.
- *
- * @param string $ext The extension name
- * @return bool Success or not on the dl() call
- */
- function loadExtension($ext)
- {
- if (!extension_loaded($ext)) {
- // if either returns true dl() will produce a FATAL error, stop that
- if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
- return false;
- }
- if (OS_WINDOWS) {
- $suffix = '.dll';
- } elseif (PHP_OS == 'HP-UX') {
- $suffix = '.sl';
- } elseif (PHP_OS == 'AIX') {
- $suffix = '.a';
- } elseif (PHP_OS == 'OSX') {
- $suffix = '.bundle';
- } else {
- $suffix = '.so';
- }
- return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
- }
- return true;
- }
-
- // }}}
-}
-
-// {{{ _PEAR_call_destructors()
-
-function _PEAR_call_destructors()
-{
- global $_PEAR_destructor_object_list;
- if (is_array($_PEAR_destructor_object_list) &&
- sizeof($_PEAR_destructor_object_list))
- {
- reset($_PEAR_destructor_object_list);
- if (PEAR::getStaticProperty('PEAR', 'destructlifo')) {
- $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
- }
- while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
- $classname = get_class($objref);
- while ($classname) {
- $destructor = "_$classname";
- if (method_exists($objref, $destructor)) {
- $objref->$destructor();
- break;
- } else {
- $classname = get_parent_class($classname);
- }
- }
- }
- // Empty the object list to ensure that destructors are
- // not called more than once.
- $_PEAR_destructor_object_list = array();
- }
-
- // Now call the shutdown functions
- if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
- foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
- call_user_func_array($value[0], $value[1]);
- }
- }
-}
-
-// }}}
-/**
- * Standard PEAR error class for PHP 4
- *
- * This class is supserseded by {@link PEAR_Exception} in PHP 5
- *
- * @category pear
- * @package PEAR
- * @author Stig Bakken
- * @author Tomas V.V. Cox
- * @author Gregory Beaver
- * @copyright 1997-2006 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.7.1
- * @link http://pear.php.net/manual/en/core.pear.pear-error.php
- * @see PEAR::raiseError(), PEAR::throwError()
- * @since Class available since PHP 4.0.2
- */
-class PEAR_Error
-{
- // {{{ properties
-
- var $error_message_prefix = '';
- var $mode = PEAR_ERROR_RETURN;
- var $level = E_USER_NOTICE;
- var $code = -1;
- var $message = '';
- var $userinfo = '';
- var $backtrace = null;
-
- // }}}
- // {{{ constructor
-
- /**
- * PEAR_Error constructor
- *
- * @param string $message message
- *
- * @param int $code (optional) error code
- *
- * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN,
- * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
- * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
- *
- * @param mixed $options (optional) error level, _OR_ in the case of
- * PEAR_ERROR_CALLBACK, the callback function or object/method
- * tuple.
- *
- * @param string $userinfo (optional) additional user/debug info
- *
- * @access public
- *
- */
- function PEAR_Error($message = 'unknown error', $code = null,
- $mode = null, $options = null, $userinfo = null)
- {
- if ($mode === null) {
- $mode = PEAR_ERROR_RETURN;
- }
- $this->message = $message;
- $this->code = $code;
- $this->mode = $mode;
- $this->userinfo = $userinfo;
- if (!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
- $this->backtrace = debug_backtrace();
- if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
- unset($this->backtrace[0]['object']);
- }
- }
- if ($mode & PEAR_ERROR_CALLBACK) {
- $this->level = E_USER_NOTICE;
- $this->callback = $options;
- } else {
- if ($options === null) {
- $options = E_USER_NOTICE;
- }
- $this->level = $options;
- $this->callback = null;
- }
- if ($this->mode & PEAR_ERROR_PRINT) {
- if (is_null($options) || is_int($options)) {
- $format = "%s";
- } else {
- $format = $options;
- }
- printf($format, $this->getMessage());
- }
- if ($this->mode & PEAR_ERROR_TRIGGER) {
- trigger_error($this->getMessage(), $this->level);
- }
- if ($this->mode & PEAR_ERROR_DIE) {
- $msg = $this->getMessage();
- if (is_null($options) || is_int($options)) {
- $format = "%s";
- if (substr($msg, -1) != "\n") {
- $msg .= "\n";
- }
- } else {
- $format = $options;
- }
- die(sprintf($format, $msg));
- }
- if ($this->mode & PEAR_ERROR_CALLBACK) {
- if (is_callable($this->callback)) {
- call_user_func($this->callback, $this);
- }
- }
- if ($this->mode & PEAR_ERROR_EXCEPTION) {
- trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
- eval('$e = new Exception($this->message, $this->code);throw($e);');
- }
- }
-
- // }}}
- // {{{ getMode()
-
- /**
- * Get the error mode from an error object.
- *
- * @return int error mode
- * @access public
- */
- function getMode() {
- return $this->mode;
- }
-
- // }}}
- // {{{ getCallback()
-
- /**
- * Get the callback function/method from an error object.
- *
- * @return mixed callback function or object/method array
- * @access public
- */
- function getCallback() {
- return $this->callback;
- }
-
- // }}}
- // {{{ getMessage()
-
-
- /**
- * Get the error message from an error object.
- *
- * @return string full error message
- * @access public
- */
- function getMessage()
- {
- return ($this->error_message_prefix . $this->message);
- }
-
-
- // }}}
- // {{{ getCode()
-
- /**
- * Get error code from an error object
- *
- * @return int error code
- * @access public
- */
- function getCode()
- {
- return $this->code;
- }
-
- // }}}
- // {{{ getType()
-
- /**
- * Get the name of this error/exception.
- *
- * @return string error/exception name (type)
- * @access public
- */
- function getType()
- {
- return get_class($this);
- }
-
- // }}}
- // {{{ getUserInfo()
-
- /**
- * Get additional user-supplied information.
- *
- * @return string user-supplied information
- * @access public
- */
- function getUserInfo()
- {
- return $this->userinfo;
- }
-
- // }}}
- // {{{ getDebugInfo()
-
- /**
- * Get additional debug information supplied by the application.
- *
- * @return string debug information
- * @access public
- */
- function getDebugInfo()
- {
- return $this->getUserInfo();
- }
-
- // }}}
- // {{{ getBacktrace()
-
- /**
- * Get the call backtrace from where the error was generated.
- * Supported with PHP 4.3.0 or newer.
- *
- * @param int $frame (optional) what frame to fetch
- * @return array Backtrace, or NULL if not available.
- * @access public
- */
- function getBacktrace($frame = null)
- {
- if (defined('PEAR_IGNORE_BACKTRACE')) {
- return null;
- }
- if ($frame === null) {
- return $this->backtrace;
- }
- return $this->backtrace[$frame];
- }
-
- // }}}
- // {{{ addUserInfo()
-
- function addUserInfo($info)
- {
- if (empty($this->userinfo)) {
- $this->userinfo = $info;
- } else {
- $this->userinfo .= " ** $info";
- }
- }
-
- // }}}
- // {{{ toString()
- function __toString()
- {
- return $this->getMessage();
- }
- // }}}
- // {{{ toString()
-
- /**
- * Make a string representation of this object.
- *
- * @return string a string with an object summary
- * @access public
- */
- function toString() {
- $modes = array();
- $levels = array(E_USER_NOTICE => 'notice',
- E_USER_WARNING => 'warning',
- E_USER_ERROR => 'error');
- if ($this->mode & PEAR_ERROR_CALLBACK) {
- if (is_array($this->callback)) {
- $callback = (is_object($this->callback[0]) ?
- strtolower(get_class($this->callback[0])) :
- $this->callback[0]) . '::' .
- $this->callback[1];
- } else {
- $callback = $this->callback;
- }
- return sprintf('[%s: message="%s" code=%d mode=callback '.
- 'callback=%s prefix="%s" info="%s"]',
- strtolower(get_class($this)), $this->message, $this->code,
- $callback, $this->error_message_prefix,
- $this->userinfo);
- }
- if ($this->mode & PEAR_ERROR_PRINT) {
- $modes[] = 'print';
- }
- if ($this->mode & PEAR_ERROR_TRIGGER) {
- $modes[] = 'trigger';
- }
- if ($this->mode & PEAR_ERROR_DIE) {
- $modes[] = 'die';
- }
- if ($this->mode & PEAR_ERROR_RETURN) {
- $modes[] = 'return';
- }
- return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
- 'prefix="%s" info="%s"]',
- strtolower(get_class($this)), $this->message, $this->code,
- implode("|", $modes), $levels[$this->level],
- $this->error_message_prefix,
- $this->userinfo);
- }
-
- // }}}
-}
-
-/*
- * Local Variables:
- * mode: php
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
-?>
diff --git a/_dev/_thirdparty/jsl/jsl b/_dev/_thirdparty/jsl/jsl
deleted file mode 100644
index 97d177347e..0000000000
Binary files a/_dev/_thirdparty/jsl/jsl and /dev/null differ
diff --git a/_dev/_thirdparty/jsl/jsl.exe b/_dev/_thirdparty/jsl/jsl.exe
deleted file mode 100644
index 30dbd14ac5..0000000000
Binary files a/_dev/_thirdparty/jsl/jsl.exe and /dev/null differ
diff --git a/_dev/docs_build/docs_build.bat b/_dev/docs_build/docs_build.bat
deleted file mode 100644
index 2c4b72d595..0000000000
--- a/_dev/docs_build/docs_build.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@ECHO OFF
-::
-:: Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-:: For licensing, see LICENSE.html or http://ckeditor.com/license
-::
-:: Builds the documentation files.
-::
-
-ECHO Building the API document into the api_docs directory...
-
-del /F /Q "api_docs/*.*"
-
-java -jar ../_thirdparty/jsdoc-toolkit/jsrun.jar ../_thirdparty/jsdoc-toolkit/app/run.js -c=docs_build.conf
-
-:: php ../fixlineends/fixlineends.php --eolstripwhite --eofnewline --eofstripwhite --nohidden --nosystem api_docs/
-
-ECHO Finished!
diff --git a/_dev/docs_build/docs_build.conf b/_dev/docs_build/docs_build.conf
deleted file mode 100644
index bdef06142a..0000000000
--- a/_dev/docs_build/docs_build.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- This is an example of one way you could set up a configuration file to more
- conveniently define some commandline options. You might like to do this if
- you frequently reuse the same options. Note that you don't need to define
- every option in this file, you can combine a configuration file with
- additional options on the commandline if your wish.
-
- You would include this configuration file by running JsDoc Toolkit like so:
- java -jar jsrun.jar app/run.js -c=conf/sample.conf
-
-*/
-
-{
- // Source files to parse.
- _:
- [
- '../../_source/core/',
- '../../_source/adapters/',
- '../../_source/plugins/',
- '../../_source/skins/kama/skin.js',
- '../../_source/themes/default/theme.js'
- ],
-
- // Files to exclude.
- E:
- [
- 'yui.js'
- ],
-
- // Document all functions, even uncommented ones.
- a: true,
-
- // Recursively, up to 100 directories depth.
- r: 100,
-
- // use this directory as the output directory
- d: 'api_docs',
-
- // Template.
- t: 'template',
-
- // Verbose mode.
- v: true
-}
diff --git a/_dev/docs_build/template/allclasses.tmpl b/_dev/docs_build/template/allclasses.tmpl
deleted file mode 100644
index 3c4665de67..0000000000
--- a/_dev/docs_build/template/allclasses.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-
- CKEditor Sample — Create and Destroy Editor Instances for Ajax Applications
-
-
-
- This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
- area will be displayed in a <div> element.
-
-
- For details of how to create this setup check the source code of this sample page
- for JavaScript code responsible for the creation and destruction of a CKEditor instance.
-
-
-
-
-
-
-
-
Click the buttons to create and remove a CKEditor instance.
- CKEditor Sample — Using CKEditor JavaScript API
-
-
-
- This sample shows how to use the
- CKEditor JavaScript API
- to interact with the editor at runtime.
-
-
- For details on how to create this setup check the source code of this sample page.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/_samples/api_dialog.html b/_samples/api_dialog.html
deleted file mode 100644
index 47e8a5a787..0000000000
--- a/_samples/api_dialog.html
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
- Using API to Customize Dialog Windows — CKEditor Sample
-
-
-
-
-
-
-
-
-
-
-
-
- CKEditor Sample — Using CKEditor Dialog API
-
-
-
- This sample shows how to use the
- CKEditor Dialog API
- to customize CKEditor dialog windows without changing the original editor code.
- The following customizations are being done in the example below:
-
-
-
Adding dialog window tabs – "My Tab" in the "Link" dialog window.
-
Removing a dialog window tab – "Target" tab from the "Link" dialog window.
-
Adding dialog window fields – "My Custom Field" in the "Link" dialog window.
-
Removing dialog window fields – "Link Type" and "Browse Server" in the "Link"
- dialog window.
-
Setting default values for dialog window fields – "URL" field in the
- "Link" dialog window.
-
Creating a custom dialog window – "My Dialog" dialog window opened with the "My Dialog" toolbar button.
-
-
-For details on how to create this setup check the source code of this sample page.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/_samples/api_dialog/my_dialog.js b/_samples/api_dialog/my_dialog.js
deleted file mode 100644
index 7d3fbb9abc..0000000000
--- a/_samples/api_dialog/my_dialog.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
-
-CKEDITOR.dialog.add( 'myDialog', function( editor ) {
- return {
- title: 'My Dialog',
- minWidth: 400,
- minHeight: 200,
- contents: [
- {
- id: 'tab1',
- label: 'First Tab',
- title: 'First Tab',
- elements: [
- {
- id: 'input1',
- type: 'text',
- label: 'Input 1'
- }
- ]
- }
- ]
- };
-});
diff --git a/_samples/asp/advanced.asp b/_samples/asp/advanced.asp
deleted file mode 100644
index 1b31d0590a..0000000000
--- a/_samples/asp/advanced.asp
+++ /dev/null
@@ -1,105 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-<%
-
- ' You must set "Enable Parent Paths" on your web site
- ' in order for the above relative include to work.
- ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
-
-%>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-
- CKEditor Sample
-
-
-
-
-
-
-
-
-
-
diff --git a/_samples/asp/events.asp b/_samples/asp/events.asp
deleted file mode 100644
index d42d96c4e4..0000000000
--- a/_samples/asp/events.asp
+++ /dev/null
@@ -1,136 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-<%
-
- ' You must set "Enable Parent Paths" on your web site
- ' in order for the above relative include to work.
- ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
-
-%>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-
- CKEditor Samples List for ASP — CKEditor Sample
-
-
- Overview
-
-
The ckeditor.asp file provides a wrapper to ease the work of creating CKEditor instances from classic Asp.
-
To use it, you must first include it into your page:
-
- <!-- #INCLUDE file="../../ckeditor.asp" -->
-
- Of course, you should adjust the path to make it point to the correct location, and maybe use a full path (with virtual="" instead of file="")
-
-
After that script is included, you can use it in different ways, based on the following pattern:
-
-
-
- Create an instance of the CKEditor class:
-
dim editor
-set editor = New CKEditor
-
-
- Set the path to the folder where CKEditor has been installed, by default it will use /ckeditor/
-
editor.basePath = "../../"
-
-
- Now use one of the three main methods to create the CKEditor instances:
-
-
- Replace textarea with id (or name) "editor1".
-
editor.replaceInstance "editor1"
-
-
- Replace all textareas with CKEditor.
-
editor.replaceAll empty
-
-
- Create a textarea element and attach CKEditor to it.
-
editor.editor "editor1", initialValue
-
-
-
-
-
Before step 3 you can use a number of methods and properties to adjust the behavior of this class and the CKEditor instances
-that will be created:
-
-
returnOutput : if set to true, the functions won't dump the code with response.write, but instead they will return it so
- you can do anything you want
-
basePath: location of the CKEditor scripts
-
initialized: if you set it to true, it means that you have already included the CKEditor.js file into the page and it
- doesn't have to be generated again.
-
textareaAttributes: You can set here a Dictionary object with the attributes that you want to output in the call to the "editor" method.
-
-
config: Allows to set config values for all the instances from now on.
-
instanceConfig: Allows to set config values just for the next instance.
-
-
addEventHandler: Adds an event handler for all the instances from now on.
-
addInstanceEventHandler: Adds an event handler just for the next instance.
-
addGlobalEventHandler: Adds an event handler for the global CKEDITOR object.
-
-
clearEventHandlers: Removes one or all the event handlers from all the instances from now on.
-
clearInstanceEventHandlers: Removes one or all the event handlers from the next instance.
-
clearGlobalEventHandlers: Removes one or all the event handlers from the global CKEDITOR object.
-
-
-
diff --git a/_samples/asp/replace.asp b/_samples/asp/replace.asp
deleted file mode 100644
index 73e468a353..0000000000
--- a/_samples/asp/replace.asp
+++ /dev/null
@@ -1,72 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-<%
-
- ' You must set "Enable Parent Paths" on your web site
- ' in order for the above relative include to work.
- ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
-
-%>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-
- CKEditor Sample
-
-
-
-
-
-
-
-
- <%
- ' Create class instance.
- dim editor
- set editor = New CKEditor
- ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
- ' editor.basePath = "/ckeditor/"
- ' If not set, CKEditor will default to /ckeditor/
- editor.basePath = "../../"
- ' Replace textarea with id (or name) "editor1".
- editor.replaceInstance "editor1"
- %>
-
-
diff --git a/_samples/asp/replaceall.asp b/_samples/asp/replaceall.asp
deleted file mode 100644
index faac4be207..0000000000
--- a/_samples/asp/replaceall.asp
+++ /dev/null
@@ -1,77 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-<%
-
- ' You must set "Enable Parent Paths" on your web site
- ' in order for the above relative include to work.
- ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
-
-%>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-
- CKEditor Sample
-
-
-
-
-
-
-
-
- <%
- ' Create class instance.
- dim editor
- set editor = New CKEditor
- ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
- ' editor.basePath = "/ckeditor/"
- ' If not set, CKEditor will default to /ckeditor/
- editor.basePath = "../../"
- ' Replace all textareas with CKEditor.
- editor.replaceAll empty
- %>
-
-
diff --git a/_samples/asp/sample_posteddata.asp b/_samples/asp/sample_posteddata.asp
deleted file mode 100644
index 89a8a94470..0000000000
--- a/_samples/asp/sample_posteddata.asp
+++ /dev/null
@@ -1,46 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-
- CKEditor - Posted Data
-
-
-
-
-
-
Field Name
-
Value
-
-
- <%
- Dim sForm
- For Each sForm in Request.Form
- %>
-
-
<%=Server.HTMLEncode( sForm )%>
-
<%=Server.HTMLEncode( Request.Form(sForm) )%>
-
- <% Next %>
-
-
-
-
diff --git a/_samples/asp/standalone.asp b/_samples/asp/standalone.asp
deleted file mode 100644
index 1eeaebbbe5..0000000000
--- a/_samples/asp/standalone.asp
+++ /dev/null
@@ -1,72 +0,0 @@
-<%@ codepage="65001" language="VBScript" %>
-<% Option Explicit %>
-
-<%
-
- ' You must set "Enable Parent Paths" on your web site
- ' in order for the above relative include to work.
- ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
-
-%>
-
-
-
-
- Sample - CKEditor
-
-
-
-
-