summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Great Git Migration2010-10-31 22:02:21 +0000
committerThe Great Git Migration2010-10-31 22:02:21 +0000
commit216eac0969590f537f4349144a7399eb00521a8b (patch)
tree18e7b4320a772d525b6946cb8d65ad755c333ef3
parentc16bee54ec38e9ae6f322a67af45491db3589c84 (diff)
This commit was manufactured as part of Drupal's Great Git Migration to7.0-beta-3
create tag 'DRUPAL-7-0-BETA-3'. Sprout from master 2010-08-23 09:04:57 UTC Dries Buytaert <dries@buytaert.net> '- Patch #851878 by justinrandell, flobruit, ksenzee, aaron, litwol, Damien Tournoud: added missing files.' Delete: .htaccess CHANGELOG.txt COPYRIGHT.txt INSTALL.mysql.txt INSTALL.pgsql.txt INSTALL.sqlite.txt INSTALL.txt LICENSE.txt MAINTAINERS.txt UPGRADE.txt authorize.php cron.php includes/actions.inc includes/ajax.inc includes/archiver.inc includes/authorize.inc includes/batch.inc includes/batch.queue.inc includes/bootstrap.inc includes/cache-install.inc includes/cache.inc includes/common.inc includes/database/database.inc includes/database/log.inc includes/database/mysql/database.inc includes/database/mysql/install.inc includes/database/mysql/query.inc includes/database/mysql/schema.inc includes/database/pgsql/database.inc includes/database/pgsql/install.inc includes/database/pgsql/query.inc includes/database/pgsql/schema.inc includes/database/prefetch.inc includes/database/query.inc includes/database/schema.inc includes/database/select.inc includes/database/sqlite/database.inc includes/database/sqlite/install.inc includes/database/sqlite/query.inc includes/database/sqlite/schema.inc includes/date.inc includes/entity.inc includes/errors.inc includes/file.inc includes/file.mimetypes.inc includes/filetransfer/filetransfer.inc includes/filetransfer/ftp.inc includes/filetransfer/local.inc includes/filetransfer/ssh.inc includes/form.inc includes/graph.inc includes/image.inc includes/install.core.inc includes/install.inc includes/iso.inc includes/language.inc includes/locale.inc includes/lock.inc includes/mail.inc includes/menu.inc includes/module.inc includes/pager.inc includes/password.inc includes/path.inc includes/registry.inc includes/session.inc includes/stream_wrappers.inc includes/tablesort.inc includes/theme.inc includes/theme.maintenance.inc includes/token.inc includes/unicode.entities.inc includes/unicode.inc includes/update.inc includes/updater.inc includes/utility.inc includes/xmlrpc.inc includes/xmlrpcs.inc index.php install.php misc/ajax.js misc/arrow-asc.png misc/arrow-desc.png misc/authorize.js misc/autocomplete.js misc/batch.js misc/collapse.js misc/configure.png misc/draggable.png misc/drupal.js misc/druplicon.png misc/farbtastic/farbtastic.css misc/farbtastic/farbtastic.js misc/farbtastic/marker.png misc/farbtastic/mask.png misc/farbtastic/wheel.png misc/favicon.ico misc/feed.png misc/form.js misc/forum-closed.png misc/forum-default.png misc/forum-hot-new.png misc/forum-hot.png misc/forum-new.png misc/forum-sticky.png misc/grippie.png misc/help.png misc/jquery.ba-bbq.js misc/jquery.cookie.js misc/jquery.form.js misc/jquery.js misc/jquery.once.js misc/menu-collapsed-rtl.png misc/menu-collapsed.png misc/menu-expanded.png misc/menu-leaf.png misc/permissions.png misc/powered-black-135x42.png misc/powered-black-80x15.png misc/powered-black-88x31.png misc/powered-blue-135x42.png misc/powered-blue-80x15.png misc/powered-blue-88x31.png misc/powered-gray-135x42.png misc/powered-gray-80x15.png misc/powered-gray-88x31.png misc/print-rtl.css misc/print.css misc/progress.gif misc/progress.js misc/states.js misc/tabledrag.js misc/tableheader.js misc/tableselect.js misc/textarea.js misc/throbber.gif misc/timezone.js misc/tree-bottom.png misc/tree.png misc/ui/images/ui-anim_basic_16x16_0.gif misc/ui/images/ui-bg_flat_0_aaaaaa_40x100.png misc/ui/images/ui-bg_flat_75_ffffff_40x100.png misc/ui/images/ui-bg_glass_55_fbf9ee_1x400.png misc/ui/images/ui-bg_glass_65_ffffff_1x400.png misc/ui/images/ui-bg_glass_75_dadada_1x400.png misc/ui/images/ui-bg_glass_75_e6e6e6_1x400.png misc/ui/images/ui-bg_glass_95_fef1ec_1x400.png misc/ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png misc/ui/images/ui-icons_222222_256x240.png misc/ui/images/ui-icons_2e83ff_256x240.png misc/ui/images/ui-icons_454545_256x240.png misc/ui/images/ui-icons_888888_256x240.png misc/ui/images/ui-icons_cd0a0a_256x240.png misc/ui/jquery.effects.blind.min.js misc/ui/jquery.effects.bounce.min.js misc/ui/jquery.effects.clip.min.js misc/ui/jquery.effects.core.min.js misc/ui/jquery.effects.drop.min.js misc/ui/jquery.effects.explode.min.js misc/ui/jquery.effects.fade.min.js misc/ui/jquery.effects.fold.min.js misc/ui/jquery.effects.highlight.min.js misc/ui/jquery.effects.pulsate.min.js misc/ui/jquery.effects.scale.min.js misc/ui/jquery.effects.shake.min.js misc/ui/jquery.effects.slide.min.js misc/ui/jquery.effects.transfer.min.js misc/ui/jquery.ui.accordion.css misc/ui/jquery.ui.accordion.min.js misc/ui/jquery.ui.autocomplete.css misc/ui/jquery.ui.autocomplete.min.js misc/ui/jquery.ui.button.css misc/ui/jquery.ui.button.min.js misc/ui/jquery.ui.core.css misc/ui/jquery.ui.core.min.js misc/ui/jquery.ui.datepicker.css misc/ui/jquery.ui.datepicker.min.js misc/ui/jquery.ui.dialog.css misc/ui/jquery.ui.dialog.min.js misc/ui/jquery.ui.draggable.min.js misc/ui/jquery.ui.droppable.min.js misc/ui/jquery.ui.mouse.min.js misc/ui/jquery.ui.position.min.js misc/ui/jquery.ui.progressbar.css misc/ui/jquery.ui.progressbar.min.js misc/ui/jquery.ui.resizable.css misc/ui/jquery.ui.resizable.min.js misc/ui/jquery.ui.selectable.min.js misc/ui/jquery.ui.slider.css misc/ui/jquery.ui.slider.min.js misc/ui/jquery.ui.sortable.min.js misc/ui/jquery.ui.tabs.css misc/ui/jquery.ui.tabs.min.js misc/ui/jquery.ui.theme.css misc/ui/jquery.ui.widget.min.js misc/vertical-tabs-rtl.css misc/vertical-tabs.css misc/vertical-tabs.js misc/watchdog-error.png misc/watchdog-ok.png misc/watchdog-warning.png modules/README.txt modules/aggregator/aggregator-feed-source.tpl.php modules/aggregator/aggregator-item.tpl.php modules/aggregator/aggregator-rtl.css modules/aggregator/aggregator-summary-item.tpl.php modules/aggregator/aggregator-summary-items.tpl.php modules/aggregator/aggregator-wrapper.tpl.php modules/aggregator/aggregator.admin.inc modules/aggregator/aggregator.api.php modules/aggregator/aggregator.css modules/aggregator/aggregator.fetcher.inc modules/aggregator/aggregator.info modules/aggregator/aggregator.install modules/aggregator/aggregator.module modules/aggregator/aggregator.pages.inc modules/aggregator/aggregator.parser.inc modules/aggregator/aggregator.processor.inc modules/aggregator/aggregator.test modules/aggregator/tests/aggregator_test.info modules/aggregator/tests/aggregator_test.module modules/aggregator/tests/aggregator_test_atom.xml modules/aggregator/tests/aggregator_test_rss091.xml modules/block/block-admin-display-form.tpl.php modules/block/block.admin.inc modules/block/block.api.php modules/block/block.css modules/block/block.info modules/block/block.install modules/block/block.js modules/block/block.module modules/block/block.test modules/block/block.tpl.php modules/block/tests/block_test.info modules/block/tests/block_test.module modules/blog/blog.info modules/blog/blog.install modules/blog/blog.module modules/blog/blog.pages.inc modules/blog/blog.test modules/book/book-all-books-block.tpl.php modules/book/book-export-html.tpl.php modules/book/book-navigation.tpl.php modules/book/book-node-export-html.tpl.php modules/book/book-rtl.css modules/book/book.admin.inc modules/book/book.css modules/book/book.info modules/book/book.install modules/book/book.js modules/book/book.module modules/book/book.pages.inc modules/book/book.test modules/color/color-rtl.css modules/color/color.css modules/color/color.info modules/color/color.install modules/color/color.js modules/color/color.module modules/color/color.test modules/color/images/hook-rtl.png modules/color/images/hook.png modules/color/images/lock.png modules/color/preview.html modules/color/preview.js modules/comment/comment-node-form.js modules/comment/comment-rtl.css modules/comment/comment-wrapper.tpl.php modules/comment/comment.admin.inc modules/comment/comment.api.php modules/comment/comment.css modules/comment/comment.info modules/comment/comment.install modules/comment/comment.module modules/comment/comment.pages.inc modules/comment/comment.test modules/comment/comment.tokens.inc modules/comment/comment.tpl.php modules/contact/contact.admin.inc modules/contact/contact.info modules/contact/contact.install modules/contact/contact.module modules/contact/contact.pages.inc modules/contact/contact.test modules/contextual/contextual-rtl.css modules/contextual/contextual.css modules/contextual/contextual.info modules/contextual/contextual.js modules/contextual/contextual.module modules/contextual/images/gear-select.png modules/dashboard/dashboard.api.php modules/dashboard/dashboard.css modules/dashboard/dashboard.info modules/dashboard/dashboard.js modules/dashboard/dashboard.module modules/dashboard/dashboard.test modules/dblog/dblog-rtl.css modules/dblog/dblog.admin.inc modules/dblog/dblog.css modules/dblog/dblog.info modules/dblog/dblog.install modules/dblog/dblog.module modules/dblog/dblog.test modules/field/field.api.php modules/field/field.attach.inc modules/field/field.crud.inc modules/field/field.default.inc modules/field/field.form.inc modules/field/field.info modules/field/field.info.inc modules/field/field.install modules/field/field.module modules/field/field.multilingual.inc modules/field/modules/field_sql_storage/field_sql_storage.info modules/field/modules/field_sql_storage/field_sql_storage.install modules/field/modules/field_sql_storage/field_sql_storage.module modules/field/modules/field_sql_storage/field_sql_storage.test modules/field/modules/list/list.info modules/field/modules/list/list.module modules/field/modules/list/tests/list.test modules/field/modules/list/tests/list_test.info modules/field/modules/list/tests/list_test.module modules/field/modules/number/number.info modules/field/modules/number/number.module modules/field/modules/options/options.api.php modules/field/modules/options/options.info modules/field/modules/options/options.module modules/field/modules/options/options.test modules/field/modules/text/text.info modules/field/modules/text/text.js modules/field/modules/text/text.module modules/field/modules/text/text.test modules/field/tests/field.test modules/field/tests/field_test.entity.inc modules/field/tests/field_test.field.inc modules/field/tests/field_test.info modules/field/tests/field_test.install modules/field/tests/field_test.module modules/field/tests/field_test.storage.inc modules/field/theme/field-rtl.css modules/field/theme/field.css modules/field/theme/field.tpl.php modules/field_ui/field_ui-display-overview-table.tpl.php modules/field_ui/field_ui-rtl.css modules/field_ui/field_ui.admin.inc modules/field_ui/field_ui.api.php modules/field_ui/field_ui.css modules/field_ui/field_ui.info modules/field_ui/field_ui.js modules/field_ui/field_ui.module modules/field_ui/field_ui.test modules/file/file.css modules/file/file.field.inc modules/file/file.info modules/file/file.install modules/file/file.js modules/file/file.module modules/file/icons/application-octet-stream.png modules/file/icons/application-pdf.png modules/file/icons/application-x-executable.png modules/file/icons/audio-x-generic.png modules/file/icons/image-x-generic.png modules/file/icons/package-x-generic.png modules/file/icons/text-html.png modules/file/icons/text-plain.png modules/file/icons/text-x-generic.png modules/file/icons/text-x-script.png modules/file/icons/video-x-generic.png modules/file/icons/x-office-document.png modules/file/icons/x-office-presentation.png modules/file/icons/x-office-spreadsheet.png modules/file/tests/file.test modules/file/tests/file_module_test.info modules/file/tests/file_module_test.module modules/filter/filter.admin.inc modules/filter/filter.admin.js modules/filter/filter.api.php modules/filter/filter.css modules/filter/filter.info modules/filter/filter.install modules/filter/filter.js modules/filter/filter.module modules/filter/filter.pages.inc modules/filter/filter.test modules/forum/forum-icon.tpl.php modules/forum/forum-list.tpl.php modules/forum/forum-rtl.css modules/forum/forum-submitted.tpl.php modules/forum/forum-topic-list.tpl.php modules/forum/forum.admin.inc modules/forum/forum.css modules/forum/forum.info modules/forum/forum.install modules/forum/forum.module modules/forum/forum.pages.inc modules/forum/forum.test modules/forum/forums.tpl.php modules/help/help-rtl.css modules/help/help.admin.inc modules/help/help.api.php modules/help/help.css modules/help/help.info modules/help/help.module modules/help/help.test modules/image/image-rtl.css modules/image/image.admin.css modules/image/image.admin.inc modules/image/image.api.php modules/image/image.css modules/image/image.effects.inc modules/image/image.field.inc modules/image/image.info modules/image/image.install modules/image/image.module modules/image/image.test modules/image/sample.png modules/locale/locale.admin.inc modules/locale/locale.api.php modules/locale/locale.css modules/locale/locale.datepicker.js modules/locale/locale.info modules/locale/locale.install modules/locale/locale.module modules/locale/locale.test modules/locale/tests/locale_test.info modules/locale/tests/locale_test.module modules/locale/tests/translations/test.xx.po modules/menu/menu.admin.inc modules/menu/menu.admin.js modules/menu/menu.api.php modules/menu/menu.css modules/menu/menu.info modules/menu/menu.install modules/menu/menu.js modules/menu/menu.module modules/menu/menu.test modules/node/content_types.inc modules/node/content_types.js modules/node/node-rtl.css modules/node/node.admin.inc modules/node/node.api.php modules/node/node.css modules/node/node.info modules/node/node.install modules/node/node.js modules/node/node.module modules/node/node.pages.inc modules/node/node.test modules/node/node.tokens.inc modules/node/node.tpl.php modules/node/tests/node_access_test.info modules/node/tests/node_access_test.module modules/node/tests/node_presave_test.info modules/node/tests/node_presave_test.module modules/node/tests/node_test.info modules/node/tests/node_test.module modules/node/tests/node_test_exception.info modules/node/tests/node_test_exception.module modules/openid/login-bg.png modules/openid/openid-rtl.css modules/openid/openid.api.php modules/openid/openid.css modules/openid/openid.inc modules/openid/openid.info modules/openid/openid.install modules/openid/openid.js modules/openid/openid.module modules/openid/openid.pages.inc modules/openid/openid.test modules/openid/tests/openid_test.info modules/openid/tests/openid_test.install modules/openid/tests/openid_test.module modules/overlay/images/background.png modules/overlay/images/close.png modules/overlay/overlay-child.css modules/overlay/overlay-child.js modules/overlay/overlay-parent.css modules/overlay/overlay-parent.js modules/overlay/overlay.api.php modules/overlay/overlay.info modules/overlay/overlay.install modules/overlay/overlay.module modules/overlay/overlay.tpl.php modules/path/path.admin.inc modules/path/path.api.php modules/path/path.info modules/path/path.js modules/path/path.module modules/path/path.test modules/php/php.info modules/php/php.install modules/php/php.module modules/php/php.test modules/poll/poll-bar--block.tpl.php modules/poll/poll-bar.tpl.php modules/poll/poll-results--block.tpl.php modules/poll/poll-results.tpl.php modules/poll/poll-rtl.css modules/poll/poll-vote.tpl.php modules/poll/poll.css modules/poll/poll.info modules/poll/poll.install modules/poll/poll.module modules/poll/poll.pages.inc modules/poll/poll.test modules/poll/poll.tokens.inc modules/profile/profile-block.tpl.php modules/profile/profile-listing.tpl.php modules/profile/profile-wrapper.tpl.php modules/profile/profile.admin.inc modules/profile/profile.css modules/profile/profile.info modules/profile/profile.install modules/profile/profile.js modules/profile/profile.module modules/profile/profile.pages.inc modules/profile/profile.test modules/rdf/rdf.api.php modules/rdf/rdf.info modules/rdf/rdf.install modules/rdf/rdf.module modules/rdf/rdf.test modules/rdf/tests/rdf_test.info modules/rdf/tests/rdf_test.install modules/rdf/tests/rdf_test.module modules/search/search-block-form.tpl.php modules/search/search-result.tpl.php modules/search/search-results.tpl.php modules/search/search-rtl.css modules/search/search.admin.inc modules/search/search.api.php modules/search/search.css modules/search/search.extender.inc modules/search/search.info modules/search/search.install modules/search/search.module modules/search/search.pages.inc modules/search/search.test modules/search/tests/UnicodeTest.txt modules/search/tests/search_embedded_form.info modules/search/tests/search_embedded_form.module modules/search/tests/search_extra_type.info modules/search/tests/search_extra_type.module modules/shortcut/shortcut.admin.css modules/shortcut/shortcut.admin.inc modules/shortcut/shortcut.admin.js modules/shortcut/shortcut.api.php modules/shortcut/shortcut.css modules/shortcut/shortcut.info modules/shortcut/shortcut.install modules/shortcut/shortcut.module modules/shortcut/shortcut.png modules/shortcut/shortcut.test modules/simpletest/drupal_web_test_case.php modules/simpletest/files/README.txt modules/simpletest/files/css_test_files/comment_hacks.css modules/simpletest/files/css_test_files/comment_hacks.css.optimized.css modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css modules/simpletest/files/css_test_files/css_input_with_import.css modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css modules/simpletest/files/css_test_files/css_input_without_import.css modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css modules/simpletest/files/css_test_files/import1.css modules/simpletest/files/css_test_files/import2.css modules/simpletest/files/html-1.txt modules/simpletest/files/html-2.html modules/simpletest/files/image-1.png modules/simpletest/files/image-2.jpg modules/simpletest/files/image-test.gif modules/simpletest/files/image-test.jpg modules/simpletest/files/image-test.png modules/simpletest/files/javascript-1.txt modules/simpletest/files/javascript-2.script modules/simpletest/files/php-1.txt modules/simpletest/files/php-2.php modules/simpletest/files/sql-1.txt modules/simpletest/files/sql-2.sql modules/simpletest/simpletest.api.php modules/simpletest/simpletest.css modules/simpletest/simpletest.info modules/simpletest/simpletest.install modules/simpletest/simpletest.js modules/simpletest/simpletest.module modules/simpletest/simpletest.pages.inc modules/simpletest/simpletest.test modules/simpletest/tests/actions.test modules/simpletest/tests/actions_loop_test.info modules/simpletest/tests/actions_loop_test.install modules/simpletest/tests/actions_loop_test.module modules/simpletest/tests/ajax.test modules/simpletest/tests/ajax_forms_test.info modules/simpletest/tests/ajax_forms_test.module modules/simpletest/tests/ajax_test.info modules/simpletest/tests/ajax_test.module modules/simpletest/tests/batch.test modules/simpletest/tests/batch_test.callbacks.inc modules/simpletest/tests/batch_test.info modules/simpletest/tests/batch_test.module modules/simpletest/tests/bootstrap.test modules/simpletest/tests/cache.test modules/simpletest/tests/common.test modules/simpletest/tests/common_test.info modules/simpletest/tests/common_test.module modules/simpletest/tests/common_test_info.txt modules/simpletest/tests/database_test.info modules/simpletest/tests/database_test.install modules/simpletest/tests/database_test.module modules/simpletest/tests/database_test.test modules/simpletest/tests/entity_cache_test.info modules/simpletest/tests/entity_cache_test.module modules/simpletest/tests/entity_cache_test_dependency.info modules/simpletest/tests/entity_cache_test_dependency.module modules/simpletest/tests/entity_query.test modules/simpletest/tests/error.test modules/simpletest/tests/error_test.info modules/simpletest/tests/error_test.module modules/simpletest/tests/file.test modules/simpletest/tests/file_test.info modules/simpletest/tests/file_test.module modules/simpletest/tests/filetransfer.test modules/simpletest/tests/filter_test.info modules/simpletest/tests/filter_test.module modules/simpletest/tests/form.test modules/simpletest/tests/form_test.file.inc modules/simpletest/tests/form_test.info modules/simpletest/tests/form_test.module modules/simpletest/tests/graph.test modules/simpletest/tests/https.php modules/simpletest/tests/image.test modules/simpletest/tests/image_test.info modules/simpletest/tests/image_test.module modules/simpletest/tests/lock.test modules/simpletest/tests/mail.test modules/simpletest/tests/menu.test modules/simpletest/tests/menu_test.info modules/simpletest/tests/menu_test.module modules/simpletest/tests/module.test modules/simpletest/tests/module_test.file.inc modules/simpletest/tests/module_test.info modules/simpletest/tests/module_test.install modules/simpletest/tests/module_test.module modules/simpletest/tests/path.test modules/simpletest/tests/registry.test modules/simpletest/tests/requirements1_test.info modules/simpletest/tests/requirements1_test.install modules/simpletest/tests/requirements1_test.module modules/simpletest/tests/requirements2_test.info modules/simpletest/tests/requirements2_test.module modules/simpletest/tests/schema.test modules/simpletest/tests/session.test modules/simpletest/tests/session_test.info modules/simpletest/tests/session_test.module modules/simpletest/tests/system_dependencies_test.info modules/simpletest/tests/system_dependencies_test.module modules/simpletest/tests/system_test.info modules/simpletest/tests/system_test.module modules/simpletest/tests/taxonomy_test.info modules/simpletest/tests/taxonomy_test.install modules/simpletest/tests/taxonomy_test.module modules/simpletest/tests/theme.test modules/simpletest/tests/theme_test.info modules/simpletest/tests/theme_test.module modules/simpletest/tests/unicode.test modules/simpletest/tests/update.test modules/simpletest/tests/update_test_1.info modules/simpletest/tests/update_test_1.install modules/simpletest/tests/update_test_1.module modules/simpletest/tests/update_test_2.info modules/simpletest/tests/update_test_2.install modules/simpletest/tests/update_test_2.module modules/simpletest/tests/update_test_3.info modules/simpletest/tests/update_test_3.install modules/simpletest/tests/update_test_3.module modules/simpletest/tests/upgrade/drupal-6.bare.database.php modules/simpletest/tests/upgrade/drupal-6.filled.database.php modules/simpletest/tests/upgrade/upgrade.poll.test modules/simpletest/tests/upgrade/upgrade.test modules/simpletest/tests/url_alter_test.info modules/simpletest/tests/url_alter_test.install modules/simpletest/tests/url_alter_test.module modules/simpletest/tests/xmlrpc.test modules/simpletest/tests/xmlrpc_test.info modules/simpletest/tests/xmlrpc_test.module modules/statistics/statistics.admin.inc modules/statistics/statistics.info modules/statistics/statistics.install modules/statistics/statistics.module modules/statistics/statistics.pages.inc modules/statistics/statistics.test modules/statistics/statistics.tokens.inc modules/syslog/syslog.info modules/syslog/syslog.install modules/syslog/syslog.module modules/syslog/syslog.test modules/system/admin-rtl.css modules/system/admin.css modules/system/html.tpl.php modules/system/image.gd.inc modules/system/maintenance-page.tpl.php modules/system/maintenance.css modules/system/page.tpl.php modules/system/region.tpl.php modules/system/system-behavior-rtl.css modules/system/system-behavior.css modules/system/system-menus-rtl.css modules/system/system-menus.css modules/system/system-messages.css modules/system/system-rtl.css modules/system/system.admin.inc modules/system/system.api.php modules/system/system.archiver.inc modules/system/system.cron.js modules/system/system.css modules/system/system.info modules/system/system.install modules/system/system.js modules/system/system.mail.inc modules/system/system.module modules/system/system.queue.inc modules/system/system.tar.inc modules/system/system.test modules/system/system.tokens.inc modules/system/system.updater.inc modules/system/theme.api.php modules/taxonomy/taxonomy-term.tpl.php modules/taxonomy/taxonomy.admin.inc modules/taxonomy/taxonomy.api.php modules/taxonomy/taxonomy.css modules/taxonomy/taxonomy.info modules/taxonomy/taxonomy.install modules/taxonomy/taxonomy.js modules/taxonomy/taxonomy.module modules/taxonomy/taxonomy.pages.inc modules/taxonomy/taxonomy.test modules/taxonomy/taxonomy.tokens.inc modules/toolbar/toolbar.css modules/toolbar/toolbar.info modules/toolbar/toolbar.js modules/toolbar/toolbar.module modules/toolbar/toolbar.png modules/toolbar/toolbar.tpl.php modules/tracker/tracker.css modules/tracker/tracker.info modules/tracker/tracker.install modules/tracker/tracker.module modules/tracker/tracker.pages.inc modules/tracker/tracker.test modules/translation/translation.info modules/translation/translation.module modules/translation/translation.pages.inc modules/translation/translation.test modules/trigger/tests/trigger_test.info modules/trigger/tests/trigger_test.module modules/trigger/trigger.admin.inc modules/trigger/trigger.api.php modules/trigger/trigger.info modules/trigger/trigger.install modules/trigger/trigger.module modules/trigger/trigger.test modules/update/tests/aaa_update_test.1_0.xml modules/update/tests/aaa_update_test.info modules/update/tests/aaa_update_test.module modules/update/tests/aaa_update_test.no-releases.xml modules/update/tests/aaa_update_test.tar.gz modules/update/tests/bbb_update_test.1_0.xml modules/update/tests/bbb_update_test.info modules/update/tests/bbb_update_test.module modules/update/tests/ccc_update_test.1_0.xml modules/update/tests/ccc_update_test.info modules/update/tests/ccc_update_test.module modules/update/tests/drupal.0.xml modules/update/tests/drupal.1.xml modules/update/tests/drupal.2-sec.xml modules/update/tests/drupal.dev.xml modules/update/tests/update_test.info modules/update/tests/update_test.module modules/update/tests/update_test_basetheme.1_1-sec.xml modules/update/tests/update_test_subtheme.1_0.xml modules/update/update-rtl.css modules/update/update.api.php modules/update/update.authorize.inc modules/update/update.compare.inc modules/update/update.css modules/update/update.fetch.inc modules/update/update.info modules/update/update.install modules/update/update.manager.inc modules/update/update.module modules/update/update.report.inc modules/update/update.settings.inc modules/update/update.test modules/user/user-picture.tpl.php modules/user/user-profile-category.tpl.php modules/user/user-profile-item.tpl.php modules/user/user-profile.tpl.php modules/user/user-rtl.css modules/user/user.admin.inc modules/user/user.api.php modules/user/user.css modules/user/user.info modules/user/user.install modules/user/user.js modules/user/user.module modules/user/user.pages.inc modules/user/user.permissions.js modules/user/user.test modules/user/user.tokens.inc profiles/minimal/minimal.info profiles/minimal/minimal.install profiles/minimal/minimal.profile profiles/standard/standard.info profiles/standard/standard.install profiles/standard/standard.profile profiles/testing/testing.info profiles/testing/testing.install profiles/testing/testing.profile robots.txt scripts/code-clean.sh scripts/cron-curl.sh scripts/cron-lynx.sh scripts/drupal.sh scripts/dump-database-d6.sh scripts/generate-d6-content.sh scripts/password-hash.sh scripts/run-tests.sh sites/all/README.txt sites/all/modules/README.txt sites/all/themes/README.txt sites/default/default.settings.php sites/example.sites.php themes/README.txt themes/bartik/bartik.info themes/bartik/color/base.png themes/bartik/color/color.inc themes/bartik/color/preview.css themes/bartik/color/preview.html themes/bartik/color/preview.js themes/bartik/color/preview.png themes/bartik/css/colors.css themes/bartik/css/ie-rtl.css themes/bartik/css/ie.css themes/bartik/css/ie6.css themes/bartik/css/layout-rtl.css themes/bartik/css/layout.css themes/bartik/css/maintenance-page.css themes/bartik/css/print.css themes/bartik/css/style-rtl.css themes/bartik/css/style.css themes/bartik/images/add.png themes/bartik/images/buttons.png themes/bartik/images/comment-arrow-rtl.png themes/bartik/images/comment-arrow.png themes/bartik/images/search-button.png themes/bartik/images/tabs-border.png themes/bartik/logo.png themes/bartik/screenshot.png themes/bartik/template.php themes/bartik/templates/comment-wrapper.tpl.php themes/bartik/templates/comment.tpl.php themes/bartik/templates/maintenance-page.tpl.php themes/bartik/templates/node.tpl.php themes/bartik/templates/page.tpl.php themes/engines/phptemplate/phptemplate.engine themes/garland/color/base.png themes/garland/color/color.inc themes/garland/color/preview.css themes/garland/color/preview.png themes/garland/comment.tpl.php themes/garland/fix-ie-rtl.css themes/garland/fix-ie.css themes/garland/garland.info themes/garland/images/bg-bar-white.png themes/garland/images/bg-bar.png themes/garland/images/bg-content-left.png themes/garland/images/bg-content-right.png themes/garland/images/bg-content.png themes/garland/images/bg-navigation-item-hover.png themes/garland/images/bg-navigation-item.png themes/garland/images/bg-navigation.png themes/garland/images/bg-tab.png themes/garland/images/body.png themes/garland/images/gradient-inner.png themes/garland/images/menu-collapsed-rtl.gif themes/garland/images/menu-collapsed.gif themes/garland/images/menu-expanded.gif themes/garland/images/menu-leaf.gif themes/garland/images/task-list.png themes/garland/logo.png themes/garland/maintenance-page.tpl.php themes/garland/node.tpl.php themes/garland/page.tpl.php themes/garland/print.css themes/garland/screenshot.png themes/garland/style-rtl.css themes/garland/style.css themes/garland/template.php themes/garland/theme-settings.php themes/seven/ie.css themes/seven/ie6.css themes/seven/images/add.png themes/seven/images/arrow-asc.png themes/seven/images/arrow-desc.png themes/seven/images/arrow-next.png themes/seven/images/arrow-prev.png themes/seven/images/buttons.png themes/seven/images/list-item.png themes/seven/images/task-check.png themes/seven/images/task-item.png themes/seven/images/ui-icons-222222-256x240.png themes/seven/images/ui-icons-454545-256x240.png themes/seven/images/ui-icons-800000-256x240.png themes/seven/images/ui-icons-888888-256x240.png themes/seven/images/ui-icons-ffffff-256x240.png themes/seven/jquery.ui.theme.css themes/seven/logo.png themes/seven/maintenance-page.tpl.php themes/seven/page.tpl.php themes/seven/reset.css themes/seven/screenshot.png themes/seven/seven.info themes/seven/style.css themes/seven/template.php themes/seven/vertical-tabs.css themes/stark/README.txt themes/stark/layout.css themes/stark/logo.png themes/stark/screenshot.png themes/stark/stark.info themes/tests/README.txt themes/tests/test_theme/template.php themes/tests/test_theme/test_theme.info themes/tests/update_test_basetheme/update_test_basetheme.info themes/tests/update_test_subtheme/update_test_subtheme.info update.php web.config xmlrpc.php
-rw-r--r--.htaccess114
-rw-r--r--CHANGELOG.txt1045
-rw-r--r--COPYRIGHT.txt25
-rw-r--r--INSTALL.mysql.txt43
-rw-r--r--INSTALL.pgsql.txt44
-rw-r--r--INSTALL.sqlite.txt34
-rw-r--r--INSTALL.txt382
-rw-r--r--LICENSE.txt340
-rw-r--r--MAINTAINERS.txt288
-rw-r--r--UPGRADE.txt111
-rw-r--r--authorize.php175
-rw-r--r--cron.php27
-rw-r--r--includes/actions.inc384
-rw-r--r--includes/ajax.inc957
-rw-r--r--includes/archiver.inc67
-rw-r--r--includes/authorize.inc243
-rw-r--r--includes/batch.inc519
-rw-r--r--includes/batch.queue.inc72
-rw-r--r--includes/bootstrap.inc3026
-rw-r--r--includes/cache-install.inc59
-rw-r--r--includes/cache.inc501
-rw-r--r--includes/common.inc6902
-rw-r--r--includes/database/database.inc2892
-rw-r--r--includes/database/log.inc160
-rw-r--r--includes/database/mysql/database.inc147
-rw-r--r--includes/database/mysql/install.inc28
-rw-r--r--includes/database/mysql/query.inc108
-rw-r--r--includes/database/mysql/schema.inc523
-rw-r--r--includes/database/pgsql/database.inc195
-rw-r--r--includes/database/pgsql/install.inc135
-rw-r--r--includes/database/pgsql/query.inc192
-rw-r--r--includes/database/pgsql/schema.inc525
-rw-r--r--includes/database/prefetch.inc504
-rw-r--r--includes/database/query.inc1425
-rw-r--r--includes/database/schema.inc691
-rw-r--r--includes/database/select.inc1476
-rw-r--r--includes/database/sqlite/database.inc443
-rw-r--r--includes/database/sqlite/install.inc15
-rw-r--r--includes/database/sqlite/query.inc220
-rw-r--r--includes/database/sqlite/schema.inc621
-rw-r--r--includes/date.inc197
-rw-r--r--includes/entity.inc1127
-rw-r--r--includes/errors.inc284
-rw-r--r--includes/file.inc2285
-rw-r--r--includes/file.mimetypes.inc858
-rw-r--r--includes/filetransfer/filetransfer.inc347
-rw-r--r--includes/filetransfer/ftp.inc202
-rw-r--r--includes/filetransfer/local.inc77
-rw-r--r--includes/filetransfer/ssh.inc98
-rw-r--r--includes/form.inc3887
-rw-r--r--includes/graph.inc147
-rw-r--r--includes/image.inc404
-rw-r--r--includes/install.core.inc1771
-rw-r--r--includes/install.inc1057
-rw-r--r--includes/iso.inc475
-rw-r--r--includes/language.inc407
-rw-r--r--includes/locale.inc2084
-rw-r--r--includes/lock.inc250
-rw-r--r--includes/mail.inc587
-rw-r--r--includes/menu.inc3441
-rw-r--r--includes/module.inc936
-rw-r--r--includes/pager.inc638
-rw-r--r--includes/password.inc267
-rw-r--r--includes/path.inc544
-rw-r--r--includes/registry.inc186
-rw-r--r--includes/session.inc462
-rw-r--r--includes/stream_wrappers.inc810
-rw-r--r--includes/tablesort.inc286
-rw-r--r--includes/theme.inc2564
-rw-r--r--includes/theme.maintenance.inc211
-rw-r--r--includes/token.inc236
-rw-r--r--includes/unicode.entities.inc266
-rw-r--r--includes/unicode.inc602
-rw-r--r--includes/update.inc1314
-rw-r--r--includes/updater.inc425
-rw-r--r--includes/utility.inc59
-rw-r--r--includes/xmlrpc.inc626
-rw-r--r--includes/xmlrpcs.inc384
-rw-r--r--index.php22
-rw-r--r--install.php21
-rw-r--r--misc/ajax.js450
-rw-r--r--misc/arrow-asc.pngbin118 -> 0 bytes
-rw-r--r--misc/arrow-desc.pngbin118 -> 0 bytes
-rw-r--r--misc/authorize.js29
-rw-r--r--misc/autocomplete.js307
-rw-r--r--misc/batch.js33
-rw-r--r--misc/collapse.js104
-rw-r--r--misc/configure.pngbin248 -> 0 bytes
-rw-r--r--misc/draggable.pngbin268 -> 0 bytes
-rw-r--r--misc/drupal.js371
-rw-r--r--misc/druplicon.pngbin3905 -> 0 bytes
-rw-r--r--misc/farbtastic/farbtastic.css37
-rw-r--r--misc/farbtastic/farbtastic.js9
-rw-r--r--misc/farbtastic/marker.pngbin437 -> 0 bytes
-rw-r--r--misc/farbtastic/mask.pngbin2001 -> 0 bytes
-rw-r--r--misc/farbtastic/wheel.pngbin11589 -> 0 bytes
-rw-r--r--misc/favicon.icobin5430 -> 0 bytes
-rw-r--r--misc/feed.pngbin656 -> 0 bytes
-rw-r--r--misc/form.js79
-rw-r--r--misc/forum-closed.pngbin1075 -> 0 bytes
-rw-r--r--misc/forum-default.pngbin962 -> 0 bytes
-rw-r--r--misc/forum-hot-new.pngbin1296 -> 0 bytes
-rw-r--r--misc/forum-hot.pngbin1171 -> 0 bytes
-rw-r--r--misc/forum-new.pngbin1114 -> 0 bytes
-rw-r--r--misc/forum-sticky.pngbin1099 -> 0 bytes
-rw-r--r--misc/grippie.pngbin106 -> 0 bytes
-rw-r--r--misc/help.pngbin294 -> 0 bytes
-rw-r--r--misc/jquery.ba-bbq.js20
-rw-r--r--misc/jquery.cookie.js12
-rw-r--r--misc/jquery.form.js13
-rw-r--r--misc/jquery.js156
-rw-r--r--misc/jquery.once.js80
-rw-r--r--misc/menu-collapsed-rtl.pngbin107 -> 0 bytes
-rw-r--r--misc/menu-collapsed.pngbin105 -> 0 bytes
-rw-r--r--misc/menu-expanded.pngbin106 -> 0 bytes
-rw-r--r--misc/menu-leaf.pngbin126 -> 0 bytes
-rw-r--r--misc/permissions.pngbin242 -> 0 bytes
-rw-r--r--misc/powered-black-135x42.pngbin2699 -> 0 bytes
-rw-r--r--misc/powered-black-80x15.pngbin1448 -> 0 bytes
-rw-r--r--misc/powered-black-88x31.pngbin2005 -> 0 bytes
-rw-r--r--misc/powered-blue-135x42.pngbin2879 -> 0 bytes
-rw-r--r--misc/powered-blue-80x15.pngbin943 -> 0 bytes
-rw-r--r--misc/powered-blue-88x31.pngbin2009 -> 0 bytes
-rw-r--r--misc/powered-gray-135x42.pngbin2594 -> 0 bytes
-rw-r--r--misc/powered-gray-80x15.pngbin698 -> 0 bytes
-rw-r--r--misc/powered-gray-88x31.pngbin1968 -> 0 bytes
-rw-r--r--misc/print-rtl.css8
-rw-r--r--misc/print.css26
-rw-r--r--misc/progress.gifbin3622 -> 0 bytes
-rw-r--r--misc/progress.js107
-rw-r--r--misc/states.js412
-rw-r--r--misc/tabledrag.js1173
-rw-r--r--misc/tableheader.js112
-rw-r--r--misc/tableselect.js91
-rw-r--r--misc/textarea.js33
-rw-r--r--misc/throbber.gifbin1336 -> 0 bytes
-rw-r--r--misc/timezone.js67
-rw-r--r--misc/tree-bottom.pngbin129 -> 0 bytes
-rw-r--r--misc/tree.pngbin130 -> 0 bytes
-rw-r--r--misc/ui/images/ui-anim_basic_16x16_0.gifbin1553 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_flat_0_aaaaaa_40x100.pngbin180 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_flat_75_ffffff_40x100.pngbin178 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_glass_55_fbf9ee_1x400.pngbin120 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_glass_65_ffffff_1x400.pngbin105 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_glass_75_dadada_1x400.pngbin111 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_glass_75_e6e6e6_1x400.pngbin110 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_glass_95_fef1ec_1x400.pngbin119 -> 0 bytes
-rw-r--r--misc/ui/images/ui-bg_highlight-soft_75_cccccc_1x100.pngbin101 -> 0 bytes
-rw-r--r--misc/ui/images/ui-icons_222222_256x240.pngbin4369 -> 0 bytes
-rw-r--r--misc/ui/images/ui-icons_2e83ff_256x240.pngbin4369 -> 0 bytes
-rw-r--r--misc/ui/images/ui-icons_454545_256x240.pngbin4369 -> 0 bytes
-rw-r--r--misc/ui/images/ui-icons_888888_256x240.pngbin4369 -> 0 bytes
-rw-r--r--misc/ui/images/ui-icons_cd0a0a_256x240.pngbin4369 -> 0 bytes
-rw-r--r--misc/ui/jquery.effects.blind.min.js15
-rw-r--r--misc/ui/jquery.effects.bounce.min.js15
-rw-r--r--misc/ui/jquery.effects.clip.min.js15
-rw-r--r--misc/ui/jquery.effects.core.min.js12
-rw-r--r--misc/ui/jquery.effects.drop.min.js15
-rw-r--r--misc/ui/jquery.effects.explode.min.js15
-rw-r--r--misc/ui/jquery.effects.fade.min.js15
-rw-r--r--misc/ui/jquery.effects.fold.min.js15
-rw-r--r--misc/ui/jquery.effects.highlight.min.js15
-rw-r--r--misc/ui/jquery.effects.pulsate.min.js15
-rw-r--r--misc/ui/jquery.effects.scale.min.js15
-rw-r--r--misc/ui/jquery.effects.shake.min.js15
-rw-r--r--misc/ui/jquery.effects.slide.min.js15
-rw-r--r--misc/ui/jquery.effects.transfer.min.js15
-rw-r--r--misc/ui/jquery.ui.accordion.css12
-rw-r--r--misc/ui/jquery.ui.accordion.min.js16
-rw-r--r--misc/ui/jquery.ui.autocomplete.css37
-rw-r--r--misc/ui/jquery.ui.autocomplete.min.js17
-rw-r--r--misc/ui/jquery.ui.button.css32
-rw-r--r--misc/ui/jquery.ui.button.min.js16
-rw-r--r--misc/ui/jquery.ui.core.css39
-rw-r--r--misc/ui/jquery.ui.core.min.js12
-rw-r--r--misc/ui/jquery.ui.datepicker.css63
-rw-r--r--misc/ui/jquery.ui.datepicker.min.js15
-rw-r--r--misc/ui/jquery.ui.dialog.css15
-rw-r--r--misc/ui/jquery.ui.dialog.min.js21
-rw-r--r--misc/ui/jquery.ui.draggable.min.js17
-rw-r--r--misc/ui/jquery.ui.droppable.min.js18
-rw-r--r--misc/ui/jquery.ui.mouse.min.js15
-rw-r--r--misc/ui/jquery.ui.position.min.js12
-rw-r--r--misc/ui/jquery.ui.progressbar.css6
-rw-r--r--misc/ui/jquery.ui.progressbar.min.js16
-rw-r--r--misc/ui/jquery.ui.resizable.css15
-rw-r--r--misc/ui/jquery.ui.resizable.min.js17
-rw-r--r--misc/ui/jquery.ui.selectable.min.js17
-rw-r--r--misc/ui/jquery.ui.slider.css19
-rw-r--r--misc/ui/jquery.ui.slider.min.js17
-rw-r--r--misc/ui/jquery.ui.sortable.min.js17
-rw-r--r--misc/ui/jquery.ui.tabs.css13
-rw-r--r--misc/ui/jquery.ui.tabs.min.js16
-rw-r--r--misc/ui/jquery.ui.theme.css249
-rw-r--r--misc/ui/jquery.ui.widget.min.js12
-rw-r--r--misc/vertical-tabs-rtl.css15
-rw-r--r--misc/vertical-tabs.css70
-rw-r--r--misc/vertical-tabs.js206
-rw-r--r--misc/watchdog-error.pngbin775 -> 0 bytes
-rw-r--r--misc/watchdog-ok.pngbin409 -> 0 bytes
-rw-r--r--misc/watchdog-warning.pngbin319 -> 0 bytes
-rw-r--r--modules/README.txt10
-rw-r--r--modules/aggregator/aggregator-feed-source.tpl.php35
-rw-r--r--modules/aggregator/aggregator-item.tpl.php46
-rw-r--r--modules/aggregator/aggregator-rtl.css5
-rw-r--r--modules/aggregator/aggregator-summary-item.tpl.php24
-rw-r--r--modules/aggregator/aggregator-summary-items.tpl.php24
-rw-r--r--modules/aggregator/aggregator-wrapper.tpl.php19
-rw-r--r--modules/aggregator/aggregator.admin.inc597
-rw-r--r--modules/aggregator/aggregator.api.php232
-rw-r--r--modules/aggregator/aggregator.css39
-rw-r--r--modules/aggregator/aggregator.fetcher.inc62
-rw-r--r--modules/aggregator/aggregator.info15
-rw-r--r--modules/aggregator/aggregator.install309
-rw-r--r--modules/aggregator/aggregator.module775
-rw-r--r--modules/aggregator/aggregator.pages.inc525
-rw-r--r--modules/aggregator/aggregator.parser.inc325
-rw-r--r--modules/aggregator/aggregator.processor.inc200
-rw-r--r--modules/aggregator/aggregator.test859
-rw-r--r--modules/aggregator/tests/aggregator_test.info8
-rw-r--r--modules/aggregator/tests/aggregator_test.module59
-rw-r--r--modules/aggregator/tests/aggregator_test_atom.xml20
-rw-r--r--modules/aggregator/tests/aggregator_test_rss091.xml30
-rw-r--r--modules/block/block-admin-display-form.tpl.php68
-rw-r--r--modules/block/block.admin.inc643
-rw-r--r--modules/block/block.api.php345
-rw-r--r--modules/block/block.css37
-rw-r--r--modules/block/block.info11
-rw-r--r--modules/block/block.install426
-rw-r--r--modules/block/block.js169
-rw-r--r--modules/block/block.module1016
-rw-r--r--modules/block/block.test612
-rw-r--r--modules/block/block.tpl.php56
-rw-r--r--modules/block/tests/block_test.info8
-rw-r--r--modules/block/tests/block_test.module29
-rw-r--r--modules/blog/blog.info10
-rw-r--r--modules/blog/blog.install17
-rw-r--r--modules/blog/blog.module270
-rw-r--r--modules/blog/blog.pages.inc128
-rw-r--r--modules/blog/blog.test209
-rw-r--r--modules/book/book-all-books-block.tpl.php19
-rw-r--r--modules/book/book-export-html.tpl.php51
-rw-r--r--modules/book/book-navigation.tpl.php52
-rw-r--r--modules/book/book-node-export-html.tpl.php25
-rw-r--r--modules/book/book-rtl.css12
-rw-r--r--modules/book/book.admin.inc261
-rw-r--r--modules/book/book.css55
-rw-r--r--modules/book/book.info12
-rw-r--r--modules/book/book.install89
-rw-r--r--modules/book/book.js23
-rw-r--r--modules/book/book.module1314
-rw-r--r--modules/book/book.pages.inc219
-rw-r--r--modules/book/book.test278
-rw-r--r--modules/color/color-rtl.css45
-rw-r--r--modules/color/color.css82
-rw-r--r--modules/color/color.info10
-rw-r--r--modules/color/color.install40
-rw-r--r--modules/color/color.js244
-rw-r--r--modules/color/color.module724
-rw-r--r--modules/color/color.test88
-rw-r--r--modules/color/images/hook-rtl.pngbin116 -> 0 bytes
-rw-r--r--modules/color/images/hook.pngbin116 -> 0 bytes
-rw-r--r--modules/color/images/lock.pngbin230 -> 0 bytes
-rw-r--r--modules/color/preview.html7
-rw-r--r--modules/color/preview.js35
-rw-r--r--modules/comment/comment-node-form.js32
-rw-r--r--modules/comment/comment-rtl.css6
-rw-r--r--modules/comment/comment-wrapper.tpl.php52
-rw-r--r--modules/comment/comment.admin.inc281
-rw-r--r--modules/comment/comment.api.php141
-rw-r--r--modules/comment/comment.css14
-rw-r--r--modules/comment/comment.info14
-rw-r--r--modules/comment/comment.install533
-rw-r--r--modules/comment/comment.module2617
-rw-r--r--modules/comment/comment.pages.inc120
-rw-r--r--modules/comment/comment.test1259
-rw-r--r--modules/comment/comment.tokens.inc242
-rw-r--r--modules/comment/comment.tpl.php92
-rw-r--r--modules/contact/contact.admin.inc207
-rw-r--r--modules/contact/contact.info12
-rw-r--r--modules/contact/contact.install151
-rw-r--r--modules/contact/contact.module260
-rw-r--r--modules/contact/contact.pages.inc290
-rw-r--r--modules/contact/contact.test415
-rw-r--r--modules/contextual/contextual-rtl.css17
-rw-r--r--modules/contextual/contextual.css101
-rw-r--r--modules/contextual/contextual.info7
-rw-r--r--modules/contextual/contextual.js44
-rw-r--r--modules/contextual/contextual.module159
-rw-r--r--modules/contextual/images/gear-select.pngbin506 -> 0 bytes
-rw-r--r--modules/dashboard/dashboard.api.php43
-rw-r--r--modules/dashboard/dashboard.css133
-rw-r--r--modules/dashboard/dashboard.info10
-rw-r--r--modules/dashboard/dashboard.js219
-rw-r--r--modules/dashboard/dashboard.module498
-rw-r--r--modules/dashboard/dashboard.test60
-rw-r--r--modules/dblog/dblog-rtl.css8
-rw-r--r--modules/dblog/dblog.admin.inc391
-rw-r--r--modules/dblog/dblog.css48
-rw-r--r--modules/dblog/dblog.info10
-rw-r--r--modules/dblog/dblog.install137
-rw-r--r--modules/dblog/dblog.module170
-rw-r--r--modules/dblog/dblog.test581
-rw-r--r--modules/field/field.api.php2441
-rw-r--r--modules/field/field.attach.inc1327
-rw-r--r--modules/field/field.crud.inc1163
-rw-r--r--modules/field/field.default.inc243
-rw-r--r--modules/field/field.form.inc402
-rw-r--r--modules/field/field.info17
-rw-r--r--modules/field/field.info.inc843
-rw-r--r--modules/field/field.install169
-rw-r--r--modules/field/field.module971
-rw-r--r--modules/field/field.multilingual.inc246
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.info11
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.install46
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.module701
-rw-r--r--modules/field/modules/field_sql_storage/field_sql_storage.test395
-rw-r--r--modules/field/modules/list/list.info10
-rw-r--r--modules/field/modules/list/list.module389
-rw-r--r--modules/field/modules/list/tests/list.test185
-rw-r--r--modules/field/modules/list/tests/list_test.info8
-rw-r--r--modules/field/modules/list/tests/list_test.module24
-rw-r--r--modules/field/modules/number/number.info9
-rw-r--r--modules/field/modules/number/number.module435
-rw-r--r--modules/field/modules/options/options.api.php65
-rw-r--r--modules/field/modules/options/options.info10
-rw-r--r--modules/field/modules/options/options.module418
-rw-r--r--modules/field/modules/options/options.test461
-rw-r--r--modules/field/modules/text/text.info10
-rw-r--r--modules/field/modules/text/text.js50
-rw-r--r--modules/field/modules/text/text.module668
-rw-r--r--modules/field/modules/text/text.test479
-rw-r--r--modules/field/tests/field.test2990
-rw-r--r--modules/field/tests/field_test.entity.inc366
-rw-r--r--modules/field/tests/field_test.field.inc361
-rw-r--r--modules/field/tests/field_test.info12
-rw-r--r--modules/field/tests/field_test.install108
-rw-r--r--modules/field/tests/field_test.module216
-rw-r--r--modules/field/tests/field_test.storage.inc475
-rw-r--r--modules/field/theme/field-rtl.css15
-rw-r--r--modules/field/theme/field.css29
-rw-r--r--modules/field/theme/field.tpl.php61
-rw-r--r--modules/field_ui/field_ui-display-overview-table.tpl.php83
-rw-r--r--modules/field_ui/field_ui-rtl.css7
-rw-r--r--modules/field_ui/field_ui.admin.inc1784
-rw-r--r--modules/field_ui/field_ui.api.php201
-rw-r--r--modules/field_ui/field_ui.css51
-rw-r--r--modules/field_ui/field_ui.info10
-rw-r--r--modules/field_ui/field_ui.js225
-rw-r--r--modules/field_ui/field_ui.module368
-rw-r--r--modules/field_ui/field_ui.test400
-rw-r--r--modules/file/file.css36
-rw-r--r--modules/file/file.field.inc972
-rw-r--r--modules/file/file.info11
-rw-r--r--modules/file/file.install61
-rw-r--r--modules/file/file.js141
-rw-r--r--modules/file/file.module972
-rw-r--r--modules/file/icons/application-octet-stream.pngbin189 -> 0 bytes
-rw-r--r--modules/file/icons/application-pdf.pngbin346 -> 0 bytes
-rw-r--r--modules/file/icons/application-x-executable.pngbin189 -> 0 bytes
-rw-r--r--modules/file/icons/audio-x-generic.pngbin314 -> 0 bytes
-rw-r--r--modules/file/icons/image-x-generic.pngbin385 -> 0 bytes
-rw-r--r--modules/file/icons/package-x-generic.pngbin260 -> 0 bytes
-rw-r--r--modules/file/icons/text-html.pngbin265 -> 0 bytes
-rw-r--r--modules/file/icons/text-plain.pngbin220 -> 0 bytes
-rw-r--r--modules/file/icons/text-x-generic.pngbin220 -> 0 bytes
-rw-r--r--modules/file/icons/text-x-script.pngbin276 -> 0 bytes
-rw-r--r--modules/file/icons/video-x-generic.pngbin214 -> 0 bytes
-rw-r--r--modules/file/icons/x-office-document.pngbin196 -> 0 bytes
-rw-r--r--modules/file/icons/x-office-presentation.pngbin181 -> 0 bytes
-rw-r--r--modules/file/icons/x-office-spreadsheet.pngbin183 -> 0 bytes
-rw-r--r--modules/file/tests/file.test782
-rw-r--r--modules/file/tests/file_module_test.info8
-rw-r--r--modules/file/tests/file_module_test.module46
-rw-r--r--modules/filter/filter.admin.inc357
-rw-r--r--modules/filter/filter.admin.js45
-rw-r--r--modules/filter/filter.api.php261
-rw-r--r--modules/filter/filter.css46
-rw-r--r--modules/filter/filter.info13
-rw-r--r--modules/filter/filter.install428
-rw-r--r--modules/filter/filter.js21
-rw-r--r--modules/filter/filter.module1461
-rw-r--r--modules/filter/filter.pages.inc89
-rw-r--r--modules/filter/filter.test1373
-rw-r--r--modules/forum/forum-icon.tpl.php25
-rw-r--r--modules/forum/forum-list.tpl.php72
-rw-r--r--modules/forum/forum-rtl.css18
-rw-r--r--modules/forum/forum-submitted.tpl.php29
-rw-r--r--modules/forum/forum-topic-list.tpl.php69
-rw-r--r--modules/forum/forum.admin.inc314
-rw-r--r--modules/forum/forum.css27
-rw-r--r--modules/forum/forum.info14
-rw-r--r--modules/forum/forum.install333
-rw-r--r--modules/forum/forum.module1268
-rw-r--r--modules/forum/forum.pages.inc29
-rw-r--r--modules/forum/forum.test495
-rw-r--r--modules/forum/forums.tpl.php23
-rw-r--r--modules/help/help-rtl.css11
-rw-r--r--modules/help/help.admin.inc76
-rw-r--r--modules/help/help.api.php63
-rw-r--r--modules/help/help.css10
-rw-r--r--modules/help/help.info9
-rw-r--r--modules/help/help.module64
-rw-r--r--modules/help/help.test121
-rw-r--r--modules/image/image-rtl.css12
-rw-r--r--modules/image/image.admin.css61
-rw-r--r--modules/image/image.admin.inc903
-rw-r--r--modules/image/image.api.php178
-rw-r--r--modules/image/image.css15
-rw-r--r--modules/image/image.effects.inc244
-rw-r--r--modules/image/image.field.inc579
-rw-r--r--modules/image/image.info14
-rw-r--r--modules/image/image.install235
-rw-r--r--modules/image/image.module1147
-rw-r--r--modules/image/image.test833
-rw-r--r--modules/image/sample.pngbin168110 -> 0 bytes
-rw-r--r--modules/locale/locale.admin.inc1450
-rw-r--r--modules/locale/locale.api.php197
-rw-r--r--modules/locale/locale.css35
-rw-r--r--modules/locale/locale.datepicker.js70
-rw-r--r--modules/locale/locale.info11
-rw-r--r--modules/locale/locale.install352
-rw-r--r--modules/locale/locale.module1006
-rw-r--r--modules/locale/locale.test1992
-rw-r--r--modules/locale/tests/locale_test.info8
-rw-r--r--modules/locale/tests/locale_test.module27
-rw-r--r--modules/locale/tests/translations/test.xx.po28
-rw-r--r--modules/menu/menu.admin.inc704
-rw-r--r--modules/menu/menu.admin.js48
-rw-r--r--modules/menu/menu.api.php88
-rw-r--r--modules/menu/menu.css13
-rw-r--r--modules/menu/menu.info11
-rw-r--r--modules/menu/menu.install73
-rw-r--r--modules/menu/menu.js65
-rw-r--r--modules/menu/menu.module752
-rw-r--r--modules/menu/menu.test661
-rw-r--r--modules/node/content_types.inc457
-rw-r--r--modules/node/content_types.js35
-rw-r--r--modules/node/node-rtl.css15
-rw-r--r--modules/node/node.admin.inc621
-rw-r--r--modules/node/node.api.php1172
-rw-r--r--modules/node/node.css27
-rw-r--r--modules/node/node.info15
-rw-r--r--modules/node/node.install714
-rw-r--r--modules/node/node.js36
-rw-r--r--modules/node/node.module3765
-rw-r--r--modules/node/node.pages.inc570
-rw-r--r--modules/node/node.test1833
-rw-r--r--modules/node/node.tokens.inc190
-rw-r--r--modules/node/node.tpl.php112
-rw-r--r--modules/node/tests/node_access_test.info8
-rw-r--r--modules/node/tests/node_access_test.module142
-rw-r--r--modules/node/tests/node_presave_test.info8
-rw-r--r--modules/node/tests/node_presave_test.module18
-rw-r--r--modules/node/tests/node_test.info8
-rw-r--r--modules/node/tests/node_test.module114
-rw-r--r--modules/node/tests/node_test_exception.info8
-rw-r--r--modules/node/tests/node_test_exception.module17
-rw-r--r--modules/openid/login-bg.pngbin205 -> 0 bytes
-rw-r--r--modules/openid/openid-rtl.css19
-rw-r--r--modules/openid/openid.api.php111
-rw-r--r--modules/openid/openid.css47
-rw-r--r--modules/openid/openid.inc685
-rw-r--r--modules/openid/openid.info11
-rw-r--r--modules/openid/openid.install155
-rw-r--r--modules/openid/openid.js50
-rw-r--r--modules/openid/openid.module952
-rw-r--r--modules/openid/openid.pages.inc116
-rw-r--r--modules/openid/openid.test574
-rw-r--r--modules/openid/tests/openid_test.info10
-rw-r--r--modules/openid/tests/openid_test.install18
-rw-r--r--modules/openid/tests/openid_test.module314
-rw-r--r--modules/overlay/images/background.pngbin76 -> 0 bytes
-rw-r--r--modules/overlay/images/close.pngbin344 -> 0 bytes
-rw-r--r--modules/overlay/overlay-child.css140
-rw-r--r--modules/overlay/overlay-child.js180
-rw-r--r--modules/overlay/overlay-parent.css48
-rw-r--r--modules/overlay/overlay-parent.js829
-rw-r--r--modules/overlay/overlay.api.php41
-rw-r--r--modules/overlay/overlay.info8
-rw-r--r--modules/overlay/overlay.install20
-rw-r--r--modules/overlay/overlay.module823
-rw-r--r--modules/overlay/overlay.tpl.php37
-rw-r--r--modules/path/path.admin.inc283
-rw-r--r--modules/path/path.api.php44
-rw-r--r--modules/path/path.info10
-rw-r--r--modules/path/path.js17
-rw-r--r--modules/path/path.module308
-rw-r--r--modules/path/path.test504
-rw-r--r--modules/php/php.info9
-rw-r--r--modules/php/php.install45
-rw-r--r--modules/php/php.module141
-rw-r--r--modules/php/php.test119
-rw-r--r--modules/poll/poll-bar--block.tpl.php27
-rw-r--r--modules/poll/poll-bar.tpl.php27
-rw-r--r--modules/poll/poll-results--block.tpl.php29
-rw-r--r--modules/poll/poll-results.tpl.php29
-rw-r--r--modules/poll/poll-rtl.css11
-rw-r--r--modules/poll/poll-vote.tpl.php30
-rw-r--r--modules/poll/poll.css52
-rw-r--r--modules/poll/poll.info11
-rw-r--r--modules/poll/poll.install199
-rw-r--r--modules/poll/poll.module985
-rw-r--r--modules/poll/poll.pages.inc98
-rw-r--r--modules/poll/poll.test643
-rw-r--r--modules/poll/poll.tokens.inc108
-rw-r--r--modules/profile/profile-block.tpl.php42
-rw-r--r--modules/profile/profile-listing.tpl.php53
-rw-r--r--modules/profile/profile-wrapper.tpl.php25
-rw-r--r--modules/profile/profile.admin.inc436
-rw-r--r--modules/profile/profile.css11
-rw-r--r--modules/profile/profile.info12
-rw-r--r--modules/profile/profile.install173
-rw-r--r--modules/profile/profile.js59
-rw-r--r--modules/profile/profile.module628
-rw-r--r--modules/profile/profile.pages.inc142
-rw-r--r--modules/profile/profile.test486
-rw-r--r--modules/rdf/rdf.api.php112
-rw-r--r--modules/rdf/rdf.info9
-rw-r--r--modules/rdf/rdf.install51
-rw-r--r--modules/rdf/rdf.module848
-rw-r--r--modules/rdf/rdf.test696
-rw-r--r--modules/rdf/tests/rdf_test.info9
-rw-r--r--modules/rdf/tests/rdf_test.install26
-rw-r--r--modules/rdf/tests/rdf_test.module67
-rw-r--r--modules/search/search-block-form.tpl.php41
-rw-r--r--modules/search/search-result.tpl.php62
-rw-r--r--modules/search/search-results.tpl.php34
-rw-r--r--modules/search/search-rtl.css14
-rw-r--r--modules/search/search.admin.inc189
-rw-r--r--modules/search/search.api.php364
-rw-r--r--modules/search/search.css35
-rw-r--r--modules/search/search.extender.inc478
-rw-r--r--modules/search/search.info13
-rw-r--r--modules/search/search.install183
-rw-r--r--modules/search/search.module1242
-rw-r--r--modules/search/search.pages.inc154
-rw-r--r--modules/search/search.test1559
-rw-r--r--modules/search/tests/UnicodeTest.txt333
-rw-r--r--modules/search/tests/search_embedded_form.info8
-rw-r--r--modules/search/tests/search_embedded_form.module70
-rw-r--r--modules/search/tests/search_extra_type.info8
-rw-r--r--modules/search/tests/search_extra_type.module70
-rw-r--r--modules/shortcut/shortcut.admin.css9
-rw-r--r--modules/shortcut/shortcut.admin.inc759
-rw-r--r--modules/shortcut/shortcut.admin.js100
-rw-r--r--modules/shortcut/shortcut.api.php43
-rw-r--r--modules/shortcut/shortcut.css108
-rw-r--r--modules/shortcut/shortcut.info11
-rw-r--r--modules/shortcut/shortcut.install108
-rw-r--r--modules/shortcut/shortcut.module750
-rw-r--r--modules/shortcut/shortcut.pngbin432 -> 0 bytes
-rw-r--r--modules/shortcut/shortcut.test323
-rw-r--r--modules/simpletest/drupal_web_test_case.php3127
-rw-r--r--modules/simpletest/files/README.txt5
-rw-r--r--modules/simpletest/files/css_test_files/comment_hacks.css80
-rw-r--r--modules/simpletest/files/css_test_files/comment_hacks.css.optimized.css3
-rw-r--r--modules/simpletest/files/css_test_files/comment_hacks.css.unoptimized.css80
-rw-r--r--modules/simpletest/files/css_test_files/css_input_with_import.css30
-rw-r--r--modules/simpletest/files/css_test_files/css_input_with_import.css.optimized.css8
-rw-r--r--modules/simpletest/files/css_test_files/css_input_with_import.css.unoptimized.css30
-rw-r--r--modules/simpletest/files/css_test_files/css_input_without_import.css38
-rw-r--r--modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css9
-rw-r--r--modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css38
-rw-r--r--modules/simpletest/files/css_test_files/import1.css6
-rw-r--r--modules/simpletest/files/css_test_files/import2.css5
-rw-r--r--modules/simpletest/files/html-1.txt1
-rw-r--r--modules/simpletest/files/html-2.html1
-rw-r--r--modules/simpletest/files/image-1.pngbin39325 -> 0 bytes
-rw-r--r--modules/simpletest/files/image-2.jpgbin1831 -> 0 bytes
-rw-r--r--modules/simpletest/files/image-test.gifbin183 -> 0 bytes
-rw-r--r--modules/simpletest/files/image-test.jpgbin1901 -> 0 bytes
-rw-r--r--modules/simpletest/files/image-test.pngbin125 -> 0 bytes
-rw-r--r--modules/simpletest/files/javascript-1.txt3
-rw-r--r--modules/simpletest/files/javascript-2.script3
-rw-r--r--modules/simpletest/files/php-1.txt3
-rw-r--r--modules/simpletest/files/php-2.php2
-rw-r--r--modules/simpletest/files/sql-1.txt1
-rw-r--r--modules/simpletest/files/sql-2.sql1
-rw-r--r--modules/simpletest/simpletest.api.php61
-rw-r--r--modules/simpletest/simpletest.css92
-rw-r--r--modules/simpletest/simpletest.info42
-rw-r--r--modules/simpletest/simpletest.install171
-rw-r--r--modules/simpletest/simpletest.js104
-rw-r--r--modules/simpletest/simpletest.module509
-rw-r--r--modules/simpletest/simpletest.pages.inc483
-rw-r--r--modules/simpletest/simpletest.test464
-rw-r--r--modules/simpletest/tests/actions.test127
-rw-r--r--modules/simpletest/tests/actions_loop_test.info8
-rw-r--r--modules/simpletest/tests/actions_loop_test.install12
-rw-r--r--modules/simpletest/tests/actions_loop_test.module95
-rw-r--r--modules/simpletest/tests/ajax.test329
-rw-r--r--modules/simpletest/tests/ajax_forms_test.info8
-rw-r--r--modules/simpletest/tests/ajax_forms_test.module424
-rw-r--r--modules/simpletest/tests/ajax_test.info8
-rw-r--r--modules/simpletest/tests/ajax_test.module57
-rw-r--r--modules/simpletest/tests/batch.test367
-rw-r--r--modules/simpletest/tests/batch_test.callbacks.inc118
-rw-r--r--modules/simpletest/tests/batch_test.info9
-rw-r--r--modules/simpletest/tests/batch_test.module475
-rw-r--r--modules/simpletest/tests/bootstrap.test428
-rw-r--r--modules/simpletest/tests/cache.test351
-rw-r--r--modules/simpletest/tests/common.test1999
-rw-r--r--modules/simpletest/tests/common_test.info8
-rw-r--r--modules/simpletest/tests/common_test.module228
-rw-r--r--modules/simpletest/tests/common_test_info.txt10
-rw-r--r--modules/simpletest/tests/database_test.info9
-rw-r--r--modules/simpletest/tests/database_test.install218
-rw-r--r--modules/simpletest/tests/database_test.module193
-rw-r--r--modules/simpletest/tests/database_test.test3194
-rw-r--r--modules/simpletest/tests/entity_cache_test.info9
-rw-r--r--modules/simpletest/tests/entity_cache_test.module22
-rw-r--r--modules/simpletest/tests/entity_cache_test_dependency.info8
-rw-r--r--modules/simpletest/tests/entity_cache_test_dependency.module19
-rw-r--r--modules/simpletest/tests/entity_query.test930
-rw-r--r--modules/simpletest/tests/error.test120
-rw-r--r--modules/simpletest/tests/error_test.info8
-rw-r--r--modules/simpletest/tests/error_test.module66
-rw-r--r--modules/simpletest/tests/file.test2623
-rw-r--r--modules/simpletest/tests/file_test.info8
-rw-r--r--modules/simpletest/tests/file_test.module445
-rw-r--r--modules/simpletest/tests/filetransfer.test169
-rw-r--r--modules/simpletest/tests/filter_test.info8
-rw-r--r--modules/simpletest/tests/filter_test.module63
-rw-r--r--modules/simpletest/tests/form.test1290
-rw-r--r--modules/simpletest/tests/form_test.file.inc40
-rw-r--r--modules/simpletest/tests/form_test.info9
-rw-r--r--modules/simpletest/tests/form_test.module1286
-rw-r--r--modules/simpletest/tests/graph.test194
-rw-r--r--modules/simpletest/tests/https.php28
-rw-r--r--modules/simpletest/tests/image.test461
-rw-r--r--modules/simpletest/tests/image_test.info8
-rw-r--r--modules/simpletest/tests/image_test.module139
-rw-r--r--modules/simpletest/tests/lock.test58
-rw-r--r--modules/simpletest/tests/mail.test66
-rw-r--r--modules/simpletest/tests/menu.test527
-rw-r--r--modules/simpletest/tests/menu_test.info8
-rw-r--r--modules/simpletest/tests/menu_test.module354
-rw-r--r--modules/simpletest/tests/module.test205
-rw-r--r--modules/simpletest/tests/module_test.file.inc14
-rw-r--r--modules/simpletest/tests/module_test.info9
-rw-r--r--modules/simpletest/tests/module_test.install43
-rw-r--r--modules/simpletest/tests/module_test.module49
-rw-r--r--modules/simpletest/tests/path.test238
-rw-r--r--modules/simpletest/tests/registry.test143
-rw-r--r--modules/simpletest/tests/requirements1_test.info9
-rw-r--r--modules/simpletest/tests/requirements1_test.install22
-rw-r--r--modules/simpletest/tests/requirements1_test.module8
-rw-r--r--modules/simpletest/tests/requirements2_test.info10
-rw-r--r--modules/simpletest/tests/requirements2_test.module8
-rw-r--r--modules/simpletest/tests/schema.test199
-rw-r--r--modules/simpletest/tests/session.test424
-rw-r--r--modules/simpletest/tests/session_test.info8
-rw-r--r--modules/simpletest/tests/session_test.module167
-rw-r--r--modules/simpletest/tests/system_dependencies_test.info9
-rw-r--r--modules/simpletest/tests/system_dependencies_test.module2
-rw-r--r--modules/simpletest/tests/system_test.info8
-rw-r--r--modules/simpletest/tests/system_test.module313
-rw-r--r--modules/simpletest/tests/taxonomy_test.info9
-rw-r--r--modules/simpletest/tests/taxonomy_test.install35
-rw-r--r--modules/simpletest/tests/taxonomy_test.module82
-rw-r--r--modules/simpletest/tests/theme.test218
-rw-r--r--modules/simpletest/tests/theme_test.info8
-rw-r--r--modules/simpletest/tests/theme_test.module107
-rw-r--r--modules/simpletest/tests/unicode.test306
-rw-r--r--modules/simpletest/tests/update.test116
-rw-r--r--modules/simpletest/tests/update_test_1.info9
-rw-r--r--modules/simpletest/tests/update_test_1.install54
-rw-r--r--modules/simpletest/tests/update_test_1.module2
-rw-r--r--modules/simpletest/tests/update_test_2.info9
-rw-r--r--modules/simpletest/tests/update_test_2.install54
-rw-r--r--modules/simpletest/tests/update_test_2.module2
-rw-r--r--modules/simpletest/tests/update_test_3.info9
-rw-r--r--modules/simpletest/tests/update_test_3.install25
-rw-r--r--modules/simpletest/tests/update_test_3.module2
-rw-r--r--modules/simpletest/tests/upgrade/drupal-6.bare.database.php8132
-rw-r--r--modules/simpletest/tests/upgrade/drupal-6.filled.database.php22683
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.poll.test65
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.test382
-rw-r--r--modules/simpletest/tests/url_alter_test.info9
-rw-r--r--modules/simpletest/tests/url_alter_test.install13
-rw-r--r--modules/simpletest/tests/url_alter_test.module68
-rw-r--r--modules/simpletest/tests/xmlrpc.test214
-rw-r--r--modules/simpletest/tests/xmlrpc_test.info8
-rw-r--r--modules/simpletest/tests/xmlrpc_test.module89
-rw-r--r--modules/statistics/statistics.admin.inc275
-rw-r--r--modules/statistics/statistics.info13
-rw-r--r--modules/statistics/statistics.install147
-rw-r--r--modules/statistics/statistics.module431
-rw-r--r--modules/statistics/statistics.pages.inc92
-rw-r--r--modules/statistics/statistics.test421
-rw-r--r--modules/statistics/statistics.tokens.inc64
-rw-r--r--modules/syslog/syslog.info8
-rw-r--r--modules/syslog/syslog.install16
-rw-r--r--modules/syslog/syslog.module110
-rw-r--r--modules/syslog/syslog.test37
-rw-r--r--modules/system/admin-rtl.css50
-rw-r--r--modules/system/admin.css140
-rw-r--r--modules/system/html.tpl.php54
-rw-r--r--modules/system/image.gd.inc357
-rw-r--r--modules/system/maintenance-page.tpl.php94
-rw-r--r--modules/system/maintenance.css52
-rw-r--r--modules/system/page.tpl.php151
-rw-r--r--modules/system/region.tpl.php32
-rw-r--r--modules/system/system-behavior-rtl.css89
-rw-r--r--modules/system/system-behavior.css315
-rw-r--r--modules/system/system-menus-rtl.css16
-rw-r--r--modules/system/system-menus.css50
-rw-r--r--modules/system/system-messages.css36
-rw-r--r--modules/system/system-rtl.css74
-rw-r--r--modules/system/system.admin.inc3194
-rw-r--r--modules/system/system.api.php3973
-rw-r--r--modules/system/system.archiver.inc135
-rw-r--r--modules/system/system.cron.js20
-rw-r--r--modules/system/system.css416
-rw-r--r--modules/system/system.info19
-rw-r--r--modules/system/system.install2890
-rw-r--r--modules/system/system.js225
-rw-r--r--modules/system/system.mail.inc113
-rw-r--r--modules/system/system.module3712
-rw-r--r--modules/system/system.queue.inc370
-rw-r--r--modules/system/system.tar.inc1892
-rw-r--r--modules/system/system.test1884
-rw-r--r--modules/system/system.tokens.inc274
-rw-r--r--modules/system/system.updater.inc151
-rw-r--r--modules/system/theme.api.php224
-rw-r--r--modules/taxonomy/taxonomy-term.tpl.php51
-rw-r--r--modules/taxonomy/taxonomy.admin.inc1023
-rw-r--r--modules/taxonomy/taxonomy.api.php187
-rw-r--r--modules/taxonomy/taxonomy.css14
-rw-r--r--modules/taxonomy/taxonomy.info13
-rw-r--r--modules/taxonomy/taxonomy.install534
-rw-r--r--modules/taxonomy/taxonomy.js41
-rw-r--r--modules/taxonomy/taxonomy.module1598
-rw-r--r--modules/taxonomy/taxonomy.pages.inc129
-rw-r--r--modules/taxonomy/taxonomy.test1099
-rw-r--r--modules/taxonomy/taxonomy.tokens.inc190
-rw-r--r--modules/toolbar/toolbar.css155
-rw-r--r--modules/toolbar/toolbar.info7
-rw-r--r--modules/toolbar/toolbar.js107
-rw-r--r--modules/toolbar/toolbar.module353
-rw-r--r--modules/toolbar/toolbar.pngbin330 -> 0 bytes
-rw-r--r--modules/toolbar/toolbar.tpl.php38
-rw-r--r--modules/tracker/tracker.css8
-rw-r--r--modules/tracker/tracker.info10
-rw-r--r--modules/tracker/tracker.install222
-rw-r--r--modules/tracker/tracker.module366
-rw-r--r--modules/tracker/tracker.pages.inc127
-rw-r--r--modules/tracker/tracker.test245
-rw-r--r--modules/translation/translation.info10
-rw-r--r--modules/translation/translation.module453
-rw-r--r--modules/translation/translation.pages.inc66
-rw-r--r--modules/translation/translation.test175
-rw-r--r--modules/trigger/tests/trigger_test.info7
-rw-r--r--modules/trigger/tests/trigger_test.module134
-rw-r--r--modules/trigger/trigger.admin.inc308
-rw-r--r--modules/trigger/trigger.api.php79
-rw-r--r--modules/trigger/trigger.info11
-rw-r--r--modules/trigger/trigger.install71
-rw-r--r--modules/trigger/trigger.module623
-rw-r--r--modules/trigger/trigger.test736
-rw-r--r--modules/update/tests/aaa_update_test.1_0.xml34
-rw-r--r--modules/update/tests/aaa_update_test.info7
-rw-r--r--modules/update/tests/aaa_update_test.module7
-rw-r--r--modules/update/tests/aaa_update_test.no-releases.xml2
-rw-r--r--modules/update/tests/aaa_update_test.tar.gzbin383 -> 0 bytes
-rw-r--r--modules/update/tests/bbb_update_test.1_0.xml34
-rw-r--r--modules/update/tests/bbb_update_test.info7
-rw-r--r--modules/update/tests/bbb_update_test.module7
-rw-r--r--modules/update/tests/ccc_update_test.1_0.xml34
-rw-r--r--modules/update/tests/ccc_update_test.info7
-rw-r--r--modules/update/tests/ccc_update_test.module7
-rw-r--r--modules/update/tests/drupal.0.xml34
-rw-r--r--modules/update/tests/drupal.1.xml51
-rw-r--r--modules/update/tests/drupal.2-sec.xml69
-rw-r--r--modules/update/tests/drupal.dev.xml50
-rw-r--r--modules/update/tests/update_test.info8
-rw-r--r--modules/update/tests/update_test.module75
-rw-r--r--modules/update/tests/update_test_basetheme.1_1-sec.xml52
-rw-r--r--modules/update/tests/update_test_subtheme.1_0.xml34
-rw-r--r--modules/update/update-rtl.css32
-rw-r--r--modules/update/update.api.php132
-rw-r--r--modules/update/update.authorize.inc303
-rw-r--r--modules/update/update.compare.inc780
-rw-r--r--modules/update/update.css125
-rw-r--r--modules/update/update.fetch.inc389
-rw-r--r--modules/update/update.info16
-rw-r--r--modules/update/update.install192
-rw-r--r--modules/update/update.manager.inc776
-rw-r--r--modules/update/update.module778
-rw-r--r--modules/update/update.report.inc322
-rw-r--r--modules/update/update.settings.inc121
-rw-r--r--modules/update/update.test536
-rw-r--r--modules/user/user-picture.tpl.php22
-rw-r--r--modules/user/user-profile-category.tpl.php34
-rw-r--r--modules/user/user-profile-item.tpl.php27
-rw-r--r--modules/user/user-profile.tpl.php38
-rw-r--r--modules/user/user-rtl.css22
-rw-r--r--modules/user/user.admin.inc1057
-rw-r--r--modules/user/user.api.php419
-rw-r--r--modules/user/user.css67
-rw-r--r--modules/user/user.info14
-rw-r--r--modules/user/user.install774
-rw-r--r--modules/user/user.js176
-rw-r--r--modules/user/user.module3686
-rw-r--r--modules/user/user.pages.inc546
-rw-r--r--modules/user/user.permissions.js40
-rw-r--r--modules/user/user.test1811
-rw-r--r--modules/user/user.tokens.inc131
-rw-r--r--profiles/minimal/minimal.info8
-rw-r--r--profiles/minimal/minimal.install76
-rw-r--r--profiles/minimal/minimal.profile12
-rw-r--r--profiles/standard/standard.info24
-rw-r--r--profiles/standard/standard.install439
-rw-r--r--profiles/standard/standard.profile12
-rw-r--r--profiles/testing/testing.info6
-rw-r--r--profiles/testing/testing.install17
-rw-r--r--profiles/testing/testing.profile3
-rw-r--r--robots.txt60
-rw-r--r--scripts/code-clean.sh10
-rw-r--r--scripts/cron-curl.sh4
-rw-r--r--scripts/cron-lynx.sh4
-rwxr-xr-xscripts/drupal.sh145
-rw-r--r--scripts/dump-database-d6.sh103
-rw-r--r--scripts/generate-d6-content.sh169
-rwxr-xr-xscripts/password-hash.sh91
-rwxr-xr-xscripts/run-tests.sh584
-rw-r--r--sites/all/README.txt8
-rw-r--r--sites/all/modules/README.txt5
-rw-r--r--sites/all/themes/README.txt5
-rw-r--r--sites/default/default.settings.php431
-rw-r--r--sites/example.sites.php44
-rw-r--r--themes/README.txt10
-rw-r--r--themes/bartik/bartik.info39
-rw-r--r--themes/bartik/color/base.pngbin661 -> 0 bytes
-rw-r--r--themes/bartik/color/color.inc134
-rw-r--r--themes/bartik/color/preview.css62
-rw-r--r--themes/bartik/color/preview.html105
-rw-r--r--themes/bartik/color/preview.js37
-rw-r--r--themes/bartik/color/preview.pngbin661 -> 0 bytes
-rw-r--r--themes/bartik/css/colors.css50
-rw-r--r--themes/bartik/css/ie-rtl.css8
-rw-r--r--themes/bartik/css/ie.css21
-rw-r--r--themes/bartik/css/ie6.css11
-rw-r--r--themes/bartik/css/layout-rtl.css15
-rw-r--r--themes/bartik/css/layout.css73
-rw-r--r--themes/bartik/css/maintenance-page.css63
-rw-r--r--themes/bartik/css/print.css47
-rw-r--r--themes/bartik/css/style-rtl.css271
-rw-r--r--themes/bartik/css/style.css1335
-rw-r--r--themes/bartik/images/add.pngbin170 -> 0 bytes
-rw-r--r--themes/bartik/images/buttons.pngbin2972 -> 0 bytes
-rw-r--r--themes/bartik/images/comment-arrow-rtl.pngbin265 -> 0 bytes
-rw-r--r--themes/bartik/images/comment-arrow.pngbin268 -> 0 bytes
-rw-r--r--themes/bartik/images/search-button.pngbin692 -> 0 bytes
-rw-r--r--themes/bartik/images/tabs-border.pngbin198 -> 0 bytes
-rw-r--r--themes/bartik/logo.pngbin4360 -> 0 bytes
-rw-r--r--themes/bartik/screenshot.pngbin21091 -> 0 bytes
-rw-r--r--themes/bartik/template.php145
-rw-r--r--themes/bartik/templates/comment-wrapper.tpl.php54
-rw-r--r--themes/bartik/templates/comment.tpl.php102
-rw-r--r--themes/bartik/templates/maintenance-page.tpl.php93
-rw-r--r--themes/bartik/templates/node.tpl.php126
-rw-r--r--themes/bartik/templates/page.tpl.php243
-rw-r--r--themes/engines/phptemplate/phptemplate.engine26
-rw-r--r--themes/garland/color/base.pngbin20894 -> 0 bytes
-rw-r--r--themes/garland/color/color.inc221
-rw-r--r--themes/garland/color/preview.css61
-rw-r--r--themes/garland/color/preview.pngbin9965 -> 0 bytes
-rw-r--r--themes/garland/comment.tpl.php32
-rw-r--r--themes/garland/fix-ie-rtl.css62
-rw-r--r--themes/garland/fix-ie.css66
-rw-r--r--themes/garland/garland.info10
-rw-r--r--themes/garland/images/bg-bar-white.pngbin103 -> 0 bytes
-rw-r--r--themes/garland/images/bg-bar.pngbin125 -> 0 bytes
-rw-r--r--themes/garland/images/bg-content-left.pngbin2889 -> 0 bytes
-rw-r--r--themes/garland/images/bg-content-right.pngbin2819 -> 0 bytes
-rw-r--r--themes/garland/images/bg-content.pngbin485 -> 0 bytes
-rw-r--r--themes/garland/images/bg-navigation-item-hover.pngbin441 -> 0 bytes
-rw-r--r--themes/garland/images/bg-navigation-item.pngbin499 -> 0 bytes
-rw-r--r--themes/garland/images/bg-navigation.pngbin104 -> 0 bytes
-rw-r--r--themes/garland/images/bg-tab.pngbin115 -> 0 bytes
-rw-r--r--themes/garland/images/body.pngbin680 -> 0 bytes
-rw-r--r--themes/garland/images/gradient-inner.pngbin188 -> 0 bytes
-rw-r--r--themes/garland/images/menu-collapsed-rtl.gifbin176 -> 0 bytes
-rw-r--r--themes/garland/images/menu-collapsed.gifbin176 -> 0 bytes
-rw-r--r--themes/garland/images/menu-expanded.gifbin183 -> 0 bytes
-rw-r--r--themes/garland/images/menu-leaf.gifbin175 -> 0 bytes
-rw-r--r--themes/garland/images/task-list.pngbin128 -> 0 bytes
-rw-r--r--themes/garland/logo.pngbin5116 -> 0 bytes
-rw-r--r--themes/garland/maintenance-page.tpl.php88
-rw-r--r--themes/garland/node.tpl.php35
-rw-r--r--themes/garland/page.tpl.php69
-rw-r--r--themes/garland/print.css62
-rw-r--r--themes/garland/screenshot.pngbin10950 -> 0 bytes
-rw-r--r--themes/garland/style-rtl.css345
-rw-r--r--themes/garland/style.css1298
-rw-r--r--themes/garland/template.php149
-rw-r--r--themes/garland/theme-settings.php25
-rw-r--r--themes/seven/ie.css12
-rw-r--r--themes/seven/ie6.css20
-rw-r--r--themes/seven/images/add.pngbin160 -> 0 bytes
-rw-r--r--themes/seven/images/arrow-asc.pngbin88 -> 0 bytes
-rw-r--r--themes/seven/images/arrow-desc.pngbin95 -> 0 bytes
-rw-r--r--themes/seven/images/arrow-next.pngbin118 -> 0 bytes
-rw-r--r--themes/seven/images/arrow-prev.pngbin115 -> 0 bytes
-rw-r--r--themes/seven/images/buttons.pngbin786 -> 0 bytes
-rw-r--r--themes/seven/images/list-item.pngbin195 -> 0 bytes
-rw-r--r--themes/seven/images/task-check.pngbin261 -> 0 bytes
-rw-r--r--themes/seven/images/task-item.pngbin105 -> 0 bytes
-rw-r--r--themes/seven/images/ui-icons-222222-256x240.pngbin4369 -> 0 bytes
-rw-r--r--themes/seven/images/ui-icons-454545-256x240.pngbin4369 -> 0 bytes
-rw-r--r--themes/seven/images/ui-icons-800000-256x240.pngbin4369 -> 0 bytes
-rw-r--r--themes/seven/images/ui-icons-888888-256x240.pngbin4369 -> 0 bytes
-rw-r--r--themes/seven/images/ui-icons-ffffff-256x240.pngbin4369 -> 0 bytes
-rw-r--r--themes/seven/jquery.ui.theme.css433
-rw-r--r--themes/seven/logo.pngbin3905 -> 0 bytes
-rw-r--r--themes/seven/maintenance-page.tpl.php48
-rw-r--r--themes/seven/page.tpl.php35
-rw-r--r--themes/seven/reset.css222
-rw-r--r--themes/seven/screenshot.pngbin12298 -> 0 bytes
-rw-r--r--themes/seven/seven.info16
-rw-r--r--themes/seven/style.css1045
-rw-r--r--themes/seven/template.php104
-rw-r--r--themes/seven/vertical-tabs.css69
-rw-r--r--themes/stark/README.txt26
-rw-r--r--themes/stark/layout.css58
-rw-r--r--themes/stark/logo.pngbin2326 -> 0 bytes
-rw-r--r--themes/stark/screenshot.pngbin11662 -> 0 bytes
-rw-r--r--themes/stark/stark.info8
-rw-r--r--themes/tests/README.txt5
-rw-r--r--themes/tests/test_theme/template.php22
-rw-r--r--themes/tests/test_theme/test_theme.info6
-rw-r--r--themes/tests/update_test_basetheme/update_test_basetheme.info6
-rw-r--r--themes/tests/update_test_subtheme/update_test_subtheme.info7
-rw-r--r--update.php441
-rw-r--r--web.config43
-rw-r--r--xmlrpc.php21
938 files changed, 0 insertions, 268379 deletions
diff --git a/.htaccess b/.htaccess
deleted file mode 100644
index ab8fe8d..0000000
--- a/.htaccess
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# Apache/PHP/Drupal settings:
-#
-
-# Protect files and directories from prying eyes.
-<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
- Order allow,deny
-</FilesMatch>
-
-# Don't show directory listings for URLs which map to a directory.
-Options -Indexes
-
-# Follow symbolic links in this directory.
-Options +FollowSymLinks
-
-# Make Drupal handle any 404 errors.
-ErrorDocument 404 /index.php
-
-# Force simple error message for requests for non-existent favicon.ico.
-<Files favicon.ico>
- # There is no end quote below, for compatibility with Apache 1.3.
- ErrorDocument 404 "The requested file favicon.ico was not found.
-</Files>
-
-# Set the default handler.
-DirectoryIndex index.php index.html index.htm
-
-# Override PHP settings that cannot be changed at runtime. See
-# sites/default/default.settings.php and drupal_initialize_variables() in
-# includes/bootstrap.inc for settings that can be changed at runtime.
-
-# PHP 5, Apache 1 and 2.
-<IfModule mod_php5.c>
- php_flag magic_quotes_gpc off
- php_flag magic_quotes_sybase off
- php_flag register_globals off
- php_flag session.auto_start off
- php_value mbstring.http_input pass
- php_value mbstring.http_output pass
- php_flag mbstring.encoding_translation off
-</IfModule>
-
-# Requires mod_expires to be enabled.
-<IfModule mod_expires.c>
- # Enable expirations.
- ExpiresActive On
-
- # Cache all files for 2 weeks after access (A).
- ExpiresDefault A1209600
-
- <FilesMatch \.php$>
- # Do not allow PHP scripts to be cached unless they explicitly send cache
- # headers themselves. Otherwise all scripts would have to overwrite the
- # headers set by mod_expires if they want another caching behavior. This may
- # fail if an error occurs early in the bootstrap process, and it may cause
- # problems if a non-Drupal PHP file is installed in a subdirectory.
- ExpiresActive Off
- </FilesMatch>
-</IfModule>
-
-# Various rewrite rules.
-<IfModule mod_rewrite.c>
- RewriteEngine on
-
- # Block access to "hidden" directories whose names begin with a period. This
- # includes directories used by version control systems such as Subversion or
- # Git to store control files. Files whose names begin with a period, as well
- # as the control files used by CVS, are protected by the FilesMatch directive
- # above.
- #
- # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
- # not possible to block access to entire directories from .htaccess, because
- # <DirectoryMatch> is not allowed here.
- #
- # If you do not have mod_rewrite installed, you should remove these
- # directories from your webroot or otherwise protect them from being
- # downloaded.
- RewriteRule "(^|/)\." - [F]
-
- # If your site can be accessed both with and without the 'www.' prefix, you
- # can use one of the following settings to redirect users to your preferred
- # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
- #
- # To redirect all users to access the site WITH the 'www.' prefix,
- # (http://example.com/... will be redirected to http://www.example.com/...)
- # uncomment the following:
- # RewriteCond %{HTTP_HOST} !^www\. [NC]
- # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
- #
- # To redirect all users to access the site WITHOUT the 'www.' prefix,
- # (http://www.example.com/... will be redirected to http://example.com/...)
- # uncomment the following:
- # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
-
- # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
- # VirtualDocumentRoot and the rewrite rules are not working properly.
- # For example if your site is at http://example.com/drupal uncomment and
- # modify the following line:
- # RewriteBase /drupal
- #
- # If your site is running in a VirtualDocumentRoot at http://example.com/,
- # uncomment the following line:
- # RewriteBase /
-
- # Pass all requests not referring directly to files in the filesystem to
- # index.php. Clean URLs are handled in drupal_environment_initialize().
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !=/favicon.ico
- RewriteRule ^ index.php [L]
-</IfModule>
-
-# $Id$
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index 4aec58f..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,1045 +0,0 @@
-// $Id$
-
-Drupal 7.0, xxxx-xx-xx (development version)
-----------------------
-- Database:
- * Fully rewritten database layer utilizing PHP 5's PDO abstraction layer.
- * Drupal now requires MySQL >= 5.0.15 or PostgreSQL >= 8.3.
- * Added query builders for INSERT, UPDATE, DELETE, MERGE, and SELECT queries.
- * Support for master/slave replication, transactions, multi-insert queries,
- and other features.
- * Added support for the SQLite database engine.
- * Default to InnoDB engine, rather than MyISAM, on MySQL when available.
- This offers increased scalability and data integrity.
-- Security:
- * Protected cron.php -- cron will only run if the proper key is provided.
- * Implemented a pluggable password system and much stronger password hashes
- that are compatible with the Portable PHP password hashing framework.
- * Rate limited login attempts to prevent brute-force password guessing, and
- improved the flood control API to allow variable time windows and
- identifiers for limiting user access to resources.
- * Transformed the "Update status" module into the "Update manager" which
- can securely install or update modules and themes via a web interface.
-- Usability:
- * Added contextual links (a.k.a. local tasks) to page elements, such as
- blocks, nodes, or comments, which allows to perform the most common tasks
- with a single click only.
- * Improved installer requirements check.
- * Improved support for integration of WYSIWYG editors.
- * Implemented drag-and-drop positioning for input format listings.
- * Implemented drag-and-drop positioning for language listing.
- * Implemented drag-and-drop positioning for poll options.
- * Provided descriptions and human-readable names for user permissions.
- * Removed comment controls for users.
- * Removed display order settings for comment module. Comment display
- order can now be customized using the Views module.
- * Removed the 'related terms' feature from taxonomy module since this can
- now be achieved with Field API.
- * Added additional features to the default install profile, and implemented
- a "slimmed down" install profile designed for developers.
- * Added a built-in, automated cron run feature, which is triggered by site
- visitors.
- * Added an administrator role which is assigned all permissions for
- installed modules automatically.
- * Image toolkits are now provided by modules (rather than requiring a
- manual file copy to the includes directory).
- * Added an edit tab to taxonomy term pages.
- * Redesigned password strength validator.
- * Redesigned the add content type screen.
- * Highlight duplicate URL aliases.
- * Renamed "input formats" to "text formats".
- * Moved text format permissions to the main permissions page.
- * Added configurable ability for users to cancel their own accounts.
- * Added "vertical tabs", a reusable interface component that features
- automatic summaries and increases usability.
- * Replaced fieldsets on node edit and add pages with vertical tabs.
-- Performance:
- * Improved performance on uncached page views by loading multiple core
- objects in a single database query.
- * Improved performance for logged-in users by reducing queries for path
- alias lookups.
- * Improved support for HTTP proxies (including reverse proxies), allowing
- anonymous page views to be served entirely from the proxy.
-- Documentation:
- * Hook API documentation now included in Drupal core.
-- News aggregator:
- * Added OPML import functionality for RSS feeds.
- * Optionally, RSS feeds may be configured to not automatically generate feed blocks.
-- Search:
- * Added support for language-aware searches.
-- Aggregator:
- * Introduced architecture that allows pluggable parsers and processors for
- syndicating RSS and Atom feeds.
- * Added options to suspend updating specific feeds and never discard feeds
- items.
-- Testing:
- * Added test framework and tests.
-- Improved time zone support:
- * Drupal now uses PHP's time zone database when rendering dates in local
- time. Site-wide and user-configured time zone offsets have been converted
- to time zone names, e.g. Africa/Abidjan.
- * In some cases the upgrade and install scripts do not choose the preferred
- site default time zone. The automatically-selected time zone can be
- corrected at admin/config/regional/settings.
- * If your site is being upgraded from Drupal 6 and you do not have the
- contributed date or event modules installed, user time zone settings will
- fallback to the system time zone and will have to be reconfigured by each user.
- * User-configured time zones now serve as the default time zone for PHP
- date/time functions.
-- Filter system:
- * Revamped the filter API and text format storage.
- * Added support for default text formats to be assigned on a per-role basis.
- * Refactored the HTML corrector to take advantage of PHP 5 features.
-- User system:
- * Added clean API functions for creating, loading, updating, and deleting
- user roles and permissions.
- * Refactored the "access rules" component of user module: The user module
- now provides a simple interface for blocking single IP addresses. The
- previous functionality in the user module for restricting certain e-mail
- addresses and usernames is now available as a contributed module. Further,
- IP address range blocking is no longer supported and should be implemented
- at the operating system level.
- * Removed per-user themes: Contributed modules with similar functionality
- are available.
-- OpenID:
- * Added support for Gmail and Google Apps for Domain identifiers. Users can
- now login with their user@domain.com identifier when domain.com is powered
- by Google.
- * Made the OpenID module more pluggable.
-- Added code registry:
- * Using the registry, modules declare their includable files via their .info file,
- allowing Drupal to lazy-load classes and interfaces as needed.
-- Theme system:
- * Removed the Bluemarine, Chameleon and Pushbutton themes. These themes live
- on as contributed themes (http://drupal.org/project/bluemarine,
- http://drupal.org/project/chameleon and http://drupal.org/project/pushbutton).
- * Added Stark theme to make analyzing Drupal's default HTML and CSS easier.
- * Added Seven theme as the default administration interface theme.
- * Variable preprocessing of theme hooks prior to template rendering now goes
- through two phases: a 'preprocess' phase and a new 'process' phase. See
- http://api.drupal.org/api/function/theme/7 for details.
- * Theme hooks implemented as functions (rather than as templates) can now
- also have preprocess (and process) functions. See
- http://api.drupal.org/api/function/theme/7 for details.
-- File handling:
- * Files are now first class Drupal objects with file_load(), file_save(),
- and file_validate() functions and corresponding hooks.
- * The file_move(), file_copy() and file_delete() functions now operate on
- file objects and invoke file hooks so that modules are notified and can
- respond to changes.
- * For the occasions when only basic file manipulation are needed--such as
- uploading a site logo--that don't require the overhead of databases and
- hooks, the current unmanaged copy, move and delete operations have been
- preserved but renamed to file_unmanaged_*().
- * Rewrote file handling to use PHP stream wrappers to enable support for
- both public and private files and to support pluggable storage mechanisms
- and access to remote resources (e.g. S3 storage or Flickr photos).
- * The mime_extension_mapping variable has been removed. Modules that need to
- alter the default MIME type extension mappings should implement
- hook_file_mimetype_mapping_alter().
- * Added the hook_file_url_alter() hook, which makes it possible to serve
- files from a CDN.
- * Added a field specifically for uploading files, previously provided by
- the contributed module FileField.
-- Image handling:
- * Improved image handling, including better support for add-on image
- libraries.
- * Added API and interface for creating advanced image thumbnails.
- * Inclusion of additional effects such as rotate and desaturate.
- * Added a field specifically for uploading images, previously provided by
- the contributed module ImageField.
-- Added aliased multi-site support:
- * Added support for mapping domain names to sites directories.
-- Added RDF support:
- * Modules can declare RDF namespaces which are serialized in the <html> tag
- for RDFa support.
- * Modules can specify how their data structure maps to RDF.
- * Added support for RDFa export of nodes, comments, terms, users, etc. and
- their fields.
-- Search engine optimization and web linking:
- * Added a rel="canonical" link on node and comment pages to prevent
- duplicate content indexing by search engines.
- * Added a default rel="shortlink" link on node and comment pages that
- advertises a short link as an alternative URL to third-party services.
- * Meta information is now alterable by all modules before rendering.
-- Field API:
- * Custom data fields may be attached to nodes, users, comments and taxonomy
- terms.
- * Node bodies and teasers are now Field API fields instead of
- being a hard-coded property of node objects.
- * In addition, any other object type may register with Field API
- and allow custom data fields to be attached to itself.
- * Provides most of the features of the former Content Construction
- Kit (CCK) module.
- * Taxonomy terms are now Field API fields that can be added to any fieldable
- object.
-- Installer:
- * Refactored the installer into an API that allows Drupal to be installed
- via a command line script.
-- Page organization
- * Made the help text area a full featured region with blocks.
- * Site mission is replaced with the highlighted content block region and
- separate RSS feed description settings.
- * The footer message setting was removed in favor of custom blocks.
- * Made the main page content a block which can be moved and ordered
- with other blocks in the same region.
- * Blocks can now return structured arrays for later rendering just
- like page callbacks.
-- Translation system
- * The translation system now supports message context (msgctxt).
- * Added support for translatable fields to Field API.
-- JavaScript changes
- * Upgraded the core JavaScript library to jQuery version 1.4.2.
- * Upgraded the jQuery Forms library to 2.36.
- * Added jQuery UI 1.8, which allows improvements to Drupal's user
- experience.
-- Better module version support
- * Modules now can specify which version of another module they depend on.
-- Removed modules from core
- * The following modules have been removed from core, because contributed
- modules with similar functionality are available:
- * Blog API module
- * Ping module
- * Throttle module
-- Improved node access control system.
- * All modules may now influence the access to a node at runtime, not just
- the module that defined a node.
- * Users may now be allowed to bypass node access restrictions without giving
- them complete access to the site.
- * Access control affects both published and unpublished nodes.
- * Numerous other improvements to the node access system.
-- Actions system
- * Simplified definitions of actions and triggers.
- * Removed dependency on the combination of hooks and operations. Triggers
- now directly map to module hooks.
-- Task handling
- * Added a queue API to process many or long-running tasks.
- * Added queue API support to cron API.
- * Added a locking framework to coordinate long-running operations across
- requests.
-
-Drupal 6.0, 2008-02-13
-----------------------
-- New, faster and better menu system.
-- New watchdog as a hook functionality.
- * New hook_watchdog that can be implemented by any module to route log
- messages to various destinations.
- * Expands the severity levels from 3 (Error, Warning, Notice) to the 8
- levels defined in RFC 3164.
- * The watchdog module is now called dblog, and is optional, but enabled by
- default in the default install profile.
- * Extended the database log module so log messages can be filtered.
- * Added syslog module: useful for monitoring large Drupal installations.
-- Added optional e-mail notifications when users are approved, blocked, or
- deleted.
-- Drupal works with error reporting set to E_ALL.
-- Added scripts/drupal.sh to execute Drupal code from the command line. Useful
- to use Drupal as a framework to build command-line tools.
-- Made signature support optional and made it possible to theme signatures.
-- Made it possible to filter the URL aliases on the URL alias administration
- screen.
-- Language system improvements:
- * Support for right to left languages.
- * Language detection based on parts of the URL.
- * Browser based language detection.
- * Made it possible to specify a node's language.
- * Support for translating posts on the site to different languages.
- * Language dependent path aliases.
- * Automatically import translations when adding a new language.
- * JavaScript interface translation.
- * Automatically import a module's translation upon enabling that module.
-- Moved "PHP input filter" to a standalone module so it can be deleted for
- security reasons.
-- Usability:
- * Improved handling of teasers in posts.
- * Added sticky table headers.
- * Check for clean URL support automatically with JavaScript.
- * Removed default/settings.php. Instead the installer will create it from
- default.settings.php.
- * Made it possible to configure your own date formats.
- * Remember anonymous comment posters.
- * Only allow modules and themes to be enabled that have explicitly been
- ported to the correct core API version.
- * Can now specify the minimum PHP version required for a module within the
- .info file.
- * Drupal core no longer requires CREATE TEMPORARY TABLES or LOCK TABLES
- database rights.
- * Dynamically check password strength and confirmation.
- * Refactored poll administration.
- * Implemented drag-and-drop positioning for blocks, menu items, taxonomy
- vocabularies and terms, forums, profile fields, and input format filters.
-- Theme system:
- * Added .info files to themes and made it easier to specify regions and
- features.
- * Added theme registry: modules can directly provide .tpl.php files for
- their themes without having to create theme_ functions.
- * Used the Garland theme for the installation and maintenance pages.
- * Added theme preprocess functions for themes that are templates.
- * Added support for themeable functions in JavaScript.
-- Refactored update.php to a generic batch API to be able to run time-consuming
- operations in multiple subsequent HTTP requests.
-- Installer:
- * Themed the installer with the Garland theme.
- * Added form to provide initial site information during installation.
- * Added ability to provide extra installation steps programmatically.
- * Made it possible to import interface translations at install time.
-- Added the HTML corrector filter:
- * Fixes faulty and chopped off HTML in postings.
- * Tags are now automatically closed at the end of the teaser.
-- Performance:
- * Made it easier to conditionally load .include files and split up many core
- modules.
- * Added a JavaScript aggregator.
- * Added block-level caching, improving performance for both authenticated
- and anonymous users.
- * Made Drupal work correctly when running behind a reverse proxy like
- Squid or Pound.
-- File handling improvements:
- * Entries in the files table are now keyed to a user instead of a node.
- * Added reusable validation functions to check for uploaded file sizes,
- extensions, and image resolution.
- * Added ability to create and remove temporary files during a cron job.
-- Forum improvements:
- * Any node type may now be posted in a forum.
-- Taxonomy improvements:
- * Descriptions for terms are now shown on taxonomy/term pages as well
- as RSS feeds.
- * Added versioning support to categories by associating them with node
- revisions.
-- Added support for OpenID.
-- Added support for triggering configurable actions.
-- Added the Update status module to automatically check for available updates
- and warn sites if they are missing security updates or newer versions.
- Sites deploying from CVS should use http://drupal.org/project/cvs_deploy.
- Advanced settings provided by http://drupal.org/project/update_advanced.
-- Upgraded the core JavaScript library to jQuery version 1.2.3.
-- Added a new Schema API, which provides built-in support for core and
- contributed modules to work with databases other than MySQL.
-- Removed drupal.module. The functionality lives on as the Site network
- contributed module (http://drupal.org/project/site_network).
-- Removed old system updates. Updates from Drupal versions prior to 5.x will
- require upgrading to 5.x before upgrading to 6.x.
-
-Drupal 5.7, 2008-01-28
-----------------------
-- fixed the input format configuration page.
-- fixed a variety of small bugs.
-
-Drupal 5.6, 2008-01-10
-----------------------
-- fixed a variety of small bugs.
-- fixed a security issue (Cross site request forgery), see SA-2008-005
-- fixed a security issue (Cross site scripting, UTF8), see SA-2008-006
-- fixed a security issue (Cross site scripting, register_globals), see SA-2008-007
-
-Drupal 5.5, 2007-12-06
-----------------------
-- fixed missing missing brackets in a query in the user module.
-- fixed taxonomy feed bug introduced by SA-2007-031
-
-Drupal 5.4, 2007-12-05
-----------------------
-- fixed a variety of small bugs.
-- fixed a security issue (SQL injection), see SA-2007-031
-
-Drupal 5.3, 2007-10-17
-----------------------
-- fixed a variety of small bugs.
-- fixed a security issue (HTTP response splitting), see SA-2007-024
-- fixed a security issue (Arbitrary code execution via installer), see SA-2007-025
-- fixed a security issue (Cross site scripting via uploads), see SA-2007-026
-- fixed a security issue (User deletion cross site request forgery), see SA-2007-029
-- fixed a security issue (API handling of unpublished comment), see SA-2007-030
-
-Drupal 5.2, 2007-07-26
-----------------------
-- changed hook_link() $teaser argument to match documentation.
-- fixed a variety of small bugs.
-- fixed a security issue (cross-site request forgery), see SA-2007-017
-- fixed a security issue (cross-site scripting), see SA-2007-018
-
-Drupal 5.1, 2007-01-29
-----------------------
-- fixed security issue (code execution), see SA-2007-005
-- fixed a variety of small bugs.
-
-Drupal 5.0, 2007-01-15
-----------------------
-- Completely retooled the administration page
- * /Admin now contains an administration page which may be themed
- * Reorganised administration menu items by task and by module
- * Added a status report page with detailed PHP/MySQL/Drupal information
-- Added web-based installer which can:
- * Check installation and run-time requirements
- * Automatically generate the database configuration file
- * Install pre-made 'install profiles' or distributions
- * Import the database structure with automatic table prefixing
- * Be localized
-- Added new default Garland theme
-- Added color module to change some themes' color schemes
-- Included the jQuery JavaScript library 1.0.4 and converted all core JavaScript to use it
-- Introduced the ability to alter mail sent from system
-- Module system:
- * Added .info files for module meta-data
- * Added support for module dependencies
- * Improved module installation screen
- * Moved core modules to their own directories
- * Added support for module uninstalling
-- Added support for different cache backends
-- Added support for a generic "sites/all" directory.
-- Usability:
- * Added support for auto-complete forms (AJAX) to user profiles.
- * Made it possible to instantly assign roles to newly created user accounts.
- * Improved configurability of the contact forms.
- * Reorganized the settings pages.
- * Made it easy to investigate popular search terms.
- * Added a 'select all' checkbox and a range select feature to administration tables.
- * Simplified the 'break' tag to split teasers from body.
- * Use proper capitalization for titles, menu items and operations.
-- Integrated urlfilter.module into filter.module
-- Block system:
- * Extended the block visibility settings with a role specific setting.
- * Made it possible to customize all block titles.
-- Poll module:
- * Optionally allow people to inspect all votes.
- * Optionally allow people to cancel their vote.
-- Distributed authentication:
- * Added default server option.
-- Added default robots.txt to control crawlers.
-- Database API:
- * Added db_table_exists().
-- Blogapi module:
- * 'Blogapi new' and 'blogapi edit' nodeapi operations.
-- User module:
- * Added hook_profile_alter().
- * E-mail verification is made optional.
- * Added mass editing and filtering on admin/user/user.
-- PHP Template engine:
- * Add the ability to look for a series of suggested templates.
- * Look for page templates based upon the path.
- * Look for block templates based upon the region, module, and delta.
-- Content system:
- * Made it easier for node access modules to work well with each other.
- * Added configurable content types.
- * Changed node rendering to work with structured arrays.
-- Performance:
- * Improved session handling: reduces database overhead.
- * Improved access checking: reduces database overhead.
- * Made it possible to do memcached based session management.
- * Omit sidebars when serving a '404 - Page not found': saves CPU cycles and bandwidth.
- * Added an 'aggressive' caching policy.
- * Added a CSS aggregator and compressor (up to 40% faster page loads).
-- Removed the archive module.
-- Upgrade system:
- * Created space for update branches.
-- Forms API:
- * Made it possible to programmatically submit forms.
- * Improved api for multistep forms.
-- Theme system:
- * Split up and removed drupal.css.
- * Added nested lists generation.
- * Added a self-clearing block class.
-
-Drupal 4.7.11, 2008-01-10
--------------------------
-- fixed a security issue (Cross site request forgery), see SA-2008-005
-- fixed a security issue (Cross site scripting, UTF8), see SA-2008-006
-- fixed a security issue (Cross site scripting, register_globals), see SA-2008-007
-
-Drupal 4.7.10, 2007-12-06
--------------------------
-- fixed taxonomy feed bug introduced by SA-2007-031
-
-Drupal 4.7.9, 2007-12-05
-------------------------
-- fixed a security issue (SQL injection), see SA-2007-031
-
-Drupal 4.7.8, 2007-10-17
-----------------------
-- fixed a security issue (HTTP response splitting), see SA-2007-024
-- fixed a security issue (Cross site scripting via uploads), see SA-2007-026
-- fixed a security issue (API handling of unpublished comment), see SA-2007-030
-
-Drupal 4.7.7, 2007-07-26
-------------------------
-- fixed security issue (XSS), see SA-2007-018
-
-Drupal 4.7.6, 2007-01-29
-------------------------
-- fixed security issue (code execution), see SA-2007-005
-
-Drupal 4.7.5, 2007-01-05
-------------------------
-- Fixed security issue (XSS), see SA-2007-001
-- Fixed security issue (DoS), see SA-2007-002
-
-Drupal 4.7.4, 2006-10-18
-------------------------
-- Fixed security issue (XSS), see SA-2006-024
-- Fixed security issue (CSRF), see SA-2006-025
-- Fixed security issue (Form action attribute injection), see SA-2006-026
-
-Drupal 4.7.3, 2006-08-02
-------------------------
-- Fixed security issue (XSS), see SA-2006-011
-
-Drupal 4.7.2, 2006-06-01
-------------------------
-- Fixed critical upload issue, see SA-2006-007
-- Fixed taxonomy XSS issue, see SA-2006-008
-- Fixed a variety of small bugs.
-
-Drupal 4.7.1, 2006-05-24
-------------------------
-- Fixed critical SQL issue, see SA-2006-005
-- Fixed a serious upgrade related bug.
-- Fixed a variety of small bugs.
-
-Drupal 4.7.0, 2006-05-01
-------------------------
-- Added free tagging support.
-- Added a site-wide contact form.
-- Theme system:
- * Added the PHPTemplate theme engine and removed the Xtemplate engine.
- * Converted the bluemarine theme from XTemplate to PHPTemplate.
- * Converted the pushbutton theme from XTemplate to PHPTemplate.
-- Usability:
- * Reworked the 'request new password' functionality.
- * Reworked the node and comment edit forms.
- * Made it easy to add nodes to the navigation menu.
- * Added site 'offline for maintenance' feature.
- * Added support for auto-complete forms (AJAX).
- * Added support for collapsible page sections (JS).
- * Added support for resizable text fields (JS).
- * Improved file upload functionality (AJAX).
- * Reorganized some settings pages.
- * Added friendly database error screens.
- * Improved styling of update.php.
-- Refactored the forms API.
- * Made it possible to alter, extend or theme forms.
-- Comment system:
- * Added support for "mass comment operations" to ease repetitive tasks.
- * Comment moderation has been removed.
-- Node system:
- * Reworked the revision functionality.
- * Removed the bookmarklet code. Third-party modules can now handle
- This.
-- Upgrade system:
- * Allows contributed modules to plug into the upgrade system.
-- Profiles:
- * Added a block to display author information along with posts.
- * Added support for private profile fields.
-- Statistics module:
- * Added the ability to track page generation times.
- * Made it possible to block certain IPs/hostnames.
-- Block system:
- * Added support for theme-specific block regions.
-- Syndication:
- * Made the aggregator module parse Atom feeds.
- * Made the aggregator generate RSS feeds.
- * Added RSS feed settings.
-- XML-RPC:
- * Replaced the XML-RPC library by a better one.
-- Performance:
- * Added 'loose caching' option for high-traffic sites.
- * Improved performance of path aliasing.
- * Added the ability to track page generation times.
-- Internationalization:
- * Improved Unicode string handling API.
- * Added support for PHP's multibyte string module.
-- Added support for PHP5's 'mysqli' extension.
-- Search module:
- * Made indexer smarter and more robust.
- * Added advanced search operators (e.g. phrase, node type, ...).
- * Added customizable result ranking.
-- PostgreSQL support:
- * Removed dependency on PL/pgSQL procedural language.
-- Menu system:
- * Added support for external URLs.
-- Queue module:
- * Removed from core.
-- HTTP handling:
- * Added support for a tolerant Base URL.
- * Output URIs relative to the root, without a base tag.
-
-Drupal 4.6.11, 2007-01-05
--------------------------
-- Fixed security issue (XSS), see SA-2007-001
-- Fixed security issue (DoS), see SA-2007-002
-
-Drupal 4.6.10, 2006-10-18
-------------------------
-- Fixed security issue (XSS), see SA-2006-024
-- Fixed security issue (CSRF), see SA-2006-025
-- Fixed security issue (Form action attribute injection), see SA-2006-026
-
-Drupal 4.6.9, 2006-08-02
-------------------------
-- Fixed security issue (XSS), see SA-2006-011
-
-Drupal 4.6.8, 2006-06-01
-------------------------
-- Fixed critical upload issue, see SA-2006-007
-- Fixed taxonomy XSS issue, see SA-2006-008
-
-Drupal 4.6.7, 2006-05-24
-------------------------
-- Fixed critical SQL issue, see SA-2006-005
-
-Drupal 4.6.6, 2006-03-13
-------------------------
-- Fixed bugs, including 4 security vulnerabilities.
-
-Drupal 4.6.5, 2005-12-12
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.6.4, 2005-11-30
-------------------------
-- Fixed bugs, including 3 security vulnerabilities.
-
-Drupal 4.6.3, 2005-08-15
-------------------------
-- Fixed bugs, including a critical "arbitrary PHP code execution" bug.
-
-Drupal 4.6.2, 2005-06-29
-------------------------
-- Fixed bugs, including two critical "arbitrary PHP code execution" bugs.
-
-Drupal 4.6.1, 2005-06-01
-------------------------
-- Fixed bugs, including a critical input validation bug.
-
-Drupal 4.6.0, 2005-04-15
-------------------------
-- PHP5 compliance
-- Search:
- * Added UTF-8 support to make it work with all languages.
- * Improved search indexing algorithm.
- * Improved search output.
- * Impose a throttle on indexing of large sites.
- * Added search block.
-- Syndication:
- * Made the ping module ping pingomatic.com which, in turn, will ping all the major ping services.
- * Made Drupal generate RSS 2.0 feeds.
- * Made RSS feeds extensible.
- * Added categories to RSS feeds.
- * Added enclosures to RSS feeds.
-- Flood control mechanism:
- * Added a mechanism to throttle certain operations.
-- Usability:
- * Refactored the block configuration pages.
- * Refactored the statistics pages.
- * Refactored the watchdog pages.
- * Refactored the throttle module configuration.
- * Refactored the access rules page.
- * Refactored the content administration page.
- * Introduced forum configuration pages.
- * Added a 'add child page' link to book pages.
-- Contact module:
- * Added a simple contact module that allows users to contact each other using e-mail.
-- Multi-site configuration:
- * Made it possible to run multiple sites from a single code base.
-- Added an image API: enables better image handling.
-- Block system:
- * Extended the block visibility settings.
-- Theme system:
- * Added new theme functions.
-- Database backend:
- * The PEAR database backend is no longer supported.
-- Performance:
- * Improved performance of the forum topics block.
- * Improved performance of the tracker module.
- * Improved performance of the node pages.
-- Documentation:
- * Improved and extended PHPDoc/Doxygen comments.
-
-Drupal 4.5.8, 2006-03-13
-------------------------
-- Fixed bugs, including 3 security vulnerabilities.
-
-Drupal 4.5.7, 2005-12-12
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.5.6, 2005-11-30
-------------------------
-- Fixed bugs, including 3 security vulnerabilities.
-
-Drupal 4.5.5, 2005-08-15
-------------------------
-- Fixed bugs, including a critical "arbitrary PHP code execution" bug.
-
-Drupal 4.5.4, 2005-06-29
-------------------------
-- Fixed bugs, including two critical "arbitrary PHP code execution" bugs.
-
-Drupal 4.5.3, 2005-06-01
-------------------------
-- Fixed bugs, including a critical input validation bug.
-
-Drupal 4.5.2, 2005-01-15
-------------------------
-- Fixed bugs: a cross-site scripting (XSS) vulnerability has been fixed.
-
-Drupal 4.5.1, 2004-12-01
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.5.0, 2004-10-18
-------------------------
-- Navigation:
- * Made it possible to add, delete, rename and move menu items.
- * Introduced tabs and subtabs for local tasks.
- * Reorganized the navigation menus.
-- User management:
- * Added support for multiple roles per user.
- * Made it possible to add custom profile fields.
- * Made it possible to browse user profiles by field.
-- Node system:
- * Added support for node-level permissions.
-- Comment module:
- * Made it possible to leave contact information without having to register.
-- Upload module:
- * Added support for uploading documents (includes images).
-- Forum module:
- * Added support for sticky forum topics.
- * Made it possible to track forum topics.
-- Syndication:
- * Added support for RSS ping-notifications of http://technorati.com/.
- * Refactored the categorization of syndicated news items.
- * Added an URL alias for 'rss.xml'.
- * Improved date parsing.
-- Database backend:
- * Added support for multiple database connections.
- * The PostgreSQL backend does no longer require PEAR.
-- Theme system:
- * Changed all GIFs to PNGs.
- * Reorganised the handling of themes, template engines, templates and styles.
- * Unified and extended the available theme settings.
- * Added theme screenshots.
-- Blocks:
- * Added 'recent comments' block.
- * Added 'categories' block.
-- Blogger API:
- * Added support for auto-discovery of blogger API via RSD.
-- Performance:
- * Added support for sending gzip compressed pages.
- * Improved performance of the forum module.
-- Accessibility:
- * Improved the accessibility of the archive module's calendar.
- * Improved form handling and error reporting.
- * Added HTTP redirects to prevent submitting twice when refreshing right after a form submission.
-- Refactored 403 (forbidden) handling and added support for custom 403 pages.
-- Documentation:
- * Added PHPDoc/Doxygen comments.
-- Filter system:
- * Added support for using multiple input formats on the site
- * Expanded the embedded PHP-code feature so it can be used everywhere
- * Added support for role-dependant filtering, through input formats
-- UI translation:
- * Managing translations is now completely done through the administration interface
- * Added support for importing/exporting gettext .po files
-
-Drupal 4.4.3, 2005-06-01
-------------------------
-- Fixed bugs, including a critical input validation bug.
-
-Drupal 4.4.2, 2004-07-04
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.4.1, 2004-05-01
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.4.0, 2004-04-01
-------------------------
-- Added support for the MetaWeblog API and MovableType extensions.
-- Added a file API: enables better document management.
-- Improved the watchdog and search module to log search keys.
-- News aggregator:
- * Added support for conditional GET.
- * Added OPML feed subscription list.
- * Added support for <image>, <pubDate>, <dc:date>, <dcterms:created>, <dcterms:issued> and <dcterms:modified>.
-- Comment module:
- * Made it possible to disable the "comment viewing controls".
-- Performance:
- * Improved module loading when serving cached pages.
- * Made it possible to automatically disable modules when under heavy load.
- * Made it possible to automatically disable blocks when under heavy load.
- * Improved performance and memory footprint of the locale module.
-- Theme system:
- * Made all theme functions start with 'theme_'.
- * Made all theme functions return their output.
- * Migrated away from using the BaseTheme class.
- * Added many new theme functions and refactored existing theme functions.
- * Added avatar support to 'Xtemplate'.
- * Replaced theme 'UnConeD' by 'Chameleon'.
- * Replaced theme 'Marvin' by 'Pushbutton'.
-- Usability:
- * Added breadcrumb navigation to all pages.
- * Made it possible to add context-sensitive help to all pages.
- * Replaced drop-down menus by radio buttons where appropriate.
- * Removed the 'magic_quotes_gpc = 0' requirement.
- * Added a 'book navigation' block.
-- Accessibility:
- * Made themes degrade gracefully in absence of CSS.
- * Grouped form elements using '<fieldset>' and '<legend>' tags.
- * Added '<label>' tags to form elements.
-- Refactored 404 (file not found) handling and added support for custom 404 pages.
-- Improved the filter system to prevent conflicts between filters:
- * Made it possible to change the order in which filters are applied.
-- Documentation:
- * Added PHPDoc/Doxygen comments.
-
-Drupal 4.3.2, 2004-01-01
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.3.1, 2003-12-01
-------------------------
-- Fixed bugs: no critical bugs were identified.
-
-Drupal 4.3.0, 2003-11-01
-------------------------
-- Added support for configurable URLs.
-- Added support for sortable table columns.
-- Database backend:
- * Added support for selective database table prefixing.
-- Performance:
- * Optimized many SQL queries for speed by converting left joins to inner joins.
-- Comment module:
- * Rewrote the comment housekeeping code to be much more efficient and scalable.
- * Changed the comment module to use the standard pager.
-- User module:
- * Added support for multiple sessions per user.
- * Added support for anonymous user sessions.
-- Forum module:
- * Improved the forum views and the themability thereof.
-- Book module:
- * Improved integration of non-book nodes in the book outline.
-- Usability:
- * Added support for "mass node operations" to ease repetitive tasks.
- * Added support for breadcrumb navigation to several modules' user pages.
- * Integrated the administration pages with the normal user pages.
-
-Drupal 4.2.0, 2003-08-01
-------------------------
-- Added support for clean URLs.
-- Added textarea hook and support for onload attributes: enables integration of WYSIWYG editors.
-- Rewrote the RSS/RDF parser:
- * It will now use PHP's built-in XML parser to parse news feeds.
-- Rewrote the administration pages:
- * Improved the navigational elements and added breadcrumb navigation.
- * Improved the look and feel.
- * Added context-sensitive help.
-- Database backend:
- * Fixed numerous SQL queries to make Drupal ANSI compliant.
- * Added MSSQL database scheme.
-- Search module:
- * Changed the search module to use implicit AND'ing instead of implicit OR'ing.
-- Node system:
- * Replaced the "post content" permission by more fine-grained permissions.
- * Improved content submission:
- + Improved teasers: teasers are now optional, teaser length can be configured, teaser and body are edited in a single textarea, users will no longer be bothered with teasers when the post is too short for one.
- + Added the ability to preview both the short and the full version of your posts.
- * Extended the node API which allows for better integration.
- * Added default node settings to control the behavior for promotion, moderation and other options.
-- Themes:
- * Replaced theme "Goofy" by "Xtemplate", a template driven theme.
-- Removed the 'register_globals = on' requirement.
-- Added better installation instructions.
-
-Drupal 4.1.0, 2003-02-01
-------------------------
-- Collaboratively revised and expanded the Drupal documentation.
-- Rewrote comment.module:
- * Reintroduced comment rating/moderation.
- * Added support for comment paging.
- * Performance improvements: improved comment caching, faster SQL queries, etc.
-- Rewrote block.module:
- * Performance improvements: blocks are no longer rendered when not displayed.
-- Rewrote forum.module:
- * Added a lot of features one can find in stand-alone forum software including but not limited to support for topic paging, added support for icons, rewrote the statistics module, etc.
-- Rewrote statistics.module:
- * Collects access counts for each node, referrer logs, number of users/guests.
- * Export blocks displaying top viewed nodes over last 24 hour period, top viewed nodes over all time, last nodes viewed, how many users/guest online.
-- Added throttle.module:
- * Auto-throttle congestion control mechanism: Drupal can adapt itself based on the server load.
-- Added profile.module:
- * Enables to extend the user and registration page.
-- Added pager support to the main page.
-- Replaced weblogs.module by ping.module:
- * Added support for normal and RSS notifications of http://blo.gs/.
- * Added support for RSS ping-notifications of http://weblogs.com/.
-- Removed the rating module
-- Themes:
- * Removed a significant portion of hard-coded mark-up.
-
-Drupal 4.0.0, 2002-06-15
-------------------------
-- Added tracker.module:
- * Replaces the previous "your [site]" links (recent comments and nodes).
-- Added weblogs.module:
- * This will ping weblogs.com when new content is promoted.
-- Added taxonomy module which replaces the meta module.
- * Supports relations, hierarchies and synonyms.
-- Added a caching system:
- * Speeds up pages for anonymous users and reduces system load.
-- Added support for external SMTP libraries.
-- Added an archive extension to the calendar.
-- Added support for the Blogger API.
-- Themes:
- * Cleaned up the theme system.
- * Moved themes that are not maintained to contributions CVS repository.
-- Database backend:
- * Changed to PEAR database abstraction layer.
- * Using ANSI SQL queries to be more portable.
-- Rewrote the user system:
- * Added support for Drupal authentication through XML-RPC and through a Jabber server.
- * Added support for modules to add more user data.
- * Users may delete their own account.
- * Added who's new and who's online blocks.
-- Changed block system:
- * Various hard coded blocks are now dynamic.
- * Blocks can now be enabled and/or be set by the user.
- * Blocks can be set to only show up on some pages.
- * Merged box module with block module.
-- Node system:
- * Blogs can be updated.
- * Teasers (abstracts) on all node types.
- * Improved error checking.
- * Content versioning support.
- * Usability improvements.
-- Improved book module to support text, HTML and PHP pages.
-- Improved comment module to mark new comments.
-- Added a general outliner which will let any node type be linked to a book.
-- Added an update script that lets you upgrade from previous releases or on a day to day basis when using the development tree.
-- Search module:
- * Improved the search system by making it context sensitive.
- * Added indexing.
-- Various updates:
- * Changed output to valid XHTML.
- * Improved multiple sites using the same Drupal database support.
- * Added support for session IDs in URLs instead of cookies.
- * Made the type of content on the front page configurable.
- * Made each cloud site have its own settings.
- * Modules and themes can now be enabled/disabled using the administration pages.
- * Added URL abstraction for links.
- * Usability changes (renamed links, better UI, etc).
-- Collaboratively revised and expanded the Drupal documentation.
-
-Drupal 3.0.1, 2001-10-15
-------------------------
-- Various updates:
- * Added missing translations
- * Updated the themes: tidied up some HTML code and added new Drupal logos.
-
-Drupal 3.0.0, 2001-09-15
-------------------------
-- Major overhaul of the entire underlying design:
- * Everything is based on nodes: nodes are a conceptual "black box" to couple and manage different types of content and that promotes reusing existing code, thus reducing the complexity and size of Drupal as well as improving long-term stability.
-- Rewrote submission/moderation queue and renamed it to queue.module.
-- Removed FAQ and documentation module and merged them into a "book module".
-- Removed ban module and integrated it into account.module as "access control":
- * Access control is based on much more powerful regular expressions (regex) now rather than on MySQL pattern matching.
-- Rewrote watchdog and submission throttle:
- * Improved watchdog messages and added watchdog filter.
-- Rewrote headline code and renamed it to import.module and export.module:
- * Added various improvements, including a better parser, bundles and better control over individual feeds.
-- Rewrote section code and renamed it to meta.module:
- * Supports unlimited amount of nested topics. Topics can be nested to create a multi-level hierarchy.
-- Rewrote configuration file resolving:
- * Drupal tries to locate a configuration file that matches your domain name or uses conf.php if the former failed. Note also that the configuration files got renamed from .conf to .php for security's sake on mal-configured Drupal sites.
-- Added caching support which makes Drupal extremely scalable.
-- Added access.module:
- * Allows you to set up 'roles' (groups) and to bind a set of permissions to each group.
-- Added blog.module.
-- Added poll.module.
-- Added system.module:
- * Moved most of the configuration options from hostname.conf to the new administration section.
- * Added support for custom "filters".
-- Added statistics.module
-- Added moderate.module:
- * Allows to assign users editorial/moderator rights to certain nodes or topics.
-- Added page.module:
- * Allows creation of static (and dynamic) pages through the administration interface.
-- Added help.module:
- * Groups all available module documentation on a single page.
-- Added forum.module:
- * Added an integrated forum.
-- Added cvs.module and cvs-to-sql.pl:
- * Allows to display and mail CVS log messages as daily digests.
-- Added book.module:
- * Allows collaborative handbook writing: primary used for Drupal documentation.
-- Removed cron.module and integrated it into conf.module.
-- Removed module.module as it was no longer needed.
-- Various updates:
- * Added "auto-post new submissions" feature versus "moderate new submissions".
- * Introduced links/Drupal tags: [[link]]
- * Added preview functionality when submitting new content (such as a story) from the administration pages.
- * Made the administration section only show those links a user has access to.
- * Made all modules use specific form_* functions to guarantee a rock-solid forms and more consistent layout.
- * Improved scheduler:
- + Content can be scheduled to be 'posted', 'queued' and 'hidden'.
- * Improved account module:
- + Added "access control" to allow/deny certain usernames/e-mail addresses/hostnames.
- * Improved locale module:
- + Added new overview to easy the translation process.
- * Improved comment module:
- + Made it possible to permanently delete comments.
- * Improved rating module
- * Improved story module:
- + Added preview functionality for administrators.
- + Made it possible to permanently delete stories.
- * Improved themes:
- + W3C validation on a best effort basis.
- + Removed $theme->control() from themes.
- + Added theme "goofy".
-- Collaboratively revised and expanded the Drupal documentation.
-
-Drupal 2.0.0, 2001-03-15
-------------------------
-- Rewrote the comment/discussion code:
- * Comment navigation should be less confusing now.
- * Additional/alternative display and order methods have been added.
- * Modules can be extended with a "comment system": modules can embed the existing comment system without having to write their own, duplicate comment system.
-- Added sections and section manager:
- * Story sections can be maintained from the administration pages.
- * Story sections make the open submission more adaptive in that you can set individual post, dump and expiration thresholds for each section according to the story type and urgency level: stories in certain sections do not "expire" and might stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.
-- Multiple vhosts + multiple directories:
- * You can set up multiple Drupal sites on top of the same physical source tree either by using vhosts or sub-directories.
-- Added "user ratings" similar to SlashCode's Karma or Scoop's Mojo:
- * All rating logic is packed into a module to ease experimenting with different rating heuristics/algorithms.
-- Added "search infrastructure":
- * Improved search page and integrated search functionality in the administration pages.
-- Added translation / localization / internationalization support:
- * Because many people would love to see their website showing a lot less of English, and far more of their own language, Drupal provides a framework to set up a multi-lingual website or to overwrite the default English text in English.
-- Added fine-grained user permission (or group) system:
- * Users can be granted access to specific administration sections. Example: a FAQ maintainer can be given access to maintain the FAQ and translators can be given access to the translation pages.
-- Added FAQ module
-- Changed the "open submission queue" into a (optional) module.
-- Various updates:
- * Improved account module:
- + User accounts can be deleted.
- + Added fine-grained permission support.
- * Improved block module
- * Improved diary module:
- + Diary entries can be deleted
- * Improved headline module:
- + Improved parser to support more "generic" RDF/RSS/XML backend.
- * Improved module module
- * Improved watchdog module
- * Improved database abstraction layer
- * Improved themes:
- + W3C validation on a best effort basis
- + Added theme "example" (alias "Stone Age")
- * Added new scripts to directory "scripts"
- * Added directory "misc"
- * Added CREDITS file
-- Revised documentation
-
-Drupal 1.0.0, 2001-01-15
-------------------------
-- Initial release
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
deleted file mode 100644
index f416955..0000000
--- a/COPYRIGHT.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-// $Id$
-
-All Drupal code is Copyright 2001 - 2010 by the original authors.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program as the file LICENSE.txt; if not, please see
-http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-
-Drupal is a registered trademark of Dries Buytaert.
-
-Drupal includes works under other copyright notices and distributed
-according to the terms of the GNU General Public License or a compatible
-license, including:
-
- jQuery - Copyright (c) 2008 - 2009 John Resig
-
diff --git a/INSTALL.mysql.txt b/INSTALL.mysql.txt
deleted file mode 100644
index 56bf414..0000000
--- a/INSTALL.mysql.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id$
-
-CREATE THE MySQL DATABASE
---------------------------
-
-This step is only necessary if you don't already have a database set-up (e.g. by
-your host). In the following examples, 'username' is an example MySQL user which
-has the CREATE and GRANT privileges. Use the appropriate user name for your
-system.
-
-First, you must create a new database for your Drupal site (here, 'databasename'
-is the name of the new database):
-
- mysqladmin -u username -p create databasename
-
-MySQL will prompt for the 'username' database password and then create the
-initial database files. Next you must log in and set the access database rights:
-
- mysql -u username -p
-
-Again, you will be asked for the 'username' database password. At the MySQL
-prompt, enter following command:
-
- GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
- ON databasename.*
- TO 'username'@'localhost' IDENTIFIED BY 'password';
-
-where
-
- 'databasename' is the name of your database
- 'username@localhost' is the username of your MySQL account
- 'password' is the password required for that username
-
-Note: Unless your database user has all of the privileges listed above, you will
-not be able to run Drupal.
-
-If successful, MySQL will reply with:
-
- Query OK, 0 rows affected
-
-If the InnoDB storage engine is available, it will be used for all database
-tables. InnoDB provides features over MyISAM such as transaction support,
-row-level locks, and consistent non-locking reads.
diff --git a/INSTALL.pgsql.txt b/INSTALL.pgsql.txt
deleted file mode 100644
index a2aeaea..0000000
--- a/INSTALL.pgsql.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-// $Id$
-
-CREATE THE PostgreSQL DATABASE
-------------------------------
-
-Note that the database must be created with UTF-8 (Unicode) encoding.
-
-1. CREATE DATABASE USER
-
- This step is only necessary if you don't already have a user set up (e.g.
- by your host) or you want to create new user for use with Drupal only. The
- following command creates a new user named "username" and asks for a
- password for that user:
-
- createuser --pwprompt --encrypted --no-createrole --no-createdb username
-
- If there are no errors then the command was successful
-
-2. CREATE THE DRUPAL DATABASE
-
- This step is only necessary if you don't already have a database set up (e.g.
- by your host) or you want to create new database for use with Drupal only.
- The following command creates a new database named "databasename", which is
- owned by previously created "username":
-
- createdb --encoding=UTF8 --owner=username databasename
-
- If there are no errors then the command was successful
-
-3. CREATE A SCHEMA OR SCHEMAS (Optional advanced)
-
- Drupal will run across different schemas within your database if you so wish.
- By default, Drupal runs inside the 'public' schema but you can use $db_prefix
- inside settings.php to define a schema for Drupal to inside of or specify tables
- that are shared inside of a separate schema. Drupal will not create schemas for
- you, infact the user that Drupal runs as should not be allowed to. You'll need
- execute the SQL below as a superuser (such as a postgres user) and replace
- 'drupaluser' with the username that Drupal uses to connect to PostgreSQL with
- and replace schema_name with a schema name you wish to use such as 'shared':
-
- CREATE SCHEMA schema_name AUTHORIZATION drupaluser;
-
- Do this for as many schemas as you need. See default.settings.php for how to
- set which tables use which schemas.
diff --git a/INSTALL.sqlite.txt b/INSTALL.sqlite.txt
deleted file mode 100644
index 5497387..0000000
--- a/INSTALL.sqlite.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-// $Id$
-
-SQLITE REQUIREMENTS
--------------------
-
-To use SQLite with your Drupal installation, the following requirements must
-be met: server has PHP 5.2 or later with PDO, and the PDO SQLite driver must
-be enabled.
-
-SQLITE DATABASE CREATION
-------------------------
-
-The Drupal installer will create the SQLite database for you. The only
-requirement is the installer must have write permissions the directory where
-the database file resides.
-
-On the "Database configuration" form in the "Database name" field, you must
-supply the exact path to where you wish your database file to reside. It is
-strongly suggested that you choose a path that is outside of the webroot, yet
-ensure that the directory is writeable by the web server.
-
-If you must place your database file in your webroot, you could try using the
-following in your "Database name" field:
-
- sites/default/files/.ht.sqlite
-
-Note: The .ht in the name will tell Apache to prevent the database from being
-downloaded. Please check that the file is, indeed, protected by your webserver.
-If not, please consult the documentation of your webserver on how to protect a
-file from downloading.
-
-USERNAME, PASSWORD, and ADVANCED OPTIONS
-----------------------------------------
-No username, password, or advanced options are necessary and should not be used.
diff --git a/INSTALL.txt b/INSTALL.txt
deleted file mode 100644
index 0e00a0e..0000000
--- a/INSTALL.txt
+++ /dev/null
@@ -1,382 +0,0 @@
-// $Id$
-
-CONTENTS OF THIS FILE
----------------------
-
- * Requirements
- * Optional tasks
- * Installation
- * Drupal administration
- * Customizing your theme(s)
- * Multisite configuration
- * More information
-
-REQUIREMENTS
-------------
-
-Drupal requires:
-
-- A web server. Apache (version 2.0 or greater) is recommended.
-- PHP 5.2.0 (or greater) (http://www.php.net/).
-- One of the following databases:
- - MySQL 5.0.15 (or greater) (http://www.mysql.com/).
- - MariaDB 5.1.44 (or greater) (http://mariadb.org/). MariaDB is a fully
- compatible drop-in replacement for MySQL.
- - PostgreSQL 8.3 (or greater) (http://www.postgresql.org/).
- - SQLite 3.4.2 (or greater) (http://www.sqlite.org/).
-
-For more detailed information about Drupal requirements, including a list of
-PHP extensions and configurations that are required, see "System requirements"
-(http://drupal.org/requirements) in the Drupal handbook.
-
-For detailed information on how to configure a test server environment using
-a variety of operating systems and web servers, see "Local server setup"
-(http://drupal.org/node/157602) in the Drupal handbook.
-
-OPTIONAL TASKS
---------------
-
-- To use XML-based services such as the Blogger API and RSS syndication,
- you will need PHP's XML extension. This extension is enabled by default.
-
-- To use Drupal's "Clean URLs" feature on an Apache web server, you will need
- the mod_rewrite module and the ability to use local .htaccess files. For
- Clean URLs support on IIS, see "Using Clean URLs with IIS"
- (http://drupal.org/node/3854) in the Drupal handbook.
-
-- Various Drupal features require that the web server process (for
- example, httpd) be able to initiate outbound connections. This is usually
- possible, but some hosting providers or server configurations forbid such
- connections. The features that depend on this functionality include the
- integrated "Update status" module (which downloads information about
- available updates of Drupal core and any installed contributed modules and
- themes), the ability to log in via OpenID, fetching aggregator feeds, or
- other network-dependent services.
-
-
-INSTALLATION
-------------
-
-1. DOWNLOAD DRUPAL AND OPTIONALLY A TRANSLATION
-
- You can obtain the latest Drupal release from http://drupal.org/. The files
- are in .tar.gz format and can be extracted using most compression tools. On a
- typical Unix command line, use:
-
- wget http://drupal.org/files/projects/drupal-x.x.tar.gz
- tar -zxvf drupal-x.x.tar.gz
-
- This will create a new directory drupal-x.x/ containing all Drupal files
- and directories. Move the contents of that directory into a directory within
- your web server's document root or your public HTML directory:
-
- mv drupal-x.x/* drupal-x.x/.htaccess /var/www/html
-
- If you would like to have the default English interface translated to a
- different language, we have good news. You can install and use Drupal in
- other languages from the start. Check whether a released package of the
- language desired is available for this Drupal version at
- http://drupal.org/project/translations and download the package. Extract
- the contents to the same directory where you extracted Drupal into.
-
-2. CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS
-
- Drupal comes with a default.settings.php file in the sites/default
- directory. The installer uses this file as a template to create your
- settings file using the details you provide through the install process.
- To avoid problems when upgrading, Drupal is not packaged with an actual
- settings file. You must create a file named settings.php. You may do so
- by making a copy of default.settings.php (or create an empty file with
- this name in the same directory). For example, (from the installation
- directory) make a copy of the default.settings.php file with the command:
-
- cp sites/default/default.settings.php sites/default/settings.php
-
- Next, give the web server write privileges to the sites/default/settings.php
- file with the command (from the installation directory):
-
- chmod o+w sites/default/settings.php
-
- So that the files directory can be created automatically, give the web server
- write privileges to the sites/default directory with the command (from the
- installation directory):
-
- chmod o+w sites/default
-
-3. CREATE THE DRUPAL DATABASE
-
- Drupal requires access to a database in order to be installed. Your database
- user will need sufficient privileges to run Drupal. Additional information
- about privileges, and instructions to create a database using the command
- line are available in INSTALL.mysql.txt (for MySQL) or INSTALL.pgsql.txt
- (for PostgreSQL).
-
- To create a database using PHPMyAdmin or a web-based control panel consult
- the documentation or ask your webhost service provider.
-
- Take note of the username, password, database name and hostname as you
- create the database. You will enter these items in the install script.
-
-4. RUN THE INSTALL SCRIPT
-
- To run the install script point your browser to the base URL of your website
- (e.g., http://www.example.com).
-
- You will be guided through several screens to set up the database,
- create tables, add the site maintenance account (the first user, also known
- as user/1), and provide basic web site settings.
-
- The install script will attempt to create a files storage directory
- in the default location at sites/default/files (the location of the
- files directory may be changed after Drupal is installed). In some
- cases, you may need to create the directory and modify its permissions
- manually. Use the following commands (from the installation directory)
- to create the public and private files directories and grant the web server
- write privileges to them:
-
- mkdir sites/default/files
- chmod o+w sites/default/files
- mkdir sites/default/private
- chmod o+w sites/default/private
-
- The install script will attempt to write-protect the settings.php file and
- the sites/default directory after saving your configuration. However, you
- may need to manually write-protect them using the commands (from the
- installation directory):
-
- chmod a-w sites/default/settings.php
- chmod a-w sites/default
-
- If you make manual changes to the file later, be sure to protect it again
- after making your modifications. Failure to remove write permissions to that
- file is a security risk. Although the default location for the settings.php
- file is at sites/default/settings.php, it may be in another location
- if you use the multi-site setup, as explained below.
-
-5. CONFIGURE DRUPAL
-
- When the install script succeeds, you will be directed to the "Welcome"
- page logged in with the site maintenance account. Proceed with the initial
- configuration steps suggested on the "Welcome" page.
-
- If the default Drupal theme is not displaying properly and links on the page
- result in "Page Not Found" errors, try manually setting the $base_url variable
- in the settings.php file if not already set. It's currently known that servers
- running FastCGI can run into problems if the $base_url variable is left
- commented out (see http://bugs.php.net/bug.php?id=19656).
-
-6. REVIEW FILE SYSTEM STORAGE SETTINGS AND FILE PERMISSIONS
-
- The files directory created in step 4 is the default file system path used
- to store all uploaded files, as well as some temporary files created by Drupal.
- After installation, the settings for the file system path may be modified
- to store uploaded files in a different location.
-
- It is not necessary to modify this path, but you may wish to change it if:
-
- * your site runs multiple Drupal installations from a single codebase
- (modify the file system path of each installation to a different
- directory so that uploads do not overlap between installations); or,
-
- * your site runs a number of web server front-ends behind a load
- balancer or reverse proxy (modify the file system path on each
- server to point to a shared file repository).
-
- To modify the file system path:
-
- * Ensure that the new location for the path exists or create it if
- necessary. To create a new directory named uploads, for example,
- use the following command from a shell or system prompt (while in
- the installation directory):
-
- mkdir uploads
-
- * Ensure that the new location for the path is writable by the web
- server process. To grant write permissions for a directory named
- uploads, you may need to use the following command from a shell
- or system prompt (while in the installation directory):
-
- chmod o+w uploads
-
- * Access the file system path settings in Drupal by selecting these
- menu items from the Navigation menu:
-
- Administer > Site configuration > File system
-
- Enter the path to the new location (e.g.: uploads) at the File
- System Path prompt.
-
- Changing the file system path after files have been uploaded may cause
- unexpected problems on an existing site. If you modify the file system path
- on an existing site, remember to copy all files from the original location
- to the new location.
-
- Some administrators suggest making the documentation files, especially
- CHANGELOG.txt, non-readable so that the exact version of Drupal you are
- running is slightly more difficult to determine. If you wish to implement
- this optional security measure, use the following command from a shell or
- system prompt (while in the installation directory):
-
- chmod a-r CHANGELOG.txt
-
- Note that the example only affects CHANGELOG.txt. To completely hide
- all documentation files from public view, repeat this command for each of
- the Drupal documentation files in the installation directory, substituting the
- name of each file for CHANGELOG.txt in the example.
-
- For more information on setting file permissions, see "Modifying Linux, Unix,
- and Mac file permissions" (http://drupal.org/node/202483) or "Modifying
- Windows file permissions" (http://drupal.org/node/202491) in the online
- handbook.
-
-7. CRON MAINTENANCE TASKS
-
- Many Drupal modules have periodic tasks that must be triggered by a cron
- maintenance task, including search module (to build and update the index
- used for keyword searching), aggregator module (to retrieve feeds from other
- sites), and system module (to perform routine maintenance and pruning on
- system tables).
-
- For most sites, the built-in, automated cron feature should be sufficient.
- Note, however, that cron tasks will only be executed when there are site
- visitors. You can enable the built-in cron feature at:
-
- Administer > Configuration > System > Site information
-
- Advanced users may want to ensure that cron tasks are executed periodically.
- To do this, visit the page "cron.php", which executes maintenance tasks on
- behalf of installed modules. The URL of the cron.php page requires a "cron
- key" to protect against unauthorized access.
- Each cron key is automatically generated during installation and is specific
- to your site. The full URL of the page, with cron key, is available in the
- "Cron maintenance tasks" section of the "Status report page" at:
-
- Administer > Reports > Status report
-
- Most systems support using a crontab utility for automatically executing
- tasks like visiting the cron.php page. The following example crontab line
- uses wget to automatically visit the cron.php page each hour, on the hour:
-
- 0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php?cron_key=RANDOMTEXT
-
- Replace the text "http://www.example.com/cron.php?cron_key=RANDOMTEXT" in the
- example with the full URL displayed under "Cron maintenance tasks" on the
- "Status report" page.
-
- More information about cron maintenance tasks are available in the help pages
- and in Drupal's online handbook at http://drupal.org/cron. Example cron scripts
- can be found in the scripts/ directory. (Note that these scripts must be
- customized similar to the above example, to add your site-specific cron key
- and domain name.)
-
-
-BUILDING AND CUSTOMIZING YOUR SITE
-----------------------------------
-
-A new installation of Drupal defaults to a very basic configuration with only a
-few active modules and minimal user access rights. When extending your site,
-you use "modules" and "themes". A module is a plugin that adds functionallity to
-Drupal, while a theme changes the front-end look and behavior of your site.
-
-It is important to install these correctly and not mix them in with the core
-Drupal module and theme set (directories modules and themes at the top level).
-So normally you place them under the following paths:
-
-Modules:
- sites/all/modules/example_module
-
-Themes:
- sites/all/themes/example_theme
-
-If you run a multisite installation you will want to do this a bit differently.
-You can read more about that on the multisite part of this file.
-
-Contributed modules can be found at:
-http://drupal.org/project/Modules
-
-Contributed themes can be found at:
-http://drupal.org/project/Themes
-
-Later on you might want to write your own code, but remember to NEVER modify the
-core modules and themes in Drupal directories modules and themes. Instead use
-the hooks available in the Drupal API. You can read more about the Drupal API
-and how to develop modules at
-http://drupal.org/developing/modules
-
-
-MULTISITE CONFIGURATION
------------------------
-
-A single Drupal installation can host several Drupal-powered sites, each with
-its own individual configuration.
-
-Additional site configurations are created in subdirectories within the 'sites'
-directory. Each subdirectory must have a 'settings.php' file which specifies the
-configuration settings. The easiest way to create additional sites is to copy
-the 'default' directory and modify the 'settings.php' file as appropriate. The
-new directory name is constructed from the site's URL. The configuration for
-www.example.com could be in 'sites/example.com/settings.php' (note that 'www.'
-should be omitted if users can access your site at http://example.com/).
-
-Sites do not have to have a different domain. You can also use subdomains and
-subdirectories for Drupal sites. For example, example.com, sub.example.com,
-and sub.example.com/site3 can all be defined as independent Drupal sites. The
-setup for a configuration such as this would look like the following:
-
- sites/default/settings.php
- sites/example.com/settings.php
- sites/sub.example.com/settings.php
- sites/sub.example.com.site3/settings.php
-
-When searching for a site configuration (for example www.sub.example.com/site3),
-Drupal will search for configuration files in the following order, using the
-first configuration it finds:
-
- sites/www.sub.example.com.site3/settings.php
- sites/sub.example.com.site3/settings.php
- sites/example.com.site3/settings.php
- sites/www.sub.example.com/settings.php
- sites/sub.example.com/settings.php
- sites/example.com/settings.php
- sites/default/settings.php
-
-If you are installing on a non-standard port, the port number is treated as the
-deepest subdomain. For example: http://www.example.com:8080/ could be loaded
-from sites/8080.www.example.com/. The port number will be removed according to
-the pattern above if no port-specific configuration is found, just like a real
-subdomain.
-
-Each site configuration can have its own site-specific modules and themes in
-addition to those installed in the standard 'modules' and 'themes' directories.
-To use site-specific modules or themes, simply create a 'modules' or 'themes'
-directory within the site configuration directory. For example, if
-sub.example.com has a custom theme and a custom module that should not be
-accessible to other sites, the setup would look like this:
-
- sites/sub.example.com/:
- settings.php
- themes/custom_theme
- modules/custom_module
-
-NOTE: for more information about multiple virtual hosts or the configuration
-settings, consult the Drupal handbook at drupal.org.
-
-For more information on configuring Drupal's file system path in a multi-site
-configuration, see step 6 above.
-
-MORE INFORMATION
-----------------
-
-- For additional documentation, see the online Drupal handbook at
- http://drupal.org/handbook.
-
-- For a list of security announcements, see the "Security announcements" page
- at http://drupal.org/security (available as an RSS feed). This page also
- describes how to subscribe to these announcements via e-mail.
-
-- For information about the Drupal security process, or to find out how to report
- a potential security issue to the Drupal security team, see the "Security team"
- page at http://drupal.org/security-team.
-
-- For information about the wide range of available support options, see the
- "Support" page at http://drupal.org/support.
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index e9b0311..0000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,340 +0,0 @@
-// $Id$
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt
deleted file mode 100644
index 634c24e..0000000
--- a/MAINTAINERS.txt
+++ /dev/null
@@ -1,288 +0,0 @@
-// $Id$
-
-Drupal core is maintained by the community. To participate, go to
-
- http://drupal.org/contribute
-
-The people listed here have agreed to do more quality assurance work for
-particular areas of Drupal. All of them are subject to change.
-
-
-Branch maintainers
-------------------
-
-Drupal 7
-- Dries Buytaert 'dries' <http://drupal.org/user/1>
-- Angela Byron 'webchick' <http://drupal.org/user/24967>
-
-
-Component maintainers
----------------------
-
-AJAX system
-- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
-- Randy Fay 'rfay' <http://drupal.org/user/30906>
-- Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
-
-Base system
-- Károly Négyesi 'chx' <http://drupal.org/user/9446>
-- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
-- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
-
-Batch system
-- Yves Chedemois 'yched' <http://drupal.org/user/39567>
-
-Cron system
-- Károly Négyesi 'chx' <http://drupal.org/user/9446>
-- Derek Wright 'dww' <http://drupal.org/user/46549>
-
-Database system
-- Larry Garfield 'Crell' <http://drupal.org/user/26398>
-
- - MySQL driver
- - Larry Garfield 'Crell' <http://drupal.org/user/26398>
- - David Strauss 'David Strauss' <hhttp://drupal.org/user/93254>
-
- - PostgreSQL driver
- - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- - Josh Waihi 'fiasco' <http://drupal.org/user/188162>
-
- - Sqlite driver
- - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- - Károly Négyesi 'chx' <http://drupal.org/user/9446>
-
-Entity system
-- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
-- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
-
-File system
-- Andrew Morton 'drewish' <http://drupal.org/user/34869>
-- Aaron Winborn 'aaron' <http://drupal.org/user/33420>
-
-Form system
-- Károly Négyesi 'chx' <http://drupal.org/user/9446>
-- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
-- Wolfgang Ziegler 'fago' <http://drupal.org/user/16747>
-- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
-- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
-
-Image system
-- Andrew Morton 'drewish' <http://drupal.org/user/34869>
-- Nathan Haug 'quicksketch' <http://drupal.org/user/35821>
-
-Install system
-- David Rothstein 'David_Rothstein' <http://drupal.org/user/124982>
-
-JavaScript
-- ?
-
-Language system
-- Francesco Placella 'plach' <http://drupal.org/user/183211>
-- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
-
-Lock system
-- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
-
-Mail system
-- ?
-
-Markup
-- Jacine Rodriguez 'Jacine' <http://drupal.org/user/88931>
-- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
-
-Menu system
-- Peter Wolanin 'pwolanin' <http://drupal.org/user/49851>
-- Károly Négyesi 'chx' <http://drupal.org/user/9446>
-
-Path system
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
-
-Render system
-- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
-- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
-- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
-
-Theme system
-- Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
-- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
-- Joon Park 'dvessel' <http://drupal.org/user/56782>
-
-Token system
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-
-Update system
-- ?
-
-XML-RPC system
-- ?
-
-
-Topic coordinators
-------------------
-
-Accessibility
-- Everett Zufelt 'Everett Zufelt' <http://drupal.org/user/406552>
-
-Documentation
-- Addison Berry 'add1sun' <http://drupal.org/user/65088>
-- Jennifer Hodgdon 'jhodgdon' <http://drupal.org/user/155601>
-
-Security
-- Heine Deelstra 'Heine' <http://drupal.org/user/17943>
-
-Translations
-- Gerhard Killesreiter 'killes' <http://drupal.org/user/83>
-
-User experience and usability
-- Roy Scholten 'yoroy' <http://drupal.org/user/41502>
-- Bojhan Somers 'Bojhan' <http://drupal.org/user/87969>
-
-
-Module maintainers
-------------------
-
-Aggregator module
-- ?
-
-Block module
-- ?
-
-Blog module
-- ?
-
-Book module
-- Peter Wolanin 'pwolanin' <http://drupal.org/user/49851>
-
-Color module
-- ?
-
-Comment module
-- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
-
-Contact module
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-
-Contextual module
-- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
-
-Dashboard module
-- ?
-
-Database logging module
-- Khalid Baheyeldin 'kbahey' <http://drupal.org/user/4063>
-
-Field module
-- Yves Chedemois 'yched' <http://drupal.org/user/39567>
-- Barry Jaspan 'bjaspan' <http://drupal.org/user/46413>
-
-Field UI module
-- Yves Chedemois 'yched' <http://drupal.org/user/39567>
-
-File module
-- Aaron Winborn 'aaron' <http://drupal.org/user/33420>
-
-Filter module
-- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
-
-Forum module
-- ?
-
-Help module
-- ?
-
-Image module
-- Nathan Haug 'quicksketch' <http://drupal.org/user/35821>
-
-Locale module
-- Gábor Hojtsy 'Gábor Hojtsy' <http://drupal.org/user/4166>
-
-Menu module
-- ?
-
-Node module
-- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
-- David Strauss 'David Strauss' <http://drupal.org/user/93254>
-
-OpenID module
-- Heine Deelstra 'Heine' <http://drupal.org/user/17943>
-- Christian Schmidt 'c960657' <http://drupal.org/user/216078>
-- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
-
-Overlay module
-- Katherine Senzee 'ksenzee' <http://drupal.org/user/139855>
-
-Path module
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-
-PHP module
-- ?
-
-Poll module
-- ?
-
-Profile module
-- ?
-
-RDF module
-- Stéphane Corlosquet 'scor' <http://drupal.org/user/52142>
-
-Search module
-- Doug Green 'douggreen' <http://drupal.org/user/29191>
-
-Shortcut module
-- David Rothstein 'David_Rothstein' <http://drupal.org/user/124982>
-
-Simpletest module
-- Jimmy Berry 'boombatower' <http://drupal.org/user/214218>
-- Károly Négyesi 'chx' <http://drupal.org/user/9446>
-
-Statistics module
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-
-Syslog module
-- Khalid Baheyeldin 'kbahey' <http://drupal.org/user/4063>
-
-System module
-- ?
-
-Taxonomy module
-- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
-- Benjamin Doherty 'bangpound' <http://drupal.org/user/100456>
-
-Toolbar module
-- ?
-
-Tracker module
-- David Strauss 'David Strauss' <http://drupal.org/user/93254>
-
-Translation module
-- Francesco Placella 'plach' <http://drupal.org/user/183211>
-
-Trigger module
-- ?
-
-Update module
-- Derek Wright 'dww' <http://drupal.org/user/46549>
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
-
-User module
-- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
-- David Strauss 'David Strauss' <http://drupal.org/user/93254>
-
-
-Theme maintainers
------------------
-
-Bartik theme
-- Jen Simmons 'jensimmons' <http://drupal.org/user/140882>
-
-Garland theme
-- Stefan Nagtegaal 'steef' <http://drupal.org/user/612>
-
-Seven theme
-- ?
-
-Stark theme
-- John Wilkins 'JohnAlbin' <http://drupal.org/user/32095>
-
diff --git a/UPGRADE.txt b/UPGRADE.txt
deleted file mode 100644
index 5b8d047..0000000
--- a/UPGRADE.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-// $Id$
-
-UPGRADING
----------
-
-Prior to upgrading, you should ensure that:
-
- * Your system meets or exceeds Drupal's minimum requirements as shown at
- http://drupal.org/requirements.
- * You have a backup of all your relevant data (#1).
- * Custom and contributed modules have been checked for compatibility (#11).
- * Custom and contributed themes have been checked for compatibility (#11).
- * You have read through this entire document.
-
-Let's begin!
-
-1. Back up your Drupal database and site root directory. Be especially sure
- to back up your "sites" directory which contains your configuration file,
- added modules and themes, and your site's uploaded files. If other files
- have modifications, such as .htaccess or robots.txt, back those up as well.
-
- Note: for a single site setup, the configuration file is the "settings.php"
- file located at sites/default/settings.php. The default.settings.php file
- contains a clean copy for restoration purposes, if required.
-
- For multisite configurations, the configuration file is located in a
- structure like the following:
-
- sites/default/settings.php
- sites/example.com/settings.php
- sites/sub.example.com/settings.php
- sites/sub.example.com.path/settings.php
-
- More information on multisite configuration is located in INSTALL.txt.
-
-2. If possible, log on either as a user with the "Administer software updates"
- permission or as the user with user ID 1, which is the first account
- created (also known as the site maintenance account). Only these accounts
- will be able to automatically access update.php in step #10. There are
- special instructions in step #10 if you are unable to log on as one of
- these users. Do not close your browser until the final step is complete.
-
-3. Place the site in "Offline" mode, to let the database updates run without
- interruption and avoid displaying errors to end users of the site. This
- option is at http://www.example.com/?q=admin/config/development/maintenance
- (replace www.example.com with your installation's domain name and path).
-
-4. If using a custom or contributed theme, switch to a core theme such as
- Bartik or Garland.
-
-5. Disable all custom and contributed modules. This includes any modules that
- are not listed under 'Core - required' or 'Core - optional' on
- http://www.example.com/?q=admin/build/modules (replace www.example.com with
- your installation's domain name and path).
-
-6. Remove all old files and directories from the Drupal installation directory.
-
-7. Unpack the new files and directories into the Drupal installation directory.
-
-8. Copy your backed up "files" and "sites" directories to the Drupal
- installation directory. If other system files such as .htaccess or
- robots.txt were customized, re-create the modifications in the new
- versions of the files using the backups taken in step #1.
-
-9. Verify the new configuration file to make sure it has correct information.
-
-10. Run update.php by visiting http://www.example.com/update.php (replace
- www.example.com with your Drupal installation's domain name and path). This
- step will update the core database tables to the new Drupal installation.
-
- Note: if you are unable to access update.php do the following:
-
- - Open your settings.php with a text editor.
-
- - There is a line that says $update_free_access = FALSE;
- Change it to $update_free_access = TRUE;
-
- - Once update.php is done, you must change the settings.php file
- back to its original form with $update_free_access = FALSE;
-
-11. Ensure that the versions of all custom and contributed modules match the
- new Drupal version to which you have updated. For a major update, such as
- from 5.x to 6.x, modules from previous versions will not be compatible
- and updated versions will be required.
-
- - For contributed modules, check http://drupal.org/project/modules
- for the version of a module matching your version of Drupal.
-
- - For custom modules, review http://drupal.org/update/modules to
- ensure that a custom module is compatible with the current version.
-
-12. Re-enable custom and contributed modules and re-run update.php
- to update custom and contributed database tables.
-
-13. Return the site to its original theme (if you switched to a core theme in
- step #4). If your site uses a custom or contributed theme, make sure it is
- compatible with your version of Drupal.
-
- - For contributed themes, check http://drupal.org/project/themes
- for the version of a theme matching your version of Drupal.
-
- - For custom themes, review http://drupal.org/update/theme to ensure
- that a custom theme is compatible with the current version.
-
-14. Finally, return your site to "Online" mode so your visitors may resume
- browsing. As in step #3, this option is available in your administration
- screens at http://www.example.com/?q=admin/config/development/maintenance
- (replace www.example.com with your installation's domain name and path).
-
-For more information on upgrading visit
-the Drupal handbook at http://drupal.org/upgrade
diff --git a/authorize.php b/authorize.php
deleted file mode 100644
index eb9a753..0000000
--- a/authorize.php
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Administrative script for running authorized file operations.
- *
- * Using this script, the site owner (the user actually owning the files on
- * the webserver) can authorize certain file-related operations to proceed
- * with elevated privileges, for example to deploy and upgrade modules or
- * themes. Users should not visit this page directly, but instead use an
- * administrative user interface which knows how to redirect the user to this
- * script as part of a multistep process. This script actually performs the
- * selected operations without loading all of Drupal, to be able to more
- * gracefully recover from errors. Access to the script is controlled by a
- * global killswitch in settings.php ('allow_authorize_operations') and via
- * the 'administer software updates' permission.
- *
- * There are helper functions for setting up an operation to run via this
- * system in modules/system/system.module. For more information, see:
- * @link authorize Authorized operation helper functions @endlink
- */
-
-/**
- * Root directory of Drupal installation.
- */
-define('DRUPAL_ROOT', getcwd());
-
-/**
- * Global flag to identify update.php and authorize.php runs, and so
- * avoid various unwanted operations, such as hook_init() and
- * hook_exit() invokes, css/js preprocessing and translation, and
- * solve some theming issues. This flag is checked on several places
- * in Drupal code (not just authorize.php).
- */
-define('MAINTENANCE_MODE', 'update');
-
-/**
- * Render a 403 access denied page for authorize.php
- */
-function authorize_access_denied_page() {
- drupal_add_http_header('Status', '403 Forbidden');
- watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
- drupal_set_title('Access denied');
- return t('You are not allowed to access this page.');
-}
-
-/**
- * Determine if the current user is allowed to run authorize.php.
- *
- * The killswitch in settings.php overrides all else, otherwise, the user must
- * have access to the 'administer software updates' permission.
- *
- * @return
- * TRUE if the current user can run authorize.php, otherwise FALSE.
- */
-function authorize_access_allowed() {
- return variable_get('allow_authorize_operations', TRUE) && user_access('administer software updates');
-}
-
-// *** Real work of the script begins here. ***
-
-require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
-require_once DRUPAL_ROOT . '/includes/session.inc';
-require_once DRUPAL_ROOT . '/includes/common.inc';
-require_once DRUPAL_ROOT . '/includes/file.inc';
-require_once DRUPAL_ROOT . '/includes/module.inc';
-require_once DRUPAL_ROOT . '/includes/ajax.inc';
-
-// We prepare only a minimal bootstrap. This includes the database and
-// variables, however, so we have access to the class autoloader registry.
-drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
-
-// This must go after drupal_bootstrap(), which unsets globals!
-global $conf;
-
-// We have to enable the user and system modules, even to check access and
-// display errors via the maintainence theme.
-$module_list['system']['filename'] = 'modules/system/system.module';
-$module_list['user']['filename'] = 'modules/user/user.module';
-module_list(TRUE, FALSE, FALSE, $module_list);
-drupal_load('module', 'system');
-drupal_load('module', 'user');
-
-// We also want to have the language system available, but we do *NOT* want to
-// actually call drupal_bootstrap(DRUPAL_BOOTSTRAP_LANGUAGE), since that would
-// also force us through the DRUPAL_BOOTSTRAP_PAGE_HEADER phase, which loads
-// all the modules, and that's exactly what we're trying to avoid.
-drupal_language_initialize();
-
-// Initialize the maintenance theme for this administrative script.
-drupal_maintenance_theme();
-
-$output = '';
-$show_messages = TRUE;
-
-if (authorize_access_allowed()) {
- // Load both the Form API and Batch API.
- require_once DRUPAL_ROOT . '/includes/form.inc';
- require_once DRUPAL_ROOT . '/includes/batch.inc';
- // Load the code that drives the authorize process.
- require_once DRUPAL_ROOT . '/includes/authorize.inc';
-
- // For the sake of Batch API and a few other low-level functions, we need to
- // initialize the URL path into $_GET['q']. However, we do not want to raise
- // our bootstrap level, nor do we want to call drupal_initialize_path(),
- // since that is assuming that modules are loaded and invoking hooks.
- // However, all we really care is if we're in the middle of a batch, in which
- // case $_GET['q'] will already be set, we just initialize it to an empty
- // string if it's not already defined.
- if (!isset($_GET['q'])) {
- $_GET['q'] = '';
- }
-
- if (isset($_SESSION['authorize_operation']['page_title'])) {
- drupal_set_title(check_plain($_SESSION['authorize_operation']['page_title']));
- }
- else {
- drupal_set_title(t('Authorize file system changes'));
- }
-
- // See if we've run the operation and need to display a report.
- if (isset($_SESSION['authorize_results']) && $results = $_SESSION['authorize_results']) {
-
- // Clear the session out.
- unset($_SESSION['authorize_results']);
- unset($_SESSION['authorize_operation']);
- unset($_SESSION['authorize_filetransfer_backends']);
-
- if (!empty($results['page_title'])) {
- drupal_set_title(check_plain($results['page_title']));
- }
- if (!empty($results['page_message'])) {
- drupal_set_message($results['page_message']['message'], $results['page_message']['type']);
- }
-
- $output = theme('authorize_report', array('messages' => $results['messages']));
-
- $links = array();
- if (is_array($results['tasks'])) {
- $links += $results['tasks'];
- }
-
- $links = array_merge($links, array(
- l(t('Administration pages'), 'admin'),
- l(t('Front page'), '<front>'),
- ));
-
- $output .= theme('item_list', array('items' => $links));
- }
- // If a batch is running, let it run.
- elseif (isset($_GET['batch'])) {
- $output = _batch_page();
- }
- else {
- if (empty($_SESSION['authorize_operation']) || empty($_SESSION['authorize_filetransfer_backends'])) {
- $output = t('It appears you have reached this page in error.');
- }
- elseif (!$batch = batch_get()) {
- // We have a batch to process, show the filetransfer form.
- $elements = drupal_get_form('authorize_filetransfer_form');
- $output = drupal_render($elements);
- }
- }
- // We defer the display of messages until all operations are done.
- $show_messages = !(($batch = batch_get()) && isset($batch['running']));
-}
-else {
- $output = authorize_access_denied_page();
-}
-
-if (!empty($output)) {
- print theme('update_page', array('content' => $output, 'show_messages' => $show_messages));
-}
-
diff --git a/cron.php b/cron.php
deleted file mode 100644
index 9e5e7cf..0000000
--- a/cron.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
- */
-
-/**
- * Root directory of Drupal installation.
- */
-define('DRUPAL_ROOT', getcwd());
-
-include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
-drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-
-if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
- watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
- drupal_access_denied();
-}
-elseif (variable_get('maintenance_mode', 0)) {
- watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
- drupal_access_denied();
-}
-else {
- drupal_cron_run();
-}
diff --git a/includes/actions.inc b/includes/actions.inc
deleted file mode 100644
index 8ee7d51..0000000
--- a/includes/actions.inc
+++ /dev/null
@@ -1,384 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * This is the actions engine for executing stored actions.
- */
-
-/**
- * @defgroup actions Actions
- * @{
- * Functions that perform an action on a certain system object.
- *
- * Action functions are declared by modules by implementing hook_action_info().
- * Modules can cause action functions to run by calling actions_do(), and
- * trigger.module provides a user interface that lets administrators define
- * events that cause action functions to run.
- *
- * Each action function takes two to four arguments:
- * - $entity: The object that the action acts on, such as a node, comment, or
- * user.
- * - $context: Array of additional information about what triggered the action.
- * - $a1, $a2: Optional additional information, which can be passed into
- * actions_do() and will be passed along to the action function.
- *
- * @} End of "defgroup actions".
- */
-
-/**
- * Performs a given list of actions by executing their callback functions.
- *
- * Given the IDs of actions to perform, this function finds out what the
- * callback functions for the actions are by querying the database. Then
- * it calls each callback using the function call $function($object, $context,
- * $a1, $a2), passing the input arguments of this function (see below) to the
- * action function.
- *
- * @param $action_ids
- * The IDs of the actions to perform. Can be a single action ID or an array
- * of IDs. IDs of configurable actions must be given as numeric action IDs;
- * IDs of non-configurable actions may be given as action function names.
- * @param $object
- * The object that the action will act on: a node, user, or comment object.
- * @param $context
- * Associative array containing extra information about what triggered
- * the action call, with $context['hook'] giving the name of the hook
- * that resulted in this call to actions_do().
- * @param $a1
- * Passed along to the callback.
- * @param $a2
- * Passed along to the callback.
- * @return
- * An associative array containing the results of the functions that
- * perform the actions, keyed on action ID.
- *
- * @ingroup actions
- */
-function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL) {
- // $stack tracks the number of recursive calls.
- static $stack;
- $stack++;
- if ($stack > variable_get('actions_max_stack', 35)) {
- watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), WATCHDOG_ERROR);
- return;
- }
- $actions = array();
- $available_actions = actions_list();
- $actions_result = array();
- if (is_array($action_ids)) {
- $conditions = array();
- foreach ($action_ids as $action_id) {
- if (is_numeric($action_id)) {
- $conditions[] = $action_id;
- }
- elseif (isset($available_actions[$action_id])) {
- $actions[$action_id] = $available_actions[$action_id];
- }
- }
-
- // When we have action instances we must go to the database to retrieve
- // instance data.
- if (!empty($conditions)) {
- $query = db_select('actions');
- $query->addField('actions', 'aid');
- $query->addField('actions', 'type');
- $query->addField('actions', 'callback');
- $query->addField('actions', 'parameters');
- $query->condition('aid', $conditions, 'IN');
- $result = $query->execute();
- foreach ($result as $action) {
- $actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();
- $actions[$action->aid]['callback'] = $action->callback;
- $actions[$action->aid]['type'] = $action->type;
- }
- }
-
- // Fire actions, in no particular order.
- foreach ($actions as $action_id => $params) {
- // Configurable actions need parameters.
- if (is_numeric($action_id)) {
- $function = $params['callback'];
- if (function_exists($function)) {
- $context = array_merge($context, $params);
- $actions_result[$action_id] = $function($object, $context, $a1, $a2);
- }
- else {
- $actions_result[$action_id] = FALSE;
- }
- }
- // Singleton action; $action_id is the function name.
- else {
- $actions_result[$action_id] = $action_id($object, $context, $a1, $a2);
- }
- }
- }
- // Optimized execution of a single action.
- else {
- // If it's a configurable action, retrieve stored parameters.
- if (is_numeric($action_ids)) {
- $action = db_query("SELECT callback, parameters FROM {actions} WHERE aid = :aid", array(':aid' => $action_ids))->fetchObject();
- $function = $action->callback;
- if (function_exists($function)) {
- $context = array_merge($context, unserialize($action->parameters));
- $actions_result[$action_ids] = $function($object, $context, $a1, $a2);
- }
- else {
- $actions_result[$action_ids] = FALSE;
- }
- }
- // Singleton action; $action_ids is the function name.
- else {
- if (function_exists($action_ids)) {
- $actions_result[$action_ids] = $action_ids($object, $context, $a1, $a2);
- }
- else {
- // Set to avoid undefined index error messages later.
- $actions_result[$action_ids] = FALSE;
- }
- }
- }
- $stack--;
- return $actions_result;
-}
-
-/**
- * Discovers all available actions by invoking hook_action_info().
- *
- * This function contrasts with actions_get_all_actions(); see the
- * documentation of actions_get_all_actions() for an explanation.
- *
- * @param $reset
- * Reset the action info static cache.
- * @return
- * An associative array keyed on action function name, with the same format
- * as the return value of hook_action_info(), containing all
- * modules' hook_action_info() return values as modified by any
- * hook_action_info_alter() implementations.
- *
- * @see hook_action_info()
- */
-function actions_list($reset = FALSE) {
- $actions = &drupal_static(__FUNCTION__);
- if (!isset($actions) || $reset) {
- $actions = module_invoke_all('action_info');
- drupal_alter('action_info', $actions);
- }
-
- // See module_implements() for an explanation of this cast.
- return (array) $actions;
-}
-
-/**
- * Retrieves all action instances from the database.
- *
- * This function differs from the actions_list() function, which gathers
- * actions by invoking hook_action_info(). The actions returned by this
- * function and the actions returned by actions_list() are partially
- * synchronized. Non-configurable actions from hook_action_info()
- * implementations are put into the database when actions_synchronize() is
- * called, which happens when admin/config/system/actions is visited. Configurable
- * actions are not added to the database until they are configured in the
- * user interface, in which case a database row is created for each
- * configuration of each action.
- *
- * @return
- * Associative array keyed by numeric action ID. Each value is an associative
- * array with keys 'callback', 'label', 'type' and 'configurable'.
- */
-function actions_get_all_actions() {
- $actions = db_query("SELECT aid, type, callback, parameters, label FROM {actions}")->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
- foreach ($actions as &$action) {
- $action['configurable'] = (bool) $action['parameters'];
- unset($action['parameters']);
- unset($action['aid']);
- }
- return $actions;
-}
-
-/**
- * Creates an associative array keyed by hashes of function names or IDs.
- *
- * Hashes are used to prevent actual function names from going out into HTML
- * forms and coming back.
- *
- * @param $actions
- * An associative array with function names or action IDs as keys
- * and associative arrays with keys 'label', 'type', etc. as values.
- * This is usually the output of actions_list() or actions_get_all_actions().
- * @return
- * An associative array whose keys are hashes of the input array keys, and
- * whose corresponding values are associative arrays with components
- * 'callback', 'label', 'type', and 'configurable' from the input array.
- */
-function actions_actions_map($actions) {
- $actions_map = array();
- foreach ($actions as $callback => $array) {
- $key = drupal_hash_base64($callback);
- $actions_map[$key]['callback'] = isset($array['callback']) ? $array['callback'] : $callback;
- $actions_map[$key]['label'] = $array['label'];
- $actions_map[$key]['type'] = $array['type'];
- $actions_map[$key]['configurable'] = $array['configurable'];
- }
- return $actions_map;
-}
-
-/**
- * Given a hash of an action array key, returns the key (function or ID).
- *
- * Faster than actions_actions_map() when you only need the function name or ID.
- *
- * @param $hash
- * Hash of a function name or action ID array key. The array key
- * is a key into the return value of actions_list() (array key is the action
- * function name) or actions_get_all_actions() (array key is the action ID).
- * @return
- * The corresponding array key, or FALSE if no match is found.
- */
-function actions_function_lookup($hash) {
- // Check for a function name match.
- $actions_list = actions_list();
- foreach ($actions_list as $function => $array) {
- if (drupal_hash_base64($function) == $hash) {
- return $function;
- }
- }
- $aid = FALSE;
- // Must be a configurable action; check database.
- $result = db_query("SELECT aid FROM {actions} WHERE parameters <> ''")->fetchAll(PDO::FETCH_ASSOC);
- foreach ($result as $row) {
- if (drupal_hash_base64($row['aid']) == $hash) {
- $aid = $row['aid'];
- break;
- }
- }
- return $aid;
-}
-
-/**
- * Synchronizes actions that are provided by modules in hook_action_info().
- *
- * Actions provided by modules in hook_action_info() implementations are
- * synchronized with actions that are stored in the actions database table.
- * This is necessary so that actions that do not require configuration can
- * receive action IDs.
- *
- * @param $delete_orphans
- * If TRUE, any actions that exist in the database but are no longer
- * found in the code (for example, because the module that provides them has
- * been disabled) will be deleted.
- */
-function actions_synchronize($delete_orphans = FALSE) {
- $actions_in_code = actions_list(TRUE);
- $actions_in_db = db_query("SELECT aid, callback, label FROM {actions} WHERE parameters = ''")->fetchAllAssoc('callback', PDO::FETCH_ASSOC);
-
- // Go through all the actions provided by modules.
- foreach ($actions_in_code as $callback => $array) {
- // Ignore configurable actions since their instances get put in when the
- // user adds the action.
- if (!$array['configurable']) {
- // If we already have an action ID for this action, no need to assign aid.
- if (array_key_exists($callback, $actions_in_db)) {
- unset($actions_in_db[$callback]);
- }
- else {
- // This is a new singleton that we don't have an aid for; assign one.
- db_insert('actions')
- ->fields(array(
- 'aid' => $callback,
- 'type' => $array['type'],
- 'callback' => $callback,
- 'parameters' => '',
- 'label' => $array['label'],
- ))
- ->execute();
- watchdog('actions', "Action '%action' added.", array('%action' => $array['label']));
- }
- }
- }
-
- // Any actions that we have left in $actions_in_db are orphaned.
- if ($actions_in_db) {
- $orphaned = array_keys($actions_in_db);
-
- if ($delete_orphans) {
- $actions = db_query('SELECT aid, label FROM {actions} WHERE callback IN (:orphaned)', array(':orphaned' => $orphaned))->fetchAll();
- foreach ($actions as $action) {
- actions_delete($action->aid);
- watchdog('actions', "Removed orphaned action '%action' from database.", array('%action' => $action->label));
- }
- }
- else {
- $link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan');
- $count = count($actions_in_db);
- $orphans = implode(', ', $orphaned);
- watchdog('actions', format_plural($count, 'One orphaned action (%orphans) exists in the actions table. !link', '@count orphaned actions (%orphans) exist in the actions table. !link'), array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_WARNING);
- }
- }
-}
-
-/**
- * Saves an action and its user-supplied parameter values to the database.
- *
- * @param $function
- * The name of the function to be called when this action is performed.
- * @param $type
- * The type of action, to describe grouping and/or context, e.g., 'node',
- * 'user', 'comment', or 'system'.
- * @param $params
- * An associative array with parameter names as keys and parameter values as
- * values.
- * @param $label
- * A user-supplied label of this particular action, e.g., 'Send e-mail
- * to Jim'.
- * @param $aid
- * The ID of this action. If omitted, a new action is created.
- * @return
- * The ID of the action.
- */
-function actions_save($function, $type, $params, $label, $aid = NULL) {
- // aid is the callback for singleton actions so we need to keep a separate
- // table for numeric aids.
- if (!$aid) {
- $aid = db_next_id();
- }
-
- db_merge('actions')
- ->key(array('aid' => $aid))
- ->fields(array(
- 'callback' => $function,
- 'type' => $type,
- 'parameters' => serialize($params),
- 'label' => $label,
- ))
- ->execute();
-
- watchdog('actions', 'Action %action saved.', array('%action' => $label));
- return $aid;
-}
-
-/**
- * Retrieves a single action from the database.
- *
- * @param $aid
- * The ID of the action to retrieve.
- * @return
- * The appropriate action row from the database as an object.
- */
-function actions_load($aid) {
- return db_query("SELECT aid, type, callback, parameters, label FROM {actions} WHERE aid = :aid", array(':aid' => $aid))->fetchObject();
-}
-
-/**
- * Deletes a single action from the database.
- *
- * @param $aid
- * The ID of the action to delete.
- */
-function actions_delete($aid) {
- db_delete('actions')
- ->condition('aid', $aid)
- ->execute();
- module_invoke_all('actions_delete', $aid);
-}
-
diff --git a/includes/ajax.inc b/includes/ajax.inc
deleted file mode 100644
index 49ff7e4..0000000
--- a/includes/ajax.inc
+++ /dev/null
@@ -1,957 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Functions for use with Drupal's AJAX framework.
- */
-
-/**
- * @defgroup ajax AJAX framework
- * @{
- * Drupal's AJAX framework is used to dynamically update parts of a page's HTML
- * based on data from the server. Upon a specified event, such as a button
- * click, a callback function is triggered which performs server-side logic and
- * may return updated markup, which is then replaced on-the-fly with no page
- * refresh necessary.
- *
- * This framework creates a PHP macro language that allows the server to
- * instruct JavaScript to perform actions on the client browser. When using
- * forms, it can be used with the #ajax property.
- * The #ajax property can be used to bind events to the AJAX framework. By
- * default, #ajax uses 'system/ajax' as its path for submission and thus calls
- * ajax_form_callback() and a defined #ajax['callback'] function.
- * However, you may optionally specify a different path to request or a
- * different callback function to invoke, which can return updated HTML or can
- * also return a richer set of @link ajax_commands AJAX framework commands @endlink.
- *
- * Standard form handling is as follows:
- * - A form element has a #ajax member.
- * - On the specified element, AJAX processing is triggered by a change to
- * that element.
- * - The form is submitted and rebuilt.
- * - The function named by #ajax['callback'] is called, which returns content
- * or an array of AJAX framework commands.
- * - The content returned by the callback replaces the div on the page
- * referenced by #ajax['wrapper'].
- *
- * A simple example of basic AJAX use from the
- * @link http://drupal.org/project/examples Examples module @endlink follows:
- * @code
- * function main_page() {
- * return drupal_get_form('ajax_example_simplest');
- * }
- *
- * function ajax_example_simplest($form, &$form_state) {
- * $form = array();
- * $form['changethis'] = array(
- * '#type' => 'select',
- * '#options' => array(
- * 'one' => 'one',
- * 'two' => 'two',
- * 'three' => 'three',
- * ),
- * '#ajax' => array(
- * 'callback' => 'ajax_example_simplest_callback',
- * 'wrapper' => 'replace_textfield_div',
- * ),
- * );
-
- * // This entire form element will be replaced with an updated value.
- * $form['replace_textfield'] = array(
- * '#type' => 'textfield',
- * '#title' => t("The default value will be changed"),
- * '#description' => t("Say something about why you chose") . "'" .
- * (!empty($form_state['values']['changethis'])
- * ? $form_state['values']['changethis'] : t("Not changed yet")) . "'",
- * '#prefix' => '<div id="replace_textfield_div">',
- * '#suffix' => '</div>',
- * );
- * return $form;
- * }
- *
- * function ajax_example_simplest_callback($form, $form_state) {
- * // The form has already been submitted and updated. We can return the replaced
- * // item as it is.
- * return $form['replace_textfield'];
- * }
- * @endcode
- *
- * In the above example, the 'changethis' element is AJAX-enabled. The default
- * #ajax['event'] is 'change', so when the 'changethis' element changes,
- * an AJAX call is made. The form is submitted and reprocessed, and then the
- * callback is called. In this case, the form has been automatically
- * built changing $form['replace_textfield']['#description'], so the callback
- * just returns that part of the form.
- *
- * To implement AJAX handling in a form, add '#ajax' to the form
- * definition of a field. That field will trigger an AJAX event when it is
- * clicked (or changed, depending on the kind of field). #ajax supports
- * the following parameters (either 'path' or 'callback' is required at least):
- * - #ajax['callback']: The callback to invoke to handle the server side of the
- * AJAX event, which will receive a $form and $form_state as arguments, and
- * returns a renderable array (most often a form or form fragment), an HTML
- * string, or an array of AJAX commands. If returning a renderable array or
- * a string, the value will replace the original element named in
- * #ajax['wrapper'], and
- * theme_status_messages()
- * will be prepended to that
- * element. (If the status messages are not wanted, return an array
- * of AJAX commands instead.)
- * #ajax['wrapper']. If an array of AJAX commands is returned, it will be
- * executed by the calling code.
- * - #ajax['path']: The menu path to use for the request. This is often omitted
- * and the default is used. This path should map
- * to a menu page callback that returns data using ajax_render(). Defaults to
- * 'system/ajax', which invokes ajax_form_callback(), eventually calling
- * the function named in #ajax['callback']. If you use a custom
- * path, you must set up the menu entry and handle the entire callback in your
- * own code.
- * - #ajax['wrapper']: The CSS ID of the area to be replaced by the content
- * returned by the #ajax['callback'] function. The content returned from
- * the callback will replace the entire element named by #ajax['wrapper'].
- * The wrapper is usually created using #prefix and #suffix properties in the
- * form. Note that this is the wrapper ID, not a CSS selector. So to replace
- * the element referred to by the CSS selector #some-selector on the page,
- * use #ajax['wrapper'] = 'some-selector', not '#some-selector'.
- * - #ajax['effect']: The jQuery effect to use when placing the new HTML.
- * Defaults to no effect. Valid options are 'none', 'slide', or 'fade'.
- * - #ajax['speed']: The effect speed to use. Defaults to 'slow'. May be
- * 'slow', 'fast' or a number in milliseconds which represents the length
- * of time the effect should run.
- * - #ajax['event']: The JavaScript event to respond to. This is normally
- * selected automatically for the type of form widget being used, and
- * is only needed if you need to override the default behavior.
- * - #ajax['method']: The jQuery method to use to place the new HTML.
- * Defaults to 'replaceWith'. May be: 'replaceWith', 'append', 'prepend',
- * 'before', 'after', or 'html'. See the
- * @link http://api.jquery.com/category/manipulation/ jQuery manipulators documentation @endlink
- * for more information on these methods.
- * - #ajax['progress']: Choose either a throbber or progress bar that is
- * displayed while awaiting a response from the callback, and add an optional
- * message. Possible keys: 'type', 'message', 'url', 'interval'.
- * More information is available in the
- * @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7 Form API Reference @endlink
- *
- * In addition to using Form API for doing in-form modification, AJAX may be
- * enabled by adding classes to buttons and links. By adding the 'use-ajax'
- * class to a link, the link will be loaded via an AJAX call. When using this
- * method, the href of the link can contain '/nojs/' as part of the path. When
- * the AJAX framework makes the request, it will convert this to '/ajax/'.
- * The server is then able to easily tell if this request was made through an
- * actual AJAX request or in a degraded state, and respond appropriately.
- *
- * Similarly, submit buttons can be given the class 'use-ajax-submit'. The
- * form will then be submitted via AJAX to the path specified in the #action.
- * Like the ajax-submit class above, this path will have '/nojs/' replaced with
- * '/ajax/' so that the submit handler can tell if the form was submitted
- * in a degraded state or not.
- *
- * When responding to AJAX requests, the server should do what it needs to do
- * for that request, then create a commands array. This commands array will
- * be converted to a JSON object and returned to the client, which will then
- * iterate over the array and process it like a macro language.
- *
- * Each command item is an associative array which will be converted to a command
- * object on the JavaScript side. $command_item['command'] is the type of
- * command, e.g. 'alert' or 'replace', and will correspond to a method in the
- * Drupal.ajax[command] space. The command array may contain any other data
- * that the command needs to process, e.g. 'method', 'selector', 'settings', etc.
- *
- * Commands are usually created with a couple of helper functions, so they
- * look like this:
- * @code
- * $commands = array();
- * // Replace the content of '#object-1' on the page with 'some html here'.
- * $commands[] = ajax_command_replace('#object-1', 'some html here');
- * // Add a visual "changed" marker to the '#object-1' element.
- * $commands[] = ajax_command_changed('#object-1');
- * // Menu 'page callback' and #ajax['callback'] functions are supposed to
- * // return render arrays. If returning an AJAX commands array, it must be
- * // encapsulated in a render array structure.
- * return array('#type' => 'ajax', '#commands' => $commands);
- * @endcode
- *
- * When returning an AJAX command array, it is often useful to have
- * status messages rendered along with other tasks in the command array.
- * In that case the the AJAX commands array may be constructed like this:
- * @code
- * $commands = array();
- * $commands[] = ajax_command_replace(NULL, $output);
- * $commands[] = ajax_command_prepend(NULL, theme('status_messages'));
- * return array('#type' => 'ajax', '#commands' => $commands);
- * @endcode
- *
- * See @link ajax_commands AJAX framework commands @endlink
- */
-
-/**
- * Render a commands array into JSON.
- *
- * @param $commands
- * A list of macro commands generated by the use of ajax_command_*()
- * functions.
- */
-function ajax_render($commands = array()) {
- // Automatically extract any 'settings' added via drupal_add_js() and make
- // them the first command.
- $scripts = drupal_add_js(NULL, NULL);
- if (!empty($scripts['settings'])) {
- array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $scripts['settings']['data'])));
- }
-
- // Allow modules to alter any AJAX response.
- drupal_alter('ajax_render', $commands);
-
- return drupal_json_encode($commands);
-}
-
-/**
- * Get a form submitted via #ajax during an AJAX callback.
- *
- * This will load a form from the form cache used during AJAX operations. It
- * pulls the form info from $_POST.
- *
- * @return
- * An array containing the $form and $form_state. Use the list() function
- * to break these apart:
- * @code
- * list($form, $form_state, $form_id, $form_build_id) = ajax_get_form();
- * @endcode
- */
-function ajax_get_form() {
- $form_state = form_state_defaults();
-
- $form_build_id = $_POST['form_build_id'];
-
- // Get the form from the cache.
- $form = form_get_cache($form_build_id, $form_state);
- if (!$form) {
- // If $form cannot be loaded from the cache, the form_build_id in $_POST
- // must be invalid, which means that someone performed a POST request onto
- // system/ajax without actually viewing the concerned form in the browser.
- // This is likely a hacking attempt as it never happens under normal
- // circumstances, so we just do nothing.
- watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING);
- drupal_exit();
- }
-
- // Since some of the submit handlers are run, redirects need to be disabled.
- $form_state['no_redirect'] = TRUE;
-
- // The form needs to be processed; prepare for that by setting a few internal
- // variables.
- $form_state['input'] = $_POST;
- $form_id = $form['#form_id'];
-
- return array($form, $form_state, $form_id, $form_build_id);
-}
-
-/**
- * Menu callback; handles AJAX requests for the #ajax Form API property.
- *
- * This rebuilds the form from cache and invokes the defined #ajax['callback']
- * to return an AJAX command structure for JavaScript. In case no 'callback' has
- * been defined, nothing will happen.
- *
- * The Form API #ajax property can be set both for buttons and other input
- * elements.
- *
- * This function is also the canonical example of how to implement
- * #ajax['path']. If processing is required that cannot be accomplished with
- * a callback, re-implement this function and set #ajax['path'] to the
- * enhanced function.
- */
-function ajax_form_callback() {
- list($form, $form_state, $form_id, $form_build_id) = ajax_get_form();
-
- // Build, validate and if possible, submit the form.
- drupal_process_form($form_id, $form, $form_state);
-
- // This call recreates the form relying solely on the $form_state that
- // drupal_process_form() set up.
- $form = drupal_rebuild_form($form_id, $form_state, $form);
-
- // As part of drupal_process_form(), the element that triggered the form
- // submission is determined, and in the case of AJAX, it might not be a
- // button. This lets us route to the appropriate callback.
- if (!empty($form_state['triggering_element'])) {
- $callback = $form_state['triggering_element']['#ajax']['callback'];
- }
- if (!empty($callback) && function_exists($callback)) {
- return $callback($form, $form_state);
- }
-}
-
-/**
- * Package and send the result of a page callback to the browser as an AJAX response.
- *
- * @param $page_callback_result
- * The result of a page callback. Can be one of:
- * - NULL: to indicate no content.
- * - An integer menu status constant: to indicate an error condition.
- * - A string of HTML content.
- * - A renderable array of content.
- */
-function ajax_deliver($page_callback_result) {
- $commands = array();
- $header = TRUE;
-
- // Normalize whatever was returned by the page callback to an AJAX commands
- // array.
- if (!isset($page_callback_result)) {
- // Simply delivering an empty commands array is sufficient. This results
- // in the AJAX request being completed, but nothing being done to the page.
- }
- elseif (is_int($page_callback_result)) {
- switch ($page_callback_result) {
- case MENU_NOT_FOUND:
- $commands[] = ajax_command_alert(t('The requested page could not be found.'));
- break;
-
- case MENU_ACCESS_DENIED:
- $commands[] = ajax_command_alert(t('You are not authorized to access this page.'));
- break;
-
- case MENU_SITE_OFFLINE:
- $commands[] = ajax_command_alert(filter_xss_admin(variable_get('maintenance_mode_message',
- t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))));
- break;
- }
- }
- elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax')) {
- // Complex AJAX callbacks can return a result that contains an error message
- // or a specific set of commands to send to the browser.
- $page_callback_result += element_info('ajax');
- $header = $page_callback_result['#header'];
- $error = $page_callback_result['#error'];
- if (isset($error) && $error !== FALSE) {
- if ((empty($error) || $error === TRUE)) {
- $error = t('An error occurred while handling the request: The server received invalid input.');
- }
- $commands[] = ajax_command_alert($error);
- }
- else {
- $commands = $page_callback_result['#commands'];
- }
- }
- else {
- // Like normal page callbacks, simple AJAX callbacks can return HTML
- // content, as a string or render array. This HTML is inserted in some
- // relationship to #ajax['wrapper'], as determined by which jQuery DOM
- // manipulation method is used. The method used is specified by
- // #ajax['method']. The default method is 'replaceWith', which completely
- // replaces the old wrapper element and its content with the new HTML.
- $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result);
- $commands[] = ajax_command_insert(NULL, $html);
- // Add the status messages inside the new content's wrapper element, so that
- // on subsequent AJAX requests, it is treated as old content.
- $commands[] = ajax_command_prepend(NULL, theme('status_messages'));
- }
-
- // This function needs to do the same thing that drupal_deliver_html_page()
- // does: add any needed http headers, print rendered output, and perform
- // end-of-request tasks. By default, $header=TRUE, and we add a
- // 'text/javascript' header. The page callback can override $header by
- // returning an 'ajax' element with a #header property. This can be set to
- // FALSE to prevent the 'text/javascript' header from being output, necessary
- // when outputting to an IFRAME. This can also be set to 'multipart', in which
- // case, we don't output JSON, but JSON content wrapped in a textarea, making
- // a 'text/javascript' header incorrect.
- if ($header && $header !== 'multipart') {
- drupal_add_http_header('Content-Type', 'text/javascript; charset=utf-8');
- }
- $output = ajax_render($commands);
- if ($header === 'multipart') {
- // jQuery file uploads: http://malsup.com/jquery/form/#code-samples
- $output = '<textarea>' . $output . '</textarea>';
- }
- print $output;
- ajax_footer();
-}
-
-/**
- * Perform end-of-AJAX-request tasks.
- *
- * This function is the equivalent of drupal_page_footer(), but for AJAX
- * requests.
- *
- * @see drupal_page_footer()
- */
-function ajax_footer() {
- // Even for AJAX requests, invoke hook_exit() implementations. There may be
- // modules that need very fast AJAX responses, and therefore, run AJAX
- // requests with an early bootstrap.
- if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) {
- module_invoke_all('exit');
- }
-
- // Commit the user session. See above comment about the possibility of this
- // function running without session.inc loaded.
- if (function_exists('drupal_session_commit')) {
- drupal_session_commit();
- }
-}
-
-/**
- * Add AJAX information about a form element to the page to communicate with JavaScript.
- *
- * If #ajax['path'] is set on an element, this additional JavaScript is added
- * to the page header to attach the AJAX behaviors. See ajax.js for more
- * information.
- *
- * @param $element
- * An associative array containing the properties of the element.
- * Properties used:
- * - #ajax['event']
- * - #ajax['path']
- * - #ajax['wrapper']
- * - #ajax['parameters']
- * - #ajax['effect']
- *
- * @return
- * None. Additional code is added to the header of the page using
- * drupal_add_js().
- */
-function ajax_process_form($element, &$form_state) {
- // Nothing to do if there is neither a callback nor a path.
- if (!(isset($element['#ajax']['callback']) || isset($element['#ajax']['path']))) {
- return $element;
- }
-
- // Add a reasonable default event handler if none was specified.
- if (isset($element['#ajax']) && !isset($element['#ajax']['event'])) {
- switch ($element['#type']) {
- case 'submit':
- case 'button':
- case 'image_button':
- // Use the mousedown instead of the click event because form
- // submission via pressing the enter key triggers a click event on
- // submit inputs, inappropriately triggering AJAX behaviors.
- $element['#ajax']['event'] = 'mousedown';
- // Attach an additional event handler so that AJAX behaviors
- // can be triggered still via keyboard input.
- $element['#ajax']['keypress'] = TRUE;
- break;
-
- case 'password':
- case 'textfield':
- case 'textarea':
- $element['#ajax']['event'] = 'blur';
- break;
-
- case 'radio':
- case 'checkbox':
- case 'select':
- $element['#ajax']['event'] = 'change';
- break;
-
- default:
- return $element;
- }
- }
-
- // Attach JavaScript settings to the element.
- if (isset($element['#ajax']['event'])) {
- $element['#attached']['library'][] = array('system', 'form');
- $element['#attached']['js']['misc/ajax.js'] = array('weight' => JS_LIBRARY + 2);
-
- $settings = $element['#ajax'];
-
- // Assign default settings.
- $settings += array(
- 'selector' => '#' . $element['#id'],
- 'effect' => 'none',
- 'speed' => 'none',
- 'method' => 'replaceWith',
- 'progress' => array('type' => 'throbber'),
- );
-
- // @todo Legacy support. Remove in Drupal 8.
- if ($settings['method'] == 'replace') {
- $settings['method'] = 'replaceWith';
- }
-
- // Change path to url.
- $settings['url'] = isset($settings['path']) ? url($settings['path']) : url('system/ajax');
- unset($settings['path']);
-
- // Add special data to $settings['submit'] so that when this element
- // triggers an AJAX submission, Drupal's form processing can determine which
- // element triggered it.
- // @see _form_element_triggered_scripted_submission()
- if (isset($settings['trigger_as'])) {
- // An element can add a 'trigger_as' key within #ajax to make the element
- // submit as though another one (for example, a non-button can use this
- // to submit the form as though a button were clicked). When using this,
- // the 'name' key is always required to identify the element to trigger
- // as. The 'value' key is optional, and only needed when multiple elements
- // share the same name, which is commonly the case for buttons.
- $settings['submit']['_triggering_element_name'] = $settings['trigger_as']['name'];
- if (isset($settings['trigger_as']['value'])) {
- $settings['submit']['_triggering_element_value'] = $settings['trigger_as']['value'];
- }
- unset($settings['trigger_as']);
- }
- else {
- // Most of the time, elements can submit as themselves, in which case the
- // 'trigger_as' key isn't needed, and the element's name is used.
- $settings['submit']['_triggering_element_name'] = $element['#name'];
- // If the element is a (non-image) button, its name may not identify it
- // uniquely, in which case a match on value is also needed.
- // @see _form_button_was_clicked()
- if (isset($element['#button_type']) && empty($element['#has_garbage_value'])) {
- $settings['submit']['_triggering_element_value'] = $element['#value'];
- }
- }
-
- // Convert a simple #ajax['progress'] string into an array.
- if (is_string($settings['progress'])) {
- $settings['progress'] = array('type' => $settings['progress']);
- }
- // Change progress path to a full URL.
- if (isset($settings['progress']['path'])) {
- $settings['progress']['url'] = url($settings['progress']['path']);
- unset($settings['progress']['path']);
- }
- // Add progress.js if we're doing a bar display.
- if ($settings['progress']['type'] == 'bar') {
- $element['#attached']['js']['misc/progress.js'] = array('cache' => FALSE);
- }
-
- $element['#attached']['js'][] = array(
- 'type' => 'setting',
- 'data' => array('ajax' => array($element['#id'] => $settings)),
- );
-
- $form_state['cache'] = TRUE;
- }
- return $element;
-}
-
-/**
- * @} End of "defgroup ajax".
- */
-
-/**
- * @defgroup ajax_commands AJAX framework commands
- * @{
- */
-
-/**
- * Creates a Drupal AJAX 'alert' command.
- *
- * The 'alert' command instructs the client to display a JavaScript alert
- * dialog box.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.alert()
- * defined in misc/ajax.js.
- *
- * @param $text
- * The message string to display to the user.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- */
-function ajax_command_alert($text) {
- return array(
- 'command' => 'alert',
- 'text' => $text,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert' command using the method in #ajax['method'].
- *
- * This command instructs the client to insert the given HTML using whichever
- * jQuery DOM manipulation method has been specified in the #ajax['method']
- * variable of the element that triggered the request.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- */
-function ajax_command_insert($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => NULL,
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/replaceWith' command.
- *
- * The 'insert/replaceWith' command instructs the client to use jQuery's
- * replaceWith() method to replace each element matched matched by the given
- * selector with the given HTML.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery replaceWith() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * See @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
- */
-function ajax_command_replace($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'replaceWith',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/html' command.
- *
- * The 'insert/html' command instructs the client to use jQuery's html()
- * method to set the HTML content of each element matched by the given
- * selector while leaving the outer tags intact.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery html() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Attributes/html#val
- */
-function ajax_command_html($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'html',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/prepend' command.
- *
- * The 'insert/prepend' command instructs the client to use jQuery's prepend()
- * method to prepend the given HTML content to the inside each element matched
- * by the given selector.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery prepend() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Manipulation/prepend#content
- */
-function ajax_command_prepend($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'prepend',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/append' command.
- *
- * The 'insert/append' command instructs the client to use jQuery's append()
- * method to append the given HTML content to the inside each element matched
- * by the given selector.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery append() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Manipulation/append#content
- */
-function ajax_command_append($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'append',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/after' command.
- *
- * The 'insert/after' command instructs the client to use jQuery's after()
- * method to insert the given HTML content after each element matched by
- * the given selector.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery after() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Manipulation/after#content
- */
-function ajax_command_after($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'after',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'insert/before' command.
- *
- * The 'insert/before' command instructs the client to use jQuery's before()
- * method to insert the given HTML content before each of elements matched by
- * the given selector.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $html
- * The data to use with the jQuery before() method.
- * @param $settings
- * An optional array of settings that will be used for this command only.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Manipulation/before#content
- */
-function ajax_command_before($selector, $html, $settings = NULL) {
- return array(
- 'command' => 'insert',
- 'method' => 'before',
- 'selector' => $selector,
- 'data' => $html,
- 'settings' => $settings,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'remove' command.
- *
- * The 'remove' command instructs the client to use jQuery's remove() method
- * to remove each of elements matched by the given selector, and everything
- * within them.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.remove()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Manipulation/remove#expr
- */
-function ajax_command_remove($selector) {
- return array(
- 'command' => 'remove',
- 'selector' => $selector,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'changed' command.
- *
- * This command instructs the client to mark each of the elements matched by the
- * given selector as 'ajax-changed'.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.changed()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $asterisk
- * An optional CSS selector which must be inside $selector. If specified,
- * an asterisk will be appended to the HTML inside the $asterisk selector.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- */
-function ajax_command_changed($selector, $asterisk = '') {
- return array(
- 'command' => 'changed',
- 'selector' => $selector,
- 'asterisk' => $asterisk,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'css' command.
- *
- * The 'css' command will instruct the client to use the jQuery css() method
- * to apply the CSS arguments to elements matched by the given selector.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.insert()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $argument
- * An array of key/value pairs to set in the CSS for the selector.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/CSS/css#properties
- */
-function ajax_command_css($selector, $argument) {
- return array(
- 'command' => 'css',
- 'selector' => $selector,
- 'argument' => $argument,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'settings' command.
- *
- * The 'settings' command instructs the client either to use the given array as
- * the settings for ajax-loaded content or to extend Drupal.settings with the
- * given array, depending on the value of the $merge parameter.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.settings()
- * defined in misc/ajax.js.
- *
- * @param $argument
- * An array of key/value pairs to add to the settings. This will be utilized
- * for all commands after this if they do not include their own settings
- * array.
- * @param $merge
- * Whether or not the passed settings in $argument should be merged into the
- * global Drupal.settings on the page. By default (FALSE), the settings that
- * are passed to Drupal.attachBehaviors will not include the global
- * Drupal.settings.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- */
-function ajax_command_settings($argument, $merge = FALSE) {
- return array(
- 'command' => 'settings',
- 'settings' => $argument,
- 'merge' => $merge,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'data' command.
- *
- * The 'data' command instructs the client to attach the name=value pair of
- * data to the selector via jQuery's data cache.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.data()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string. If the command is a response to a request from
- * an #ajax form element then this value can be NULL.
- * @param $name
- * The name or key (in the key value pair) of the data attached to this
- * selector.
- * @param $value
- * The value of the data. Not just limited to strings can be any format.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- *
- * @see http://docs.jquery.com/Core/data#namevalue
- */
-function ajax_command_data($selector, $name, $value) {
- return array(
- 'command' => 'data',
- 'selector' => $selector,
- 'name' => $name,
- 'value' => $value,
- );
-}
-
-/**
- * Creates a Drupal AJAX 'restripe' command.
- *
- * The 'restripe' command instructs the client to restripe a table. This is
- * usually used after a table has been modified by a replace or append command.
- *
- * This command is implemented by Drupal.ajax.prototype.commands.restripe()
- * defined in misc/ajax.js.
- *
- * @param $selector
- * A jQuery selector string.
- *
- * @return
- * An array suitable for use with the ajax_render() function.
- */
-function ajax_command_restripe($selector) {
- return array(
- 'command' => 'restripe',
- 'selector' => $selector,
- );
-}
-
diff --git a/includes/archiver.inc b/includes/archiver.inc
deleted file mode 100644
index 5e6ef32..0000000
--- a/includes/archiver.inc
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Shared classes and interfaces for the archiver system.
- */
-
-/**
- * Common interface for all Archiver classes.
- */
-interface ArchiverInterface {
-
- /**
- * Constructor for a new archiver instance.
- *
- * @param $file_path
- * The full system path of the archive to manipulate. Only local files
- * are supported. If the file does not yet exist, it will be created if
- * appropriate.
- */
- public function __construct($file_path);
-
- /**
- * Add the specified file or directory to the archive.
- *
- * @param $file_path
- * The full system path of the file or directory to add. Only local files
- * and directories are supported.
- * @return ArchiverInterface
- * The called object.
- */
- public function add($file_path);
-
- /**
- * Remove the specified file from the archive.
- *
- * @param $path
- * The file name relative to the root of the archive to remove.
- * @return ArchiverInterface
- * The called object.
- */
- public function remove($path);
-
- /**
- * Extract multiple files in the archive to the specified path.
- *
- * @param $path
- * A full system path of the directory to which to extract files.
- * @param $files
- * Optionally specify a list of files to be extracted. Files are
- * relative to the root of the archive. If not specified, all files
- * in the archive will be extracted
- * @return ArchiverInterface
- * The called object.
- */
- public function extract($path, Array $files = array());
-
- /**
- * List all files in the archive.
- *
- * @return
- * An array of file names relative to the root of the archive.
- */
- public function listContents();
-}
-
diff --git a/includes/authorize.inc b/includes/authorize.inc
deleted file mode 100644
index 02e6cab..0000000
--- a/includes/authorize.inc
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Helper functions and form handlers used for the authorize.php script.
- */
-
-/**
- * Build the form for choosing a FileTransfer type and supplying credentials.
- */
-function authorize_filetransfer_form($form_state) {
- global $base_url, $is_https;
- $form = array();
-
- // If possible, we want to post this form securely via https.
- $form['#https'] = TRUE;
-
- // CSS we depend on lives in modules/system/maintenance.css, which is loaded
- // via the default maintenance theme.
- $form['#attached']['js'][] = $base_url . '/misc/authorize.js';
-
- // Get all the available ways to transfer files.
- if (empty($_SESSION['authorize_filetransfer_backends'])) {
- drupal_set_message(t('Unable to continue, no available methods of file transfer'), 'error');
- return array();
- }
- $available_backends = $_SESSION['authorize_filetransfer_backends'];
- uasort($available_backends, 'drupal_sort_weight');
-
- if (!$is_https) {
- drupal_set_message(t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. <a href="@https-link">Learn more</a>.', array('@https-link' => 'http://drupal.org/https-information')), 'error');
- }
-
- // Decide on a default backend.
- if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default'])) {
- $authorize_filetransfer_default = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
- }
- elseif ($authorize_filetransfer_default = variable_get('authorize_filetransfer_default', NULL));
- else {
- $authorize_filetransfer_default = key($available_backends);
- }
-
- $form['information']['main_header'] = array(
- '#prefix' => '<h3>',
- '#markup' => t('To continue, provide your server connection details'),
- '#suffix' => '</h3>',
- );
-
- $form['connection_settings']['#tree'] = TRUE;
- $form['connection_settings']['authorize_filetransfer_default'] = array(
- '#type' => 'select',
- '#title' => t('Connection method'),
- '#default_value' => $authorize_filetransfer_default,
- '#weight' => -10,
- );
-
- /*
- * Here we create two submit buttons. For a JS enabled client, they will
- * only ever see submit_process. However, if a client doesn't have JS
- * enabled, they will see submit_connection on the first form (when picking
- * what filetransfer type to use, and submit_process on the second one (which
- * leads to the actual operation).
- */
- $form['submit_connection'] = array(
- '#prefix' => "<br style='clear:both'/>",
- '#name' => 'enter_connection_settings',
- '#type' => 'submit',
- '#value' => t('Enter connection settings'),
- '#weight' => 100,
- );
-
- $form['submit_process'] = array(
- '#name' => 'process_updates',
- '#type' => 'submit',
- '#value' => t('Continue'),
- '#weight' => 100,
- '#attributes' => array('style' => 'display:none'),
- );
-
- // Build a hidden fieldset for each one.
- foreach ($available_backends as $name => $backend) {
- $form['connection_settings']['authorize_filetransfer_default']['#options'][$name] = $backend['title'];
- $form['connection_settings'][$name] = array(
- '#type' => 'fieldset',
- '#attributes' => array('class' => array("filetransfer-$name", 'filetransfer')),
- '#title' => t('@backend connection settings', array('@backend' => $backend['title'])),
- );
-
- $current_settings = variable_get('authorize_filetransfer_connection_settings_' . $name, array());
- $form['connection_settings'][$name] += system_get_filetransfer_settings_form($name, $current_settings);
-
- // Start non-JS code.
- if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default']) && $form_state['values']['connection_settings']['authorize_filetransfer_default'] == $name) {
-
- // If the user switches from JS to non-JS, Drupal (and Batch API) will
- // barf. This is a known bug: http://drupal.org/node/229825.
- setcookie('has_js', '', time() - 3600, '/');
- unset($_COOKIE['has_js']);
-
- // Change the submit button to the submit_process one.
- $form['submit_process']['#attributes'] = array();
- unset($form['submit_connection']);
-
- // Activate the proper filetransfer settings form.
- $form['connection_settings'][$name]['#attributes']['style'] = 'display:block';
- // Disable the select box.
- $form['connection_settings']['authorize_filetransfer_default']['#disabled'] = TRUE;
-
- // Create a button for changing the type of connection.
- $form['connection_settings']['change_connection_type'] = array(
- '#name' => 'change_connection_type',
- '#type' => 'submit',
- '#value' => t('Change connection type'),
- '#weight' => -5,
- '#attributes' => array('class' => 'filetransfer-change-connection-type'),
- );
- }
- // End non-JS code.
- }
- return $form;
-}
-
-/**
- * Validate callback for the filetransfer authorization form.
- *
- * @see authorize_filetransfer_form()
- */
-function authorize_filetransfer_form_validate($form, &$form_state) {
- if (isset($form_state['values']['connection_settings'])) {
- $backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
- $filetransfer = authorize_get_filetransfer($backend, $form_state['values']['connection_settings'][$backend]);
- try {
- if (!$filetransfer) {
- throw new Exception(t('Error, this type of connection protocol (%backend) does not exist.', array('%backend' => $backend)));
- }
- $filetransfer->connect();
- }
- catch (Exception $e) {
- form_set_error('connection_settings', $e->getMessage());
- }
- }
-}
-
-/**
- * Submit callback when a file transfer is being authorized.
- *
- * @see authorize_filetransfer_form()
- */
-function authorize_filetransfer_form_submit($form, &$form_state) {
- global $base_url;
- switch ($form_state['clicked_button']['#name']) {
- case 'process_updates':
-
- // Save the connection settings to the DB.
- $filetransfer_backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
-
- // If the database is available then try to save our settings. We have
- // to make sure it is available since this code could potentially (will
- // likely) be called during the installation process, before the
- // database is set up.
- try {
- $connection_settings = array();
- foreach ($form_state['values']['connection_settings'][$filetransfer_backend] as $key => $value) {
- // We do *not* want to store passwords in the database, unless the
- // backend explicitly says so via the magic #filetransfer_save form
- // property. Otherwise, we store everything that's not explicitly
- // marked with #filetransfer_save set to FALSE.
- if (!isset($form['connection_settings'][$filetransfer_backend][$key]['#filetransfer_save'])) {
- if ($form['connection_settings'][$filetransfer_backend][$key]['#type'] != 'password') {
- $connection_settings[$key] = $value;
- }
- }
- // The attribute is defined, so only save if set to TRUE.
- elseif ($form['connection_settings'][$filetransfer_backend][$key]['#filetransfer_save']) {
- $connection_settings[$key] = $value;
- }
- }
- // Set this one as the default authorize method.
- variable_set('authorize_filetransfer_default', $filetransfer_backend);
- // Save the connection settings minus the password.
- variable_set('authorize_filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings);
-
- $filetransfer = authorize_get_filetransfer($filetransfer_backend, $form_state['values']['connection_settings'][$filetransfer_backend]);
-
- // Now run the operation.
- authorize_run_operation($filetransfer);
- }
- catch (Exception $e) {
- // If there is no database available, we don't care and just skip
- // this part entirely.
- }
-
- break;
-
- case 'enter_connection_settings':
- $form_state['rebuild'] = TRUE;
- break;
-
- case 'change_connection_type':
- $form_state['rebuild'] = TRUE;
- unset($form_state['values']['connection_settings']['authorize_filetransfer_default']);
- break;
- }
-}
-
-/**
- * Run the operation specified in $_SESSION['authorize_operation']
- *
- * @param $filetransfer
- * The FileTransfer object to use for running the operation.
- */
-function authorize_run_operation($filetransfer) {
- $operation = $_SESSION['authorize_operation'];
- unset($_SESSION['authorize_operation']);
-
- if (!empty($operation['page_title'])) {
- drupal_set_title(check_plain($operation['page_title']));
- }
-
- require_once DRUPAL_ROOT . '/' . $operation['file'];
- call_user_func_array($operation['callback'], array_merge(array($filetransfer), $operation['arguments']));
-}
-
-/**
- * Get a FileTransfer class for a specific transfer method and settings.
- *
- * @param $backend
- * The FileTransfer backend to get the class for.
- * @param $settings
- * Array of settings for the FileTransfer.
- * @return
- * An instantiated FileTransfer object for the requested method and settings,
- * or FALSE if there was an error finding or instantiating it.
- */
-function authorize_get_filetransfer($backend, $settings = array()) {
- $filetransfer = FALSE;
- if (!empty($_SESSION['authorize_filetransfer_backends'][$backend])) {
- $filetransfer = call_user_func_array(array($_SESSION['authorize_filetransfer_backends'][$backend]['class'], 'factory'), array(DRUPAL_ROOT, $settings));
- }
- return $filetransfer;
-}
-
diff --git a/includes/batch.inc b/includes/batch.inc
deleted file mode 100644
index 7fcc915..0000000
--- a/includes/batch.inc
+++ /dev/null
@@ -1,519 +0,0 @@
-<?php
-// $Id$
-
-
-/**
- * @file
- * Batch processing API for processes to run in multiple HTTP requests.
- *
- * Note that batches are usually invoked by form submissions, which is
- * why the core interaction functions of the batch processing API live in
- * form.inc.
- *
- * @see form.inc
- * @see batch_set()
- * @see batch_process()
- * @see batch_get()
- */
-
-/**
- * Loads a batch from the database.
- *
- * @param $id
- * The ID of the batch to load. When a progressive batch is being processed,
- * the relevant ID is found in $_REQUEST['id'].
- * @return
- * An array representing the batch, or FALSE if no batch was found.
- */
-function batch_load($id) {
- $batch = db_query("SELECT batch FROM {batch} WHERE bid = :bid AND token = :token", array(
- ':bid' => $id,
- ':token' => drupal_get_token($id),
- ))->fetchField();
- if ($batch) {
- return unserialize($batch);
- }
- return FALSE;
-}
-
-/**
- * State-based dispatcher for the batch processing page.
- *
- * @see _batch_shutdown()
- */
-function _batch_page() {
- $batch = &batch_get();
-
- if (!isset($_REQUEST['id'])) {
- return FALSE;
- }
-
- // Retrieve the current state of the batch.
- if (!$batch) {
- $batch = batch_load($_REQUEST['id']);
- if (!$batch) {
- drupal_set_message(t('No active batch.'), 'error');
- drupal_goto();
- }
- }
-
- // Register database update for the end of processing.
- drupal_register_shutdown_function('_batch_shutdown');
-
- // Add batch-specific CSS.
- foreach ($batch['sets'] as $batch_set) {
- if (isset($batch_set['css'])) {
- foreach ($batch_set['css'] as $css) {
- drupal_add_css($css);
- }
- }
- }
-
- $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
- $output = NULL;
- switch ($op) {
- case 'start':
- $output = _batch_start();
- break;
-
- case 'do':
- // JavaScript-based progress page callback.
- _batch_do();
- break;
-
- case 'do_nojs':
- // Non-JavaScript-based progress page.
- $output = _batch_progress_page_nojs();
- break;
-
- case 'finished':
- $output = _batch_finished();
- break;
- }
-
- return $output;
-}
-
-/**
- * Initialize the batch processing.
- *
- * JavaScript-enabled clients are identified by the 'has_js' cookie set in
- * drupal.js. If no JavaScript-enabled page has been visited during the current
- * user's browser session, the non-JavaScript version is returned.
- */
-function _batch_start() {
- if (isset($_COOKIE['has_js']) && $_COOKIE['has_js']) {
- return _batch_progress_page_js();
- }
- else {
- return _batch_progress_page_nojs();
- }
-}
-
-/**
- * Output a batch processing page with JavaScript support.
- *
- * This initializes the batch and error messages. Note that in JavaScript-based
- * processing, the batch processing page is displayed only once and updated via
- * AHAH requests, so only the first batch set gets to define the page title.
- * Titles specified by subsequent batch sets are not displayed.
- *
- * @see batch_set()
- * @see _batch_do()
- */
-function _batch_progress_page_js() {
- $batch = batch_get();
-
- $current_set = _batch_current_set();
- drupal_set_title($current_set['title'], PASS_THROUGH);
-
- // Merge required query parameters for batch processing into those provided by
- // batch_set() or hook_batch_alter().
- $batch['url_options']['query']['id'] = $batch['id'];
-
- $js_setting = array(
- 'batch' => array(
- 'errorMessage' => $current_set['error_message'] . '<br />' . $batch['error_message'],
- 'initMessage' => $current_set['init_message'],
- 'uri' => url($batch['url'], $batch['url_options']),
- ),
- );
- drupal_add_js($js_setting, 'setting');
- drupal_add_js('misc/progress.js', array('cache' => FALSE));
- drupal_add_js('misc/batch.js', array('cache' => FALSE));
-
- return '<div id="progress"></div>';
-}
-
-/**
- * Do one execution pass in JavaScript-mode and return progress to the browser.
- *
- * @see _batch_progress_page_js()
- * @see _batch_process()
- */
-function _batch_do() {
- // HTTP POST required.
- if ($_SERVER['REQUEST_METHOD'] != 'POST') {
- drupal_set_message(t('HTTP POST is required.'), 'error');
- drupal_set_title(t('Error'));
- return '';
- }
-
- // Perform actual processing.
- list($percentage, $message) = _batch_process();
-
- drupal_json_output(array('status' => TRUE, 'percentage' => $percentage, 'message' => $message));
-}
-
-/**
- * Output a batch processing page without JavaScript support.
- *
- * @see _batch_process()
- */
-function _batch_progress_page_nojs() {
- $batch = &batch_get();
-
- $current_set = _batch_current_set();
- drupal_set_title($current_set['title'], PASS_THROUGH);
-
- $new_op = 'do_nojs';
-
- if (!isset($batch['running'])) {
- // This is the first page so we return some output immediately.
- $percentage = 0;
- $message = $current_set['init_message'];
- $batch['running'] = TRUE;
- }
- else {
- // This is one of the later requests; do some processing first.
-
- // Error handling: if PHP dies due to a fatal error (e.g. a nonexistent
- // function), it will output whatever is in the output buffer, followed by
- // the error message.
- ob_start();
- $fallback = $current_set['error_message'] . '<br />' . $batch['error_message'];
- $fallback = theme('maintenance_page', array('content' => $fallback, 'show_messages' => FALSE));
-
- // We strip the end of the page using a marker in the template, so any
- // additional HTML output by PHP shows up inside the page rather than below
- // it. While this causes invalid HTML, the same would be true if we didn't,
- // as content is not allowed to appear after </html> anyway.
- list($fallback) = explode('<!--partial-->', $fallback);
- print $fallback;
-
- // Perform actual processing.
- list($percentage, $message) = _batch_process($batch);
- if ($percentage == 100) {
- $new_op = 'finished';
- }
-
- // PHP did not die; remove the fallback output.
- ob_end_clean();
- }
-
- // Merge required query parameters for batch processing into those provided by
- // batch_set() or hook_batch_alter().
- $batch['url_options']['query']['id'] = $batch['id'];
- $batch['url_options']['query']['op'] = $new_op;
-
- $url = url($batch['url'], $batch['url_options']);
- $element = array(
- '#tag' => 'meta',
- '#attributes' => array(
- 'http-equiv' => 'Refresh',
- 'content' => '0; URL=' . $url,
- ),
- );
- drupal_add_html_head($element, 'batch_progress_meta_refresh');
-
- return theme('progress_bar', array('percent' => $percentage, 'message' => $message));
-}
-
-/**
- * Process sets in a batch.
- *
- * If the batch was marked for progressive execution (default), this executes as
- * many operations in batch sets until an execution time of 1 second has been
- * exceeded. It will continue with the next operation of the same batch set in
- * the next request.
- *
- * @return
- * An array containing a completion value (in percent) and a status message.
- */
-function _batch_process() {
- $batch = &batch_get();
- $current_set = &_batch_current_set();
- // Indicate that this batch set needs to be initialized.
- $set_changed = TRUE;
-
- // If this batch was marked for progressive execution (e.g. forms submitted by
- // drupal_form_submit()), initialize a timer to determine whether we need to
- // proceed with the same batch phase when a processing time of 1 second has
- // been exceeded.
- if ($batch['progressive']) {
- timer_start('batch_processing');
- }
-
- if (empty($current_set['start'])) {
- $current_set['start'] = microtime(TRUE);
- }
-
- $queue = _batch_queue($current_set);
-
- while (!$current_set['success']) {
- // If this is the first time we iterate this batch set in the current
- // request, we check if it requires an additional file for functions
- // definitions.
- if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) {
- include_once DRUPAL_ROOT . '/' . $current_set['file'];
- }
-
- $task_message = '';
- // Assume a single pass operation and set the completion level to 1 by
- // default.
- $finished = 1;
-
- if ($item = $queue->claimItem()) {
- list($function, $args) = $item->data;
-
- // Build the 'context' array and execute the function call.
- $batch_context = array(
- 'sandbox' => &$current_set['sandbox'],
- 'results' => &$current_set['results'],
- 'finished' => &$finished,
- 'message' => &$task_message,
- );
- call_user_func_array($function, array_merge($args, array(&$batch_context)));
-
- if ($finished == 1) {
- // Make sure this step is not counted twice when computing $current.
- $finished = 0;
- // Remove the processed operation and clear the sandbox.
- $queue->deleteItem($item);
- $current_set['count']--;
- $current_set['sandbox'] = array();
- }
- }
-
- // When all operations in the current batch set are completed, browse
- // through the remaining sets, marking them 'successfully processed'
- // along the way, until we find a set that contains operations.
- // _batch_next_set() executes form submit handlers stored in 'control'
- // sets (see form_execute_handlers()), which can in turn add new sets to
- // the batch.
- $set_changed = FALSE;
- $old_set = $current_set;
- while (empty($current_set['count']) && ($current_set['success'] = TRUE) && _batch_next_set()) {
- $current_set = &_batch_current_set();
- $current_set['start'] = microtime(TRUE);
- $set_changed = TRUE;
- }
-
- // At this point, either $current_set contains operations that need to be
- // processed or all sets have been completed.
- $queue = _batch_queue($current_set);
-
- // If we are in progressive mode, break processing after 1 second.
- if ($batch['progressive'] && timer_read('batch_processing') > 1000) {
- // Record elapsed wall clock time.
- $current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
- break;
- }
- }
-
- if ($batch['progressive']) {
- // Gather progress information.
-
- // Reporting 100% progress will cause the whole batch to be considered
- // processed. If processing was paused right after moving to a new set,
- // we have to use the info from the new (unprocessed) set.
- if ($set_changed && isset($current_set['queue'])) {
- // Processing will continue with a fresh batch set.
- $remaining = $current_set['count'];
- $total = $current_set['total'];
- $progress_message = $current_set['init_message'];
- $task_message = '';
- }
- else {
- // Processing will continue with the current batch set.
- $remaining = $old_set['count'];
- $total = $old_set['total'];
- $progress_message = $old_set['progress_message'];
- }
-
- $current = $total - $remaining + $finished;
- $percentage = _batch_api_percentage($total, $current);
- $elapsed = $current_set['elapsed'];
- $values = array(
- '@remaining' => $remaining,
- '@total' => $total,
- '@current' => floor($current),
- '@percentage' => $percentage,
- '@elapsed' => format_interval($elapsed / 1000),
- // If possible, estimate remaining processing time.
- '@estimate' => ($current > 0) ? format_interval(($elapsed * ($total - $current) / $current) / 1000) : '-',
- );
- $message = strtr($progress_message, $values);
- if (!empty($message)) {
- $message .= '<br />';
- }
- if (!empty($task_message)) {
- $message .= $task_message;
- }
-
- return array($percentage, $message);
- }
- else {
- // If we are not in progressive mode, the entire batch has been processed.
- return _batch_finished();
- }
-}
-
-/**
- * Helper function for _batch_process(): returns the formatted percentage.
- *
- * @param $total
- * The total number of operations.
- * @param $current
- * The number of the current operation.
- * @return
- * The properly formatted percentage, as a string. We output percentages
- * using the correct number of decimal places so that we never print "100%"
- * until we are finished, but we also never print more decimal places than
- * are meaningful.
- */
-function _batch_api_percentage($total, $current) {
- if (!$total || $total == $current) {
- // If $total doesn't evaluate as true or is equal to the current set, then
- // we're finished, and we can return "100".
- $percentage = "100";
- }
- else {
- // We add a new digit at 200, 2000, etc. (since, for example, 199/200
- // would round up to 100% if we didn't).
- $decimal_places = max(0, floor(log10($total / 2.0)) - 1);
- $percentage = sprintf('%01.' . $decimal_places . 'f', round($current / $total * 100, $decimal_places));
- }
- return $percentage;
-}
-
-/**
- * Return the batch set being currently processed.
- */
-function &_batch_current_set() {
- $batch = &batch_get();
- return $batch['sets'][$batch['current_set']];
-}
-
-/**
- * Retrieve the next set in a batch.
- *
- * If there is a subsequent set in this batch, assign it as the new set to
- * process and execute its form submit handler (if defined), which may add
- * further sets to this batch.
- *
- * @return
- * TRUE if a subsequent set was found in the batch.
- */
-function _batch_next_set() {
- $batch = &batch_get();
- if (isset($batch['sets'][$batch['current_set'] + 1])) {
- $batch['current_set']++;
- $current_set = &_batch_current_set();
- if (isset($current_set['form_submit']) && ($function = $current_set['form_submit']) && function_exists($function)) {
- // We use our stored copies of $form and $form_state to account for
- // possible alterations by previous form submit handlers.
- $function($batch['form_state']['complete form'], $batch['form_state']);
- }
- return TRUE;
- }
-}
-
-/**
- * End the batch processing.
- *
- * Call the 'finished' callback of each batch set to allow custom handling of
- * the results and resolve page redirection.
- */
-function _batch_finished() {
- $batch = &batch_get();
-
- // Execute the 'finished' callbacks for each batch set, if defined.
- foreach ($batch['sets'] as $batch_set) {
- if (isset($batch_set['finished'])) {
- // Check if the set requires an additional file for function definitions.
- if (isset($batch_set['file']) && is_file($batch_set['file'])) {
- include_once DRUPAL_ROOT . '/' . $batch_set['file'];
- }
- if (function_exists($batch_set['finished'])) {
- $queue = _batch_queue($batch_set);
- $operations = $queue->getAllItems();
- $batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
- }
- }
- }
-
- // Clean up the batch table and unset the static $batch variable.
- if ($batch['progressive']) {
- db_delete('batch')
- ->condition('bid', $batch['id'])
- ->execute();
- foreach ($batch['sets'] as $batch_set) {
- if ($queue = _batch_queue($batch_set)) {
- $queue->deleteQueue();
- }
- }
- }
- $_batch = $batch;
- $batch = NULL;
-
- // Clean-up the session. Not needed for CLI updates.
- if (isset($_SESSION)) {
- unset($_SESSION['batches'][$batch['id']]);
- if (empty($_SESSION['batches'])) {
- unset($_SESSION['batches']);
- }
- }
-
- // Redirect if needed.
- if ($_batch['progressive']) {
- // Revert the 'destination' that was saved in batch_process().
- if (isset($_batch['destination'])) {
- $_GET['destination'] = $_batch['destination'];
- }
-
- // Determine the target path to redirect to.
- if (!isset($_batch['form_state']['redirect'])) {
- if (isset($_batch['redirect'])) {
- $_batch['form_state']['redirect'] = $_batch['redirect'];
- }
- else {
- $_batch['form_state']['redirect'] = $_batch['source_url'];
- }
- }
-
- // Use drupal_redirect_form() to handle the redirection logic.
- drupal_redirect_form($_batch['form_state']);
-
- // If no redirection happened, save the final $form_state value to be
- // retrieved by drupal_get_form() and redirect to the originating page.
- $_SESSION['batch_form_state'] = $_batch['form_state'];
- $function = $_batch['redirect_callback'];
- if (function_exists($function)) {
- $function($_batch['source_url'], array('query' => array('op' => 'finish', 'id' => $_batch['id'])));
- }
- }
-}
-
-/**
- * Shutdown function; store the current batch data for the next request.
- */
-function _batch_shutdown() {
- if ($batch = batch_get()) {
- db_update('batch')
- ->fields(array('batch' => serialize($batch)))
- ->condition('bid', $batch['id'])
- ->execute();
- }
-}
-
diff --git a/includes/batch.queue.inc b/includes/batch.queue.inc
deleted file mode 100644
index 8193280..0000000
--- a/includes/batch.queue.inc
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-// $Id$
-
-
-/**
- * @file
- * Queue handlers used by the Batch API.
- *
- * Those implementations:
- * - ensure FIFO ordering,
- * - let an item be repeatedly claimed until it is actually deleted (no notion
- * of lease time or 'expire' date), to allow multipass operations.
- */
-
-/**
- * Batch queue implementation.
- *
- * Stale items from failed batches are cleaned from the {queue} table on cron
- * using the 'created' date.
- */
-class BatchQueue extends SystemQueue {
-
- public function claimItem($lease_time = 0) {
- $item = db_query('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(':name' => $this->name))->fetchObject();
- if ($item) {
- $item->data = unserialize($item->data);
- return $item;
- }
- return FALSE;
- }
-
- /**
- * Retrieve all remaining items in the queue.
- *
- * This is specific to Batch API and is not part of the DrupalQueueInterface,
- */
- public function getAllItems() {
- $result = array();
- $items = db_query('SELECT data FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(':name' => $this->name))->fetchAll();
- foreach ($items as $item) {
- $result[] = unserialize($item->data);
- }
- return $result;
- }
-}
-
-/**
- * Batch queue implementation used for non-progressive batches.
- */
-class BatchMemoryQueue extends MemoryQueue {
-
- public function claimItem($lease_time = 0) {
- if (!empty($this->queue)) {
- reset($this->queue);
- return current($this->queue);
- }
- return FALSE;
- }
-
- /**
- * Retrieve all remaining items in the queue.
- *
- * This is specific to Batch API and is not part of the DrupalQueueInterface,
- */
- public function getAllItems() {
- $result = array();
- foreach ($this->queue as $item) {
- $result[] = $item->data;
- }
- return $result;
- }
-}
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
deleted file mode 100644
index c41b67b..0000000
--- a/includes/bootstrap.inc
+++ /dev/null
@@ -1,3026 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Functions that need to be loaded on every Drupal request.
- */
-
-/**
- * The current system version.
- */
-define('VERSION', '7.0-dev');
-
-/**
- * Core API compatibility.
- */
-define('DRUPAL_CORE_COMPATIBILITY', '7.x');
-
-/**
- * Minimum supported version of PHP.
- */
-define('DRUPAL_MINIMUM_PHP', '5.2.0');
-
-/**
- * Minimum recommended value of PHP memory_limit.
- */
-define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT', '40M');
-
-/**
- * Minimum supported version of MySQL, if it is used.
- */
-define('DRUPAL_MINIMUM_MYSQL', '5.0.15');
-
-/**
- * Minimum supported version of PostgreSQL, if it is used.
- */
-define('DRUPAL_MINIMUM_PGSQL', '8.3');
-
-/**
- * Indicates that the item should never be removed unless explicitly selected.
- *
- * The item may be removed using cache_clear_all() with a cache ID.
- */
-define('CACHE_PERMANENT', 0);
-
-/**
- * Indicates that the item should be removed at the next general cache wipe.
- */
-define('CACHE_TEMPORARY', -1);
-
-/**
- * Log message severity -- Emergency: system is unusable.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_EMERGENCY', 0);
-
-/**
- * Log message severity -- Alert: action must be taken immediately.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_ALERT', 1);
-
-/**
- * Log message severity -- Critical: critical conditions.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_CRITICAL', 2);
-
-/**
- * Log message severity -- Error: error conditions.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_ERROR', 3);
-
-/**
- * Log message severity -- Warning: warning conditions.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_WARNING', 4);
-
-/**
- * Log message severity -- Notice: normal but significant condition.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_NOTICE', 5);
-
-/**
- * Log message severity -- Informational: informational messages.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_INFO', 6);
-
-/**
- * Log message severity -- Debug: debug-level messages.
- *
- * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
- *
- * @see watchdog()
- * @see watchdog_severity_levels()
- */
-define('WATCHDOG_DEBUG', 7);
-
-/**
- * First bootstrap phase: initialize configuration.
- */
-define('DRUPAL_BOOTSTRAP_CONFIGURATION', 0);
-
-/**
- * Second bootstrap phase: try to serve a cached page.
- */
-define('DRUPAL_BOOTSTRAP_PAGE_CACHE', 1);
-
-/**
- * Third bootstrap phase: initialize database layer.
- */
-define('DRUPAL_BOOTSTRAP_DATABASE', 2);
-
-/**
- * Fourth bootstrap phase: initialize the variable system.
- */
-define('DRUPAL_BOOTSTRAP_VARIABLES', 3);
-
-/**
- * Fifth bootstrap phase: initialize session handling.
- */
-define('DRUPAL_BOOTSTRAP_SESSION', 4);
-
-/**
- * Sixth bootstrap phase: set up the page header.
- */
-define('DRUPAL_BOOTSTRAP_PAGE_HEADER', 5);
-
-/**
- * Seventh bootstrap phase: find out language of the page.
- */
-define('DRUPAL_BOOTSTRAP_LANGUAGE', 6);
-
-/**
- * Final bootstrap phase: Drupal is fully loaded; validate and fix
- * input data.
- */
-define('DRUPAL_BOOTSTRAP_FULL', 7);
-
-/**
- * Role ID for anonymous users; should match what's in the "role" table.
- */
-define('DRUPAL_ANONYMOUS_RID', 1);
-
-/**
- * Role ID for authenticated users; should match what's in the "role" table.
- */
-define('DRUPAL_AUTHENTICATED_RID', 2);
-
-/**
- * The number of bytes in a kilobyte. For more information, visit
- * http://en.wikipedia.org/wiki/Kilobyte.
- */
-define('DRUPAL_KILOBYTE', 1024);
-
-/**
- * The language code used when no language is explicitly assigned.
- *
- * Defined by ISO639-2 for "Undetermined".
- */
-define('LANGUAGE_NONE', 'und');
-
-/**
- * The type of language used to define the content language.
- */
-define('LANGUAGE_TYPE_CONTENT', 'language_content');
-
-/**
- * The type of language used to select the user interface.
- */
-define('LANGUAGE_TYPE_INTERFACE', 'language');
-
-/**
- * The type of language used for URLs.
- */
-define('LANGUAGE_TYPE_URL', 'language_url');
-
-/**
- * Language written left to right. Possible value of $language->direction.
- */
-define('LANGUAGE_LTR', 0);
-
-/**
- * Language written right to left. Possible value of $language->direction.
- */
-define('LANGUAGE_RTL', 1);
-
-/**
- * For convenience, define a short form of the request time global.
- */
-define('REQUEST_TIME', $_SERVER['REQUEST_TIME']);
-
-/**
- * @name Title text filtering flags
- * @{
- * Flags for use in drupal_set_title().
- */
-
-/**
- * Flag for drupal_set_title(); text is not sanitized, so run check_plain().
- */
-define('CHECK_PLAIN', 0);
-
-/**
- * Flag for drupal_set_title(); text has already been sanitized.
- */
-define('PASS_THROUGH', -1);
-
-/**
- * @} End of "Title text filtering flags".
- */
-
-/**
- * Signals that the registry lookup cache should be reset.
- */
-define('REGISTRY_RESET_LOOKUP_CACHE', 1);
-
-/**
- * Signals that the registry lookup cache should be written to storage.
- */
-define('REGISTRY_WRITE_LOOKUP_CACHE', 2);
-
-/**
- * Start the timer with the specified name. If you start and stop the same
- * timer multiple times, the measured intervals will be accumulated.
- *
- * @param name
- * The name of the timer.
- */
-function timer_start($name) {
- global $timers;
-
- $timers[$name]['start'] = microtime(TRUE);
- $timers[$name]['count'] = isset($timers[$name]['count']) ? ++$timers[$name]['count'] : 1;
-}
-
-/**
- * Read the current timer value without stopping the timer.
- *
- * @param name
- * The name of the timer.
- * @return
- * The current timer value in ms.
- */
-function timer_read($name) {
- global $timers;
-
- if (isset($timers[$name]['start'])) {
- $stop = microtime(TRUE);
- $diff = round(($stop - $timers[$name]['start']) * 1000, 2);
-
- if (isset($timers[$name]['time'])) {
- $diff += $timers[$name]['time'];
- }
- return $diff;
- }
- return $timers[$name]['time'];
-}
-
-/**
- * Stop the timer with the specified name.
- *
- * @param name
- * The name of the timer.
- * @return
- * A timer array. The array contains the number of times the timer has been
- * started and stopped (count) and the accumulated timer value in ms (time).
- */
-function timer_stop($name) {
- global $timers;
-
- if (isset($timers[$name]['start'])) {
- $stop = microtime(TRUE);
- $diff = round(($stop - $timers[$name]['start']) * 1000, 2);
- if (isset($timers[$name]['time'])) {
- $timers[$name]['time'] += $diff;
- }
- else {
- $timers[$name]['time'] = $diff;
- }
- unset($timers[$name]['start']);
- }
-
- return $timers[$name];
-}
-
-/**
- * Find the appropriate configuration directory.
- *
- * Try finding a matching configuration directory by stripping the website's
- * hostname from left to right and pathname from right to left. The first
- * configuration file found will be used; the remaining will ignored. If no
- * configuration file is found, return a default value '$confdir/default'.
- *
- * Example for a fictitious site installed at
- * http://www.drupal.org:8080/mysite/test/ the 'settings.php' is searched in
- * the following directories:
- *
- * 1. $confdir/8080.www.drupal.org.mysite.test
- * 2. $confdir/www.drupal.org.mysite.test
- * 3. $confdir/drupal.org.mysite.test
- * 4. $confdir/org.mysite.test
- *
- * 5. $confdir/8080.www.drupal.org.mysite
- * 6. $confdir/www.drupal.org.mysite
- * 7. $confdir/drupal.org.mysite
- * 8. $confdir/org.mysite
- *
- * 9. $confdir/8080.www.drupal.org
- * 10. $confdir/www.drupal.org
- * 11. $confdir/drupal.org
- * 12. $confdir/org
- *
- * 13. $confdir/default
- *
- * If a file named sites.php is present in the $confdir, it will be loaded
- * prior to scanning for directories. It should define an associative array
- * named $sites, which maps domains to directories. It should be in the form
- * of:
- *
- * $sites = array(
- * 'The url to alias' => 'A directory within the sites directory'
- * );
- *
- * For example:
- *
- * $sites = array(
- * 'devexample.com' => 'example.com',
- * 'localhost.example' => 'example.com',
- * );
- *
- * The above array will cause Drupal to look for a directory named
- * "example.com" in the sites directory whenever a request comes from
- * "example.com", "devexample.com", or "localhost/example". That is useful
- * on development servers, where the domain name may not be the same as the
- * domain of the live server. Since Drupal stores file paths into the database
- * (files, system table, etc.) this will ensure the paths are correct while
- * accessed on development servers.
- *
- * @param $require_settings
- * Only configuration directories with an existing settings.php file
- * will be recognized. Defaults to TRUE. During initial installation,
- * this is set to FALSE so that Drupal can detect a matching directory,
- * then create a new settings.php file in it.
- * @param reset
- * Force a full search for matching directories even if one had been
- * found previously.
- * @return
- * The path of the matching directory.
- */
-function conf_path($require_settings = TRUE, $reset = FALSE) {
- $conf = &drupal_static(__FUNCTION__, '');
-
- if ($conf && !$reset) {
- return $conf;
- }
-
- $confdir = 'sites';
-
- $sites = array();
- if (file_exists(DRUPAL_ROOT . '/' . $confdir . '/sites.php')) {
- // This will overwrite $sites with the desired mappings.
- include(DRUPAL_ROOT . '/' . $confdir . '/sites.php');
- }
-
- $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
- $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
- for ($i = count($uri) - 1; $i > 0; $i--) {
- for ($j = count($server); $j > 0; $j--) {
- $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
- if (isset($sites[$dir]) && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $sites[$dir])) {
- $dir = $sites[$dir];
- }
- if (file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists(DRUPAL_ROOT . '/' . $confdir . '/' . $dir))) {
- $conf = "$confdir/$dir";
- return $conf;
- }
- }
- }
- $conf = "$confdir/default";
- return $conf;
-}
-
-/**
- * Set appropriate server variables needed for command line scripts to work.
- *
- * This function can be called by command line scripts before bootstrapping
- * Drupal, to ensure that the page loads with the desired server parameters.
- * This is because many parts of Drupal assume that they are running in a web
- * browser and therefore use information from the global PHP $_SERVER variable
- * that does not get set when Drupal is run from the command line.
- *
- * In many cases, the default way in which this function populates the $_SERVER
- * variable is sufficient, and it can therefore be called without passing in
- * any input. However, command line scripts running on a multisite installation
- * (or on any installation that has settings.php stored somewhere other than
- * the sites/default folder) need to pass in the URL of the site to allow
- * Drupal to detect the correct location of the settings.php file. Passing in
- * the 'url' parameter is also required for functions like request_uri() to
- * return the expected values.
- *
- * Most other parameters do not need to be passed in, but may be necessary in
- * some cases; for example, if Drupal's ip_address() function needs to return
- * anything but the standard localhost value ('127.0.0.1'), the command line
- * script should pass in the desired value via the 'REMOTE_ADDR' key.
- *
- * @param $variables
- * (optional) An associative array of variables within $_SERVER that should
- * be replaced. If the special element 'url' is provided in this array, it
- * will be used to populate some of the server defaults; it should be set to
- * the URL of the current page request, excluding any $_GET request but
- * including the script name (e.g., http://www.example.com/mysite/index.php).
- *
- * @see conf_path()
- * @see request_uri()
- * @see ip_address()
- */
-function drupal_override_server_variables($variables = array()) {
- // Set defaults based on the provided URL.
- if (isset($variables['url'])) {
- $url = parse_url($variables['url']);
- unset($variables['url']);
- }
- else {
- $url = array();
- }
- $url += array(
- 'path' => '',
- 'host' => 'localhost',
- );
- $defaults = array(
- 'HTTP_HOST' => $url['host'],
- 'SCRIPT_NAME' => $url['path'],
- 'REMOTE_ADDR' => '127.0.0.1',
- 'REQUEST_METHOD' => 'GET',
- 'SERVER_NAME' => NULL,
- 'SERVER_SOFTWARE' => NULL,
- 'HTTP_USER_AGENT' => NULL,
- );
- // Replace elements of the $_SERVER array, as appropriate.
- $_SERVER = $variables + $_SERVER + $defaults;
-}
-
-/**
- * Initialize PHP environment.
- */
-function drupal_environment_initialize() {
- if (!isset($_SERVER['HTTP_REFERER'])) {
- $_SERVER['HTTP_REFERER'] = '';
- }
- if (!isset($_SERVER['SERVER_PROTOCOL']) || ($_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.0' && $_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.1')) {
- $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
- }
-
- if (isset($_SERVER['HTTP_HOST'])) {
- // As HTTP_HOST is user input, ensure it only contains characters allowed
- // in hostnames. See RFC 952 (and RFC 2181).
- // $_SERVER['HTTP_HOST'] is lowercased here per specifications.
- $_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
- if (!drupal_valid_http_host($_SERVER['HTTP_HOST'])) {
- // HTTP_HOST is invalid, e.g. if containing slashes it may be an attack.
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
- exit;
- }
- }
- else {
- // Some pre-HTTP/1.1 clients will not send a Host header. Ensure the key is
- // defined for E_ALL compliance.
- $_SERVER['HTTP_HOST'] = '';
- }
-
- // When clean URLs are enabled, emulate ?q=foo/bar using REQUEST_URI. It is
- // not possible to append the query string using mod_rewrite without the B
- // flag (this was added in Apache 2.2.8), because mod_rewrite unescapes the
- // path before passing it on to PHP. This is a problem when the path contains
- // e.g. "&" or "%" that have special meanings in URLs and must be encoded.
- $_GET['q'] = request_path();
-
- // Enforce E_ALL, but allow users to set levels not part of E_ALL.
- error_reporting(E_ALL | error_reporting());
-
- // Override PHP settings required for Drupal to work properly.
- // sites/default/default.settings.php contains more runtime settings.
- // The .htaccess file contains settings that cannot be changed at runtime.
-
- // Prevent PHP from generating HTML error messages.
- ini_set('html_errors', 0);
- // Don't escape quotes when reading files from the database, disk, etc.
- ini_set('magic_quotes_runtime', '0');
- // Use session cookies, not transparent sessions that puts the session id in
- // the query string.
- ini_set('session.use_cookies', '1');
- ini_set('session.use_only_cookies', '1');
- ini_set('session.use_trans_sid', '0');
- // Don't send HTTP headers using PHP's session handler.
- ini_set('session.cache_limiter', 'none');
- // Use httponly session cookies.
- ini_set('session.cookie_httponly', '1');
-
- // Set sane locale settings, to ensure consistent string, dates, times and
- // numbers handling.
- setlocale(LC_ALL, 'C');
-}
-
-/**
- * Validate that a hostname (for example $_SERVER['HTTP_HOST']) is safe.
- *
- * @return
- * TRUE if only containing valid characters, or FALSE otherwise.
- */
-function drupal_valid_http_host($host) {
- return preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host);
-}
-
-/**
- * Loads the configuration and sets the base URL, cookie domain, and
- * session name correctly.
- */
-function drupal_settings_initialize() {
- global $base_url, $base_path, $base_root;
-
- // Export the following settings.php variables to the global namespace
- global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url;
- $conf = array();
-
- if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
- include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';
- }
- $is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
-
- if (isset($base_url)) {
- // Parse fixed base URL from settings.php.
- $parts = parse_url($base_url);
- $http_protocol = $parts['scheme'];
- if (!isset($parts['path'])) {
- $parts['path'] = '';
- }
- $base_path = $parts['path'] . '/';
- // Build $base_root (everything until first slash after "scheme://").
- $base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
- }
- else {
- // Create base URL
- $http_protocol = $is_https ? 'https' : 'http';
- $base_root = $http_protocol . '://' . $_SERVER['HTTP_HOST'];
-
- $base_url = $base_root;
-
- // $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
- // be modified by a visitor.
- if ($dir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/')) {
- $base_path = $dir;
- $base_url .= $base_path;
- $base_path .= '/';
- }
- else {
- $base_path = '/';
- }
- }
- $base_secure_url = str_replace('http://', 'https://', $base_url);
- $base_insecure_url = str_replace('https://', 'http://', $base_url);
-
- if ($cookie_domain) {
- // If the user specifies the cookie domain, also use it for session name.
- $session_name = $cookie_domain;
- }
- else {
- // Otherwise use $base_url as session name, without the protocol
- // to use the same session identifiers across http and https.
- list( , $session_name) = explode('://', $base_url, 2);
- // HTTP_HOST can be modified by a visitor, but we already sanitized it
- // in drupal_settings_initialize().
- if (!empty($_SERVER['HTTP_HOST'])) {
- $cookie_domain = $_SERVER['HTTP_HOST'];
- // Strip leading periods, www., and port numbers from cookie domain.
- $cookie_domain = ltrim($cookie_domain, '.');
- if (strpos($cookie_domain, 'www.') === 0) {
- $cookie_domain = substr($cookie_domain, 4);
- }
- $cookie_domain = explode(':', $cookie_domain);
- $cookie_domain = '.' . $cookie_domain[0];
- }
- }
- // Per RFC 2109, cookie domains must contain at least one dot other than the
- // first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
- if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- ini_set('session.cookie_domain', $cookie_domain);
- }
- // To prevent session cookies from being hijacked, a user can configure the
- // SSL version of their website to only transfer session cookies via SSL by
- // using PHP's session.cookie_secure setting. The browser will then use two
- // separate session cookies for the HTTPS and HTTP versions of the site. So we
- // must use different session identifiers for HTTPS and HTTP to prevent a
- // cookie collision.
- if ($is_https) {
- ini_set('session.cookie_secure', TRUE);
- }
- $prefix = ini_get('session.cookie_secure') ? 'SSESS' : 'SESS';
- session_name($prefix . substr(hash('sha256', $session_name), 0, 32));
-}
-
-/**
- * Returns and optionally sets the filename for a system item (module,
- * theme, etc.). The filename, whether provided, cached, or retrieved
- * from the database, is only returned if the file exists.
- *
- * This function plays a key role in allowing Drupal's resources (modules
- * and themes) to be located in different places depending on a site's
- * configuration. For example, a module 'foo' may legally be be located
- * in any of these three places:
- *
- * modules/foo/foo.module
- * sites/all/modules/foo/foo.module
- * sites/example.com/modules/foo/foo.module
- *
- * Calling drupal_get_filename('module', 'foo') will give you one of
- * the above, depending on where the module is located.
- *
- * @param $type
- * The type of the item (i.e. theme, theme_engine, module, profile).
- * @param $name
- * The name of the item for which the filename is requested.
- * @param $filename
- * The filename of the item if it is to be set explicitly rather
- * than by consulting the database.
- *
- * @return
- * The filename of the requested item.
- */
-function drupal_get_filename($type, $name, $filename = NULL) {
- // The location of files will not change during the request, so do not use
- // drupal_static().
- static $files = array();
-
- if (!isset($files[$type])) {
- $files[$type] = array();
- }
-
- if (!empty($filename) && file_exists($filename)) {
- $files[$type][$name] = $filename;
- }
- elseif (isset($files[$type][$name])) {
- // nothing
- }
- // Verify that we have an active database connection, before querying
- // the database. This is required because this function is called both
- // before we have a database connection (i.e. during installation) and
- // when a database connection fails.
- else {
- try {
- if (function_exists('db_query')) {
- $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField();
- if (file_exists($file)) {
- $files[$type][$name] = $file;
- }
- }
- }
- catch (Exception $e) {
- // The database table may not exist because Drupal is not yet installed,
- // or the database might be down. We have a fallback for this case so we
- // hide the error completely.
- }
- // Fallback to searching the filesystem if the database could not find the
- // file or the file returned by the database is not found.
- if (!isset($files[$type][$name])) {
- // We have a consistent directory naming: modules, themes...
- $dir = $type . 's';
- if ($type == 'theme_engine') {
- $dir = 'themes/engines';
- $extension = 'engine';
- }
- elseif ($type == 'theme') {
- $extension = 'info';
- }
- else {
- $extension = $type;
- }
-
- if (!function_exists('drupal_system_listing')) {
- require_once DRUPAL_ROOT . '/includes/common.inc';
- }
- // Scan the appropriate directories for all files with the requested
- // extension, not just the file we are currently looking for. This
- // prevents unnecessary scans from being repeated when this function is
- // called more than once in the same page request.
- $matches = drupal_system_listing("/\.$extension$/", $dir, 'name', 0);
- foreach ($matches as $matched_name => $file) {
- $files[$type][$matched_name] = $file->uri;
- }
- }
- }
-
- if (isset($files[$type][$name])) {
- return $files[$type][$name];
- }
-}
-
-/**
- * Load the persistent variable table.
- *
- * The variable table is composed of values that have been saved in the table
- * with variable_set() as well as those explicitly specified in the configuration
- * file.
- */
-function variable_initialize($conf = array()) {
- // NOTE: caching the variables improves performance by 20% when serving
- // cached pages.
- if ($cached = cache_get('variables', 'cache_bootstrap')) {
- $variables = $cached->data;
- }
- else {
- // Cache miss. Avoid a stampede.
- $name = 'variable_init';
- if (!lock_acquire($name, 1)) {
- // Another request is building the variable cache.
- // Wait, then re-run this function.
- lock_wait($name);
- return variable_initialize($conf);
- }
- else {
- // Proceed with variable rebuild.
- $variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
- cache_set('variables', $variables, 'cache_bootstrap');
- lock_release($name);
- }
- }
-
- foreach ($conf as $name => $value) {
- $variables[$name] = $value;
- }
-
- return $variables;
-}
-
-/**
- * Returns a persistent variable.
- *
- * Case-sensitivity of the variable_* functions depends on the database
- * collation used. To avoid problems, always use lower case for persistent
- * variable names.
- *
- * @param $name
- * The name of the variable to return.
- * @param $default
- * The default value to use if this variable has never been set.
- *
- * @return
- * The value of the variable.
- *
- * @see variable_del()
- * @see variable_set()
- */
-function variable_get($name, $default = NULL) {
- global $conf;
-
- return isset($conf[$name]) ? $conf[$name] : $default;
-}
-
-/**
- * Sets a persistent variable.
- *
- * Case-sensitivity of the variable_* functions depends on the database
- * collation used. To avoid problems, always use lower case for persistent
- * variable names.
- *
- * @param $name
- * The name of the variable to set.
- * @param $value
- * The value to set. This can be any PHP data type; these functions take care
- * of serialization as necessary.
- *
- * @see variable_del()
- * @see variable_get()
- */
-function variable_set($name, $value) {
- global $conf;
-
- db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
-
- cache_clear_all('variables', 'cache_bootstrap');
-
- $conf[$name] = $value;
-}
-
-/**
- * Unsets a persistent variable.
- *
- * Case-sensitivity of the variable_* functions depends on the database
- * collation used. To avoid problems, always use lower case for persistent
- * variable names.
- *
- * @param $name
- * The name of the variable to undefine.
- *
- * @see variable_get()
- * @see variable_set()
- */
-function variable_del($name) {
- global $conf;
-
- db_delete('variable')
- ->condition('name', $name)
- ->execute();
- cache_clear_all('variables', 'cache_bootstrap');
-
- unset($conf[$name]);
-}
-
-/**
- * Retrieve the current page from the cache.
- *
- * Note: we do not serve cached pages to authenticated users, or to anonymous
- * users when $_SESSION is non-empty. $_SESSION may contain status messages
- * from a form submission, the contents of a shopping cart, or other user-
- * specific content that should not be cached and displayed to other users.
- *
- * @param $check_only
- * (optional) Set to TRUE to only return whether a previous call found a
- * cache entry.
- *
- * @return
- * The cache object, if the page was found in the cache, NULL otherwise.
- */
-function drupal_page_get_cache($check_only = FALSE) {
- global $base_root;
- static $cache_hit = FALSE;
-
- if ($check_only) {
- return $cache_hit;
- }
-
- if (drupal_page_is_cacheable()) {
- $cache = cache_get($base_root . request_uri(), 'cache_page');
- if ($cache !== FALSE) {
- $cache_hit = TRUE;
- }
- return $cache;
- }
-}
-
-/**
- * Determine the cacheability of the current page.
- *
- * @param $allow_caching
- * Set to FALSE if you want to prevent this page to get cached.
- *
- * @return
- * TRUE if the current page can be cached, FALSE otherwise.
- */
-function drupal_page_is_cacheable($allow_caching = NULL) {
- $allow_caching_static = &drupal_static(__FUNCTION__, TRUE);
- if (isset($allow_caching)) {
- $allow_caching_static = $allow_caching;
- }
-
- return $allow_caching_static && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD')
- && !drupal_is_cli();
-}
-
-/**
- * Invoke a bootstrap hook in all bootstrap modules that implement it.
- *
- * @param $hook
- * The name of the bootstrap hook to invoke.
- *
- * @see bootstrap_hooks()
- */
-function bootstrap_invoke_all($hook) {
- // Bootstrap modules should have been loaded when this function is called, so
- // we don't need to tell module_list() to reset its bootstrap list.
- foreach (module_list(FALSE, TRUE) as $module) {
- drupal_load('module', $module);
- module_invoke($module, $hook);
- }
-}
-
-/**
- * Includes a file with the provided type and name. This prevents
- * including a theme, engine, module, etc., more than once.
- *
- * @param $type
- * The type of item to load (i.e. theme, theme_engine, module).
- * @param $name
- * The name of the item to load.
- *
- * @return
- * TRUE if the item is loaded or has already been loaded.
- */
-function drupal_load($type, $name) {
- // Once a file is included this can't be reversed during a request so do not
- // use drupal_static() here.
- static $files = array();
-
- if (isset($files[$type][$name])) {
- return TRUE;
- }
-
- $filename = drupal_get_filename($type, $name);
-
- if ($filename) {
- include_once DRUPAL_ROOT . '/' . $filename;
- $files[$type][$name] = TRUE;
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- * Set an HTTP response header for the current page.
- *
- * Note: When sending a Content-Type header, always include a 'charset' type,
- * too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).
- *
- * @param $name
- * The HTTP header name, or the special 'Status' header name.
- * @param $value
- * The HTTP header value; if equal to FALSE, the specified header is unset.
- * If $name is 'Status', this is expected to be a status code followed by a
- * reason phrase, e.g. "404 Not Found".
- * @param $append
- * Whether to append the value to an existing header or to replace it.
- */
-function drupal_add_http_header($name, $value, $append = FALSE) {
- // The headers as name/value pairs.
- $headers = &drupal_static('drupal_http_headers', array());
-
- $name_lower = strtolower($name);
- _drupal_set_preferred_header_name($name);
-
- if ($value === FALSE) {
- $headers[$name_lower] = FALSE;
- }
- elseif (isset($headers[$name_lower]) && $append) {
- // Multiple headers with identical names may be combined using comma (RFC
- // 2616, section 4.2).
- $headers[$name_lower] .= ',' . $value;
- }
- else {
- $headers[$name_lower] = $value;
- }
- drupal_send_headers(array($name => $headers[$name_lower]), TRUE);
-}
-
-/**
- * Get the HTTP response headers for the current page.
- *
- * @param $name
- * An HTTP header name. If omitted, all headers are returned as name/value
- * pairs. If an array value is FALSE, the header has been unset.
- * @return
- * A string containing the header value, or FALSE if the header has been set,
- * or NULL if the header has not been set.
- */
-function drupal_get_http_header($name = NULL) {
- $headers = &drupal_static('drupal_http_headers', array());
- if (isset($name)) {
- $name = strtolower($name);
- return isset($headers[$name]) ? $headers[$name] : NULL;
- }
- else {
- return $headers;
- }
-}
-
-/**
- * Header names are case-insensitive, but for maximum compatibility they should
- * follow "common form" (see RFC 2617, section 4.2).
- */
-function _drupal_set_preferred_header_name($name = NULL) {
- static $header_names = array();
-
- if (!isset($name)) {
- return $header_names;
- }
- $header_names[strtolower($name)] = $name;
-}
-
-/**
- * Send the HTTP response headers previously set using drupal_add_http_header().
- * Add default headers, unless they have been replaced or unset using
- * drupal_add_http_header().
- *
- * @param $default_headers
- * An array of headers as name/value pairs.
- * @param $single
- * If TRUE and headers have already be sent, send only the specified header.
- */
-function drupal_send_headers($default_headers = array(), $only_default = FALSE) {
- $headers_sent = &drupal_static(__FUNCTION__, FALSE);
- $headers = drupal_get_http_header();
- if ($only_default && $headers_sent) {
- $headers = array();
- }
- $headers_sent = TRUE;
-
- $header_names = _drupal_set_preferred_header_name();
- foreach ($default_headers as $name => $value) {
- $name_lower = strtolower($name);
- if (!isset($headers[$name_lower])) {
- $headers[$name_lower] = $value;
- $header_names[$name_lower] = $name;
- }
- }
- foreach ($headers as $name_lower => $value) {
- if ($name_lower == 'status') {
- header($_SERVER['SERVER_PROTOCOL'] . ' ' . $value);
- }
- // Skip headers that have been unset.
- elseif ($value) {
- header($header_names[$name_lower] . ': ' . $value);
- }
- }
-}
-
-/**
- * Set HTTP headers in preparation for a page response.
- *
- * Authenticated users are always given a 'no-cache' header, and will fetch a
- * fresh page on every request. This prevents authenticated users from seeing
- * locally cached pages.
- *
- * Also give each page a unique ETag. This will force clients to include both
- * an If-Modified-Since header and an If-None-Match header when doing
- * conditional requests for the page (required by RFC 2616, section 13.3.4),
- * making the validation more robust. This is a workaround for a bug in Mozilla
- * Firefox that is triggered when Drupal's caching is enabled and the user
- * accesses Drupal via an HTTP proxy (see
- * https://bugzilla.mozilla.org/show_bug.cgi?id=269303): When an authenticated
- * user requests a page, and then logs out and requests the same page again,
- * Firefox may send a conditional request based on the page that was cached
- * locally when the user was logged in. If this page did not have an ETag
- * header, the request only contains an If-Modified-Since header. The date will
- * be recent, because with authenticated users the Last-Modified header always
- * refers to the time of the request. If the user accesses Drupal via a proxy
- * server, and the proxy already has a cached copy of the anonymous page with an
- * older Last-Modified date, the proxy may respond with 304 Not Modified, making
- * the client think that the anonymous and authenticated pageviews are
- * identical.
- *
- * @see drupal_page_set_cache()
- */
-function drupal_page_header() {
- $headers_sent = &drupal_static(__FUNCTION__, FALSE);
- if ($headers_sent) {
- return TRUE;
- }
- $headers_sent = TRUE;
-
- $default_headers = array(
- 'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
- 'Last-Modified' => gmdate(DATE_RFC1123, REQUEST_TIME),
- 'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
- 'ETag' => '"' . REQUEST_TIME . '"',
- );
- drupal_send_headers($default_headers);
-}
-
-/**
- * Set HTTP headers in preparation for a cached page response.
- *
- * The headers allow as much as possible in proxies and browsers without any
- * particular knowledge about the pages. Modules can override these headers
- * using drupal_add_http_header().
- *
- * If the request is conditional (using If-Modified-Since and If-None-Match),
- * and the conditions match those currently in the cache, a 304 Not Modified
- * response is sent.
- */
-function drupal_serve_page_from_cache(stdClass $cache) {
- // Negotiate whether to use compression.
- $page_compression = variable_get('page_compression', TRUE) && extension_loaded('zlib');
- $return_compressed = $page_compression && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE;
-
- // Get headers set in hook_boot(). Keys are lower-case.
- $hook_boot_headers = drupal_get_http_header();
-
- // Headers generated in this function, that may be replaced or unset using
- // drupal_add_http_headers(). Keys are mixed-case.
- $default_headers = array();
-
- foreach ($cache->data['headers'] as $name => $value) {
- // In the case of a 304 response, certain headers must be sent, and the
- // remaining may not (see RFC 2616, section 10.3.5). Do not override
- // headers set in hook_boot().
- $name_lower = strtolower($name);
- if (in_array($name_lower, array('content-location', 'expires', 'cache-control', 'vary')) && !isset($hook_boot_headers[$name_lower])) {
- drupal_add_http_header($name, $value);
- unset($cache->data['headers'][$name]);
- }
- }
-
- // If a cache is served from a HTTP proxy without hitting the web server,
- // the boot and exit hooks cannot be fired, so only allow caching in
- // proxies if boot hooks are disabled. If the client send a session cookie,
- // do not bother caching the page in a public proxy, because the cached copy
- // will only be served to that particular user due to Vary: Cookie, unless
- // the Vary header has been replaced or unset in hook_boot() (see below).
- $max_age = !variable_get('page_cache_invoke_hooks', TRUE) && (!isset($_COOKIE[session_name()]) || isset($hook_boot_headers['vary'])) ? variable_get('page_cache_maximum_age', 0) : 0;
- $default_headers['Cache-Control'] = 'public, max-age=' . $max_age;
-
- // Entity tag should change if the output changes.
- $etag = '"' . $cache->created . '-' . intval($return_compressed) . '"';
- header('Etag: ' . $etag);
-
- // See if the client has provided the required HTTP headers.
- $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
- $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : FALSE;
-
- if ($if_modified_since && $if_none_match
- && $if_none_match == $etag // etag must match
- && $if_modified_since == $cache->created) { // if-modified-since must match
- header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
- drupal_send_headers($default_headers);
- return;
- }
-
- // Send the remaining headers.
- foreach ($cache->data['headers'] as $name => $value) {
- drupal_add_http_header($name, $value);
- }
-
- $default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created);
-
- // HTTP/1.0 proxies does not support the Vary header, so prevent any caching
- // by sending an Expires date in the past. HTTP/1.1 clients ignores the
- // Expires header if a Cache-Control: max-age= directive is specified (see RFC
- // 2616, section 14.9.3).
- $default_headers['Expires'] = 'Sun, 19 Nov 1978 05:00:00 GMT';
-
- drupal_send_headers($default_headers);
-
- // Allow HTTP proxies to cache pages for anonymous users without a session
- // cookie. The Vary header is used to indicates the set of request-header
- // fields that fully determines whether a cache is permitted to use the
- // response to reply to a subsequent request for a given URL without
- // revalidation. If a Vary header has been set in hook_boot(), it is assumed
- // that the module knows how to cache the page.
- if (!isset($hook_boot_headers['vary']) && !variable_get('omit_vary_cookie')) {
- header('Vary: Cookie');
- }
-
- if ($page_compression) {
- header('Vary: Accept-Encoding', FALSE);
- // If page_compression is enabled, the cache contains gzipped data.
- if ($return_compressed) {
- // $cache->data['body'] is already gzip'ed, so make sure
- // zlib.output_compression does not compress it once more.
- ini_set('zlib.output_compression', '0');
- header('Content-Encoding: gzip');
- }
- else {
- // The client does not support compression, so unzip the data in the
- // cache. Strip the gzip header and run uncompress.
- $cache->data['body'] = gzinflate(substr(substr($cache->data['body'], 10), 0, -8));
- }
- }
-
- // Print the page.
- print $cache->data['body'];
-}
-
-/**
- * Define the critical hooks that force modules to always be loaded.
- */
-function bootstrap_hooks() {
- return array('boot', 'exit', 'watchdog', 'language_init');
-}
-
-/**
- * Unserializes and appends elements from a serialized string.
- *
- * @param $obj
- * The object to which the elements are appended.
- * @param $field
- * The attribute of $obj whose value should be unserialized.
- */
-function drupal_unpack($obj, $field = 'data') {
- if ($obj->$field && $data = unserialize($obj->$field)) {
- foreach ($data as $key => $value) {
- if (!empty($key) && !isset($obj->$key)) {
- $obj->$key = $value;
- }
- }
- }
- return $obj;
-}
-
-/**
- * Translates a string to the current language or to a given language.
- *
- * All human-readable text that will be displayed on the site or sent to a user
- * should be passed through the t() function. This ensures that sites can be
- * fully translated into other languages.
- *
- * Here are some examples of translating static text using t():
- * @code
- * if (!$info || !$info['extension']) {
- * form_set_error('picture_upload', t('The uploaded file was not an image.'));
- * }
- *
- * $form['submit'] = array(
- * '#type' => 'submit',
- * '#value' => t('Log in'),
- * );
- * @endcode
- *
- * In addition to translating static text, t() can handle text that should not
- * be translated or that might change from time to time (such as link paths)
- * and dynamic text from variables, using special "placeholders". There are
- * three styles of placeholders:
- * - !variable: Indicates that the text should be inserted as-is. This is
- * useful for inserting variables into things like e-mail. Example:
- * @code
- * $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE))));
- * @endcode
- * - @variable: Indicates that the text should be run through check_plain(), to
- * escape HTML characters. Use this for any output that is displayed within a
- * Drupal page. Example:
- * @code
- * drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH);
- * @endcode
- * - %variable: Indicates that the string should be HTML-escaped and highlighted
- * with theme_placeholder(), which shows up by default as <em>emphasized</em>.
- * @code
- * $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => format_username($user), '%name-to' => format_username($account)));
- * @endcode
- *
- * When using t(), try to put entire paragraphs in one t() call. This makes it
- * easier for translators, as it provides context as to what each word refers
- * to (and also allows translators to adjust word order, which may not be the
- * same in all languages). HTML markup within translation strings is allowed,
- * but should be avoided if possible. The exception is embedded links: link
- * titles add context for translators and need to be translated, so they should
- * be kept in the main string, while link URLs should be generated using
- * placeholders.
- * - Incorrect HTML in t():
- * @code
- * $output .= t('<p>Go to the @contact-page.</p>', array('@contact-page' => l(t('contact page'), 'contact')));
- * @endcode
- * - Correct HTML in t():
- * @code
- * $output .= '<p>' . t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) . '</p>';
- * @endcode
- *
- * Another thing that is helpful is to avoid escaping quotation marks wherever
- * possible, because it can be confusing to translation teams.
- * - Less desirable quotation mark escaping:
- * @code
- * $output .= t('Don\'t click me.');
- * @endcode
- * - Better way to use quotation marks:
- * @code
- * $output .= t("Don't click me.");
- * @endcode
- *
- * It is important that all translation uses the t() mechanism, because in
- * addition to actually translating the text at run-time, the t() function is
- * also used by text-extraction routines to find text that needs to be
- * translated, and build databases of text to be translated for translation
- * teams. For that reason, you must put the actual string into the t() function,
- * in most cases, and not a variable.
- * - Incorrect use of a variable in t():
- * @code
- * $message = 'An error occurred.';
- * drupal_set_message(t($message), 'error');
- * $output .= t($message);
- * @endcode
- * - Correct translation of a variable with t():
- * @code
- * $message = t('An error occurred.');
- * drupal_set_message($message, 'error');
- * $output .= $message;
- * @endcode
- *
- * The only case in which variables can be passed safely through t() is when
- * code-based versions of the same strings will be passed through t() (or
- * otherwise extracted) elsewhere.
- *
- * Also, you cannot use t() early in the bootstrap process, prior to the
- * DRUPAL_BOOTSTRAP_LANGUAGE phase. The language variables will not be
- * initialized yet, so the string will not be translated into the correct
- * language. Examples of places where t() cannot be used include:
- * - In a PHP define() statement.
- * - In a hook_boot() implementation.
- *
- * In some cases, modules may include strings in code that can't use t()
- * calls. For example, a module may use an external PHP application that
- * produces strings that are loaded into variables in Drupal for output.
- * In these cases, module authors may include a dummy file that passes the
- * relevant strings through t(). This approach will allow the strings to be
- * extracted.
- *
- * Sample external (non-Drupal) code:
- * @code
- * class Time {
- * public $yesterday = 'Yesterday';
- * public $today = 'Today';
- * public $tomorrow = 'Tomorrow';
- * }
- * @endcode
- *
- * Sample dummy file:
- * @code
- * // Dummy function included in example.potx.inc.
- * function example_potx() {
- * $strings = array(
- * t('Yesterday'),
- * t('Today'),
- * t('Tomorrow'),
- * );
- * // No return value needed, since this is a dummy function.
- * }
- * @endcode
- *
- * Having passed strings through t() in a dummy function, it is then
- * possible to pass variables through t():
- * @code
- * $time = new Time();
- * $output .= t($time->today);
- * @endcode
- *
- * However tempting it is, custom data from user input or other non-code
- * sources should not be passed through t(). Doing so leads to the following
- * problems and errors:
- * - The t() system doesn't support updates to existing strings. When user
- * data is updated, the next time it's passed through t(), a new record is
- * created instead of an update. The database bloats over time and any
- * existing translations are orphaned with each update.
- * - The t() system assumes any data it receives is in English. User data may
- * be in another language, producing translation errors.
- * - The "Built-in interface" text group in the locale system is used to
- * produce translations for storage in .po files. When non-code strings are
- * passed through t(), they are added to this text group, which is rendered
- * inaccurate since it is a mix of actual interface strings and various user
- * input strings of uncertain origin.
- * Instead, translation of these data can be done through the locale system,
- * either directly through hook_local() or through helper functions provided by
- * contributed modules.
- *
- * Incorrect:
- * @code
- * $item = item_load();
- * $output .= check_plain(t($item['title']));
- * @endcode
- *
- * During installation, st() is used in place of t(). Code that may be called
- * during installation or during normal operation should use the get_t()
- * helper function.
- *
- * @param $string
- * A string containing the English string to translate.
- * @param $args
- * An associative array of replacements to make after translation. Incidences
- * of any key in this array are replaced with the corresponding value. Based
- * on the first character of the key, the value is escaped and/or themed:
- * - !variable: inserted as is
- * - @variable: escape plain text to HTML (using check_plain())
- * - %variable: escape text and theme as a placeholder for user-submitted
- * content (using check_plain() + theme_placeholder())
- * @param $options
- * An associative array of additional options, with the following keys:
- * - 'langcode' (defaults to the current language) The language code to
- * translate to a language other than what is used to display the page.
- * - 'context' (defaults to the empty context) The context the source string
- * belongs to.
- *
- * @return
- * The translated string.
- *
- * @ingroup sanitization
- */
-function t($string, array $args = array(), array $options = array()) {
- global $language;
- static $custom_strings;
-
- // Merge in default.
- if (empty($options['langcode'])) {
- $options['langcode'] = isset($language->language) ? $language->language : 'en';
- }
- if (empty($options['context'])) {
- $options['context'] = '';
- }
-
- // First, check for an array of customized strings. If present, use the array
- // *instead of* database lookups. This is a high performance way to provide a
- // handful of string replacements. See settings.php for examples.
- // Cache the $custom_strings variable to improve performance.
- if (!isset($custom_strings[$options['langcode']])) {
- $custom_strings[$options['langcode']] = variable_get('locale_custom_strings_' . $options['langcode'], array());
- }
- // Custom strings work for English too, even if locale module is disabled.
- if (isset($custom_strings[$options['langcode']][$options['context']][$string])) {
- $string = $custom_strings[$options['langcode']][$options['context']][$string];
- }
- // Translate with locale module if enabled.
- elseif (function_exists('locale') && $options['langcode'] != 'en') {
- $string = locale($string, $options['context'], $options['langcode']);
- }
- if (empty($args)) {
- return $string;
- }
- else {
- // Transform arguments before inserting them.
- foreach ($args as $key => $value) {
- switch ($key[0]) {
- case '@':
- // Escaped only.
- $args[$key] = check_plain($value);
- break;
-
- case '%':
- default:
- // Escaped and placeholder.
- $args[$key] = drupal_placeholder($value);
- break;
-
- case '!':
- // Pass-through.
- }
- }
- return strtr($string, $args);
- }
-}
-
-/**
- * Encode special characters in a plain-text string for display as HTML.
- *
- * Also validates strings as UTF-8 to prevent cross site scripting attacks on
- * Internet Explorer 6.
- *
- * @param $text
- * The text to be checked or processed.
- *
- * @return
- * An HTML safe version of $text, or an empty string if $text is not
- * valid UTF-8.
- *
- * @see drupal_validate_utf8()
- * @ingroup sanitization
- */
-function check_plain($text) {
- // We do not want to use drupal_static() since PHP version will never change
- // during a request.
- static $php525;
-
- if (!isset($php525)) {
- $php525 = version_compare(PHP_VERSION, '5.2.5', '>=');
- }
- // We duplicate the preg_match() to validate strings as UTF-8 from
- // drupal_validate_utf8() here. This avoids the overhead of an additional
- // function call, since check_plain() may be called hundreds of times during
- // a request. For PHP 5.2.5+, this check for valid UTF-8 should be handled
- // internally by PHP in htmlspecialchars().
- // See http://www.php.net/releases/5_2_5.php.
- // @todo remove this when support for either IE6 or PHP < 5.2.5 is dropped.
-
- if ($php525) {
- return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
- }
- return (preg_match('/^./us', $text) == 1) ? htmlspecialchars($text, ENT_QUOTES, 'UTF-8') : '';
-}
-
-/**
- * Checks whether a string is valid UTF-8.
- *
- * All functions designed to filter input should use drupal_validate_utf8
- * to ensure they operate on valid UTF-8 strings to prevent bypass of the
- * filter.
- *
- * When text containing an invalid UTF-8 lead byte (0xC0 - 0xFF) is presented
- * as UTF-8 to Internet Explorer 6, the program may misinterpret subsequent
- * bytes. When these subsequent bytes are HTML control characters such as
- * quotes or angle brackets, parts of the text that were deemed safe by filters
- * end up in locations that are potentially unsafe; An onerror attribute that
- * is outside of a tag, and thus deemed safe by a filter, can be interpreted
- * by the browser as if it were inside the tag.
- *
- * The function does not return FALSE for strings containing character codes
- * above U+10FFFF, even though these are prohibited by RFC 3629.
- *
- * @param $text
- * The text to check.
- * @return
- * TRUE if the text is valid UTF-8, FALSE if not.
- */
-function drupal_validate_utf8($text) {
- if (strlen($text) == 0) {
- return TRUE;
- }
- // With the PCRE_UTF8 modifier 'u', preg_match() fails silently on strings
- // containing invalid UTF-8 byte sequences. It does not reject character
- // codes above U+10FFFF (represented by 4 or more octets), though.
- return (preg_match('/^./us', $text) == 1);
-}
-
-/**
- * Since $_SERVER['REQUEST_URI'] is only available on Apache, we
- * generate an equivalent using other environment variables.
- */
-function request_uri() {
-
- if (isset($_SERVER['REQUEST_URI'])) {
- $uri = $_SERVER['REQUEST_URI'];
- }
- else {
- if (isset($_SERVER['argv'])) {
- $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
- }
- elseif (isset($_SERVER['QUERY_STRING'])) {
- $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
- }
- else {
- $uri = $_SERVER['SCRIPT_NAME'];
- }
- }
- // Prevent multiple slashes to avoid cross site requests via the Form API.
- $uri = '/' . ltrim($uri, '/');
-
- return $uri;
-}
-
-/**
- * Log an exception.
- *
- * This is a wrapper function for watchdog() which automatically decodes an
- * exception.
- *
- * @param $type
- * The category to which this message belongs.
- * @param $exception
- * The exception that is going to be logged.
- * @param $message
- * The message to store in the log. If empty, a text that contains all useful
- * information about the passed in exception is used.
- * @param $variables
- * Array of variables to replace in the message on display. Defaults to the
- * return value of drupal_decode_exception().
- * @param $severity
- * The severity of the message, as per RFC 3164.
- * @param $link
- * A link to associate with the message.
- *
- * @see watchdog()
- * @see drupal_decode_exception()
- */
-function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) {
-
- // Use a default value if $message is not set.
- if (empty($message)) {
- $message = '%type: %message in %function (line %line of %file).';
- }
- // $variables must be an array so that we can add the exception information.
- if (!is_array($variables)) {
- $variables = array();
- }
-
- require_once DRUPAL_ROOT . '/includes/errors.inc';
- $variables += _drupal_decode_exception($exception);
- watchdog($type, $message, $variables, $severity, $link);
-}
-
-/**
- * Log a system message.
- *
- * @param $type
- * The category to which this message belongs. Can be any string, but the
- * general practice is to use the name of the module calling watchdog().
- * @param $message
- * The message to store in the log. Keep $message translatable
- * by not concatenating dynamic values into it! Variables in the
- * message should be added by using placeholder strings alongside
- * the variables argument to declare the value of the placeholders.
- * See t() for documentation on how $message and $variables interact.
- * @param $variables
- * Array of variables to replace in the message on display or
- * NULL if message is already translated or not possible to
- * translate.
- * @param $severity
- * The severity of the message, as per RFC 3164. Possible values are
- * WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
- * @param $link
- * A link to associate with the message.
- *
- * @see watchdog_severity_levels()
- * @see hook_watchdog()
- */
-function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
- global $user, $base_root;
-
- static $in_error_state = FALSE;
-
- // It is possible that the error handling will itself trigger an error. In that case, we could
- // end up in an infinite loop. To avoid that, we implement a simple static semaphore.
- if (!$in_error_state && function_exists('module_implements')) {
- $in_error_state = TRUE;
-
- // Prepare the fields to be logged
- $log_entry = array(
- 'type' => $type,
- 'message' => $message,
- 'variables' => $variables,
- 'severity' => $severity,
- 'link' => $link,
- 'user' => $user,
- 'request_uri' => $base_root . request_uri(),
- 'referer' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
- 'ip' => ip_address(),
- 'timestamp' => REQUEST_TIME,
- );
-
- // Call the logging hooks to log/process the message
- foreach (module_implements('watchdog') as $module) {
- module_invoke($module, 'watchdog', $log_entry);
- }
-
- // It is critical that the semaphore is only cleared here, in the parent
- // watchdog() call (not outside the loop), to prevent recursive execution.
- $in_error_state = FALSE;
- }
-}
-
-/**
- * Set a message which reflects the status of the performed operation.
- *
- * If the function is called with no arguments, this function returns all set
- * messages without clearing them.
- *
- * @param $message
- * The message should begin with a capital letter and always ends with a
- * period '.'.
- * @param $type
- * The type of the message. One of the following values are possible:
- * - 'status'
- * - 'warning'
- * - 'error'
- * @param $repeat
- * If this is FALSE and the message is already set, then the message won't
- * be repeated.
- */
-function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
- if ($message) {
- if (!isset($_SESSION['messages'][$type])) {
- $_SESSION['messages'][$type] = array();
- }
-
- if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
- $_SESSION['messages'][$type][] = $message;
- }
-
- // Mark this page as being uncacheable.
- drupal_page_is_cacheable(FALSE);
- }
-
- // Messages not set when DB connection fails.
- return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
-}
-
-/**
- * Return all messages that have been set.
- *
- * @param $type
- * (optional) Only return messages of this type.
- * @param $clear_queue
- * (optional) Set to FALSE if you do not want to clear the messages queue
- * @return
- * An associative array, the key is the message type, the value an array
- * of messages. If the $type parameter is passed, you get only that type,
- * or an empty array if there are no such messages. If $type is not passed,
- * all message types are returned, or an empty array if none exist.
- */
-function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
- if ($messages = drupal_set_message()) {
- if ($type) {
- if ($clear_queue) {
- unset($_SESSION['messages'][$type]);
- }
- if (isset($messages[$type])) {
- return array($type => $messages[$type]);
- }
- }
- else {
- if ($clear_queue) {
- unset($_SESSION['messages']);
- }
- return $messages;
- }
- }
- return array();
-}
-
-/**
- * Get the title of the current page, for display on the page and in the title bar.
- *
- * @return
- * The current page's title.
- */
-function drupal_get_title() {
- $title = drupal_set_title();
-
- // During a bootstrap, menu.inc is not included and thus we cannot provide a title.
- if (!isset($title) && function_exists('menu_get_active_title')) {
- $title = check_plain(menu_get_active_title());
- }
-
- return $title;
-}
-
-/**
- * Set the title of the current page, for display on the page and in the title bar.
- *
- * @param $title
- * Optional string value to assign to the page title; or if set to NULL
- * (default), leaves the current title unchanged.
- * @param $output
- * Optional flag - normally should be left as CHECK_PLAIN. Only set to
- * PASS_THROUGH if you have already removed any possibly dangerous code
- * from $title using a function like check_plain() or filter_xss(). With this
- * flag the string will be passed through unchanged.
- *
- * @return
- * The updated title of the current page.
- */
-function drupal_set_title($title = NULL, $output = CHECK_PLAIN) {
- $stored_title = &drupal_static(__FUNCTION__);
-
- if (isset($title)) {
- $stored_title = ($output == PASS_THROUGH) ? $title : check_plain($title);
- }
-
- return $stored_title;
-}
-
-/**
- * Check to see if an IP address has been blocked.
- *
- * Blocked IP addresses are stored in the database by default. However for
- * performance reasons we allow an override in settings.php. This allows us
- * to avoid querying the database at this critical stage of the bootstrap if
- * an administrative interface for IP address blocking is not required.
- *
- * @param $ip
- * IP address to check.
- * @return bool
- * TRUE if access is denied, FALSE if access is allowed.
- */
-function drupal_is_denied($ip) {
- // Because this function is called on every page request, we first check
- // for an array of IP addresses in settings.php before querying the
- // database.
- $blocked_ips = variable_get('blocked_ips');
- $denied = FALSE;
- if (isset($blocked_ips) && is_array($blocked_ips)) {
- $denied = in_array($ip, $blocked_ips);
- }
- // Only check if database.inc is loaded already. If
- // $conf['page_cache_without_database'] = TRUE; is set in settings.php,
- // then the database won't be loaded here so the IPs in the database
- // won't be denied. However the user asked explicitly not to use the
- // database and also in this case it's quite likely that the user relies
- // on higher performance solutions like a firewall.
- elseif (class_exists('Database', FALSE)) {
- $denied = (bool)db_query("SELECT 1 FROM {blocked_ips} WHERE ip = :ip", array(':ip' => $ip))->fetchField();
- }
- return $denied;
-}
-
-/**
- * Handle denied users.
- *
- * @param $ip
- * IP address to check. Prints a message and exits if access is denied.
- */
-function drupal_block_denied($ip) {
- // Deny access to blocked IP addresses - t() is not yet available.
- if (drupal_is_denied($ip)) {
- header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
- print 'Sorry, ' . check_plain(ip_address()) . ' has been banned.';
- exit();
- }
-}
-
-/**
- * Returns a string of highly randomized bytes (over the full 8-bit range).
- *
- * This function is better than simply calling mt_rand() or any other built-in
- * PHP function because it can return a long string of bytes (compared to < 4
- * bytes normally from mt_rand()) and uses the best available pseudo-random source.
- *
- * @param $count
- * The number of characters (bytes) to return in the string.
- */
-function drupal_random_bytes($count) {
- // $random_state does not use drupal_static as it stores random bytes.
- static $random_state, $bytes;
- // Initialize on the first call. The contents of $_SERVER includes a mix of
- // user-specific and system information that varies a little with each page.
- if (!isset($random_state)) {
- $random_state = print_r($_SERVER, TRUE);
- if (function_exists('getmypid')) {
- // Further initialize with the somewhat random PHP process ID.
- $random_state .= getmypid();
- }
- $bytes = '';
- }
- if (strlen($bytes) < $count) {
- // /dev/urandom is available on many *nix systems and is considered the
- // best commonly available pseudo-random source.
- if ($fh = @fopen('/dev/urandom', 'rb')) {
- // PHP only performs buffered reads, so in reality it will always read
- // at least 4096 bytes. Thus, it costs nothing extra to read and store
- // that much so as to speed any additional invocations.
- $bytes .= fread($fh, max(4096, $count));
- fclose($fh);
- }
- // If /dev/urandom is not available or returns no bytes, this loop will
- // generate a good set of pseudo-random bytes on any system.
- // Note that it may be important that our $random_state is passed
- // through hash() prior to being rolled into $output, that the two hash()
- // invocations are different, and that the extra input into the first one -
- // the microtime() - is prepended rather than appended. This is to avoid
- // directly leaking $random_state via the $output stream, which could
- // allow for trivial prediction of further "random" numbers.
- while (strlen($bytes) < $count) {
- $random_state = hash('sha256', microtime() . mt_rand() . $random_state);
- $bytes .= hash('sha256', mt_rand() . $random_state, TRUE);
- }
- }
- $output = substr($bytes, 0, $count);
- $bytes = substr($bytes, $count);
- return $output;
-}
-
-/**
- * Calculate a base-64 encoded, URL-safe sha-256 hmac.
- *
- * @param $data
- * String to be validated with the hmac.
- * @param $key
- * A secret string key.
- *
- * @return
- * A base-64 encoded sha-256 hmac, with + replaced with -, / with _ and
- * any = padding characters removed.
- */
-function drupal_hmac_base64($data, $key) {
- $hmac = base64_encode(hash_hmac('sha256', $data, $key, TRUE));
- // Modify the hmac so it's safe to use in URLs.
- return strtr($hmac, array('+' => '-', '/' => '_', '=' => ''));
-}
-
-/**
- * Calculate a base-64 encoded, URL-safe sha-256 hash.
- *
- * @param $data
- * String to be hashed.
- *
- * @return
- * A base-64 encoded sha-256 hash, with + replaced with -, / with _ and
- * any = padding characters removed.
- */
-function drupal_hash_base64($data) {
- $hash = base64_encode(hash('sha256', $data, TRUE));
- // Modify the hash so it's safe to use in URLs.
- return strtr($hash, array('+' => '-', '/' => '_', '=' => ''));
-}
-
-/**
- * Generates a default anonymous $user object.
- *
- * @return Object - the user object.
- */
-function drupal_anonymous_user($session = '') {
- $user = new stdClass();
- $user->uid = 0;
- $user->hostname = ip_address();
- $user->roles = array();
- $user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
- $user->session = $session;
- $user->cache = 0;
- return $user;
-}
-
-/**
- * A string describing a phase of Drupal to load. Each phase adds to the
- * previous one, so invoking a later phase automatically runs the earlier
- * phases too. The most important usage is that if you want to access the
- * Drupal database from a script without loading anything else, you can
- * include bootstrap.inc, and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).
- *
- * @param $phase
- * A constant. Allowed values are the DRUPAL_BOOTSTRAP_* constants.
- * @param $new_phase
- * A boolean, set to FALSE if calling drupal_bootstrap from inside a
- * function called from drupal_bootstrap (recursion).
- * @return
- * The most recently completed phase.
- *
- */
-function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
- // Not drupal_static(), because does not depend on any run-time information.
- static $phases = array(
- DRUPAL_BOOTSTRAP_CONFIGURATION,
- DRUPAL_BOOTSTRAP_PAGE_CACHE,
- DRUPAL_BOOTSTRAP_DATABASE,
- DRUPAL_BOOTSTRAP_VARIABLES,
- DRUPAL_BOOTSTRAP_SESSION,
- DRUPAL_BOOTSTRAP_PAGE_HEADER,
- DRUPAL_BOOTSTRAP_LANGUAGE,
- DRUPAL_BOOTSTRAP_FULL,
- );
- // Not drupal_static(), because the only legitimate API to control this is to
- // call drupal_bootstrap() with a new phase parameter.
- static $final_phase;
- // Not drupal_static(), because it's impossible to roll back to an earlier
- // bootstrap state.
- static $stored_phase = -1;
-
- // When not recursing, store the phase name so it's not forgotten while
- // recursing.
- if ($new_phase) {
- $final_phase = $phase;
- }
- if (isset($phase)) {
- // Call a phase if it has not been called before and is below the requested
- // phase.
- while ($phases && $phase > $stored_phase && $final_phase > $stored_phase) {
- $current_phase = array_shift($phases);
-
- // This function is re-entrant. Only update the completed phase when the
- // current call actually resulted in a progress in the bootstrap process.
- if ($current_phase > $stored_phase) {
- $stored_phase = $current_phase;
- }
-
- switch ($current_phase) {
- case DRUPAL_BOOTSTRAP_CONFIGURATION:
- _drupal_bootstrap_configuration();
- break;
-
- case DRUPAL_BOOTSTRAP_PAGE_CACHE:
- _drupal_bootstrap_page_cache();
- break;
-
- case DRUPAL_BOOTSTRAP_DATABASE:
- _drupal_bootstrap_database();
- break;
-
- case DRUPAL_BOOTSTRAP_VARIABLES:
- _drupal_bootstrap_variables();
- break;
-
- case DRUPAL_BOOTSTRAP_SESSION:
- require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc');
- drupal_session_initialize();
- break;
-
- case DRUPAL_BOOTSTRAP_PAGE_HEADER:
- _drupal_bootstrap_page_header();
- break;
-
- case DRUPAL_BOOTSTRAP_LANGUAGE:
- drupal_language_initialize();
- break;
-
- case DRUPAL_BOOTSTRAP_FULL:
- require_once DRUPAL_ROOT . '/includes/common.inc';
- _drupal_bootstrap_full();
- break;
- }
- }
- }
- return $stored_phase;
-}
-
-/**
- * Return the time zone of the current user.
- */
-function drupal_get_user_timezone() {
- global $user;
- if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
- return $user->timezone;
- }
- else {
- // Ignore PHP strict notice if time zone has not yet been set in the php.ini
- // configuration.
- return variable_get('date_default_timezone', @date_default_timezone_get());
- }
-}
-
-/**
- * Custom PHP error handler.
- *
- * @param $error_level
- * The level of the error raised.
- * @param $message
- * The error message.
- * @param $filename
- * The filename that the error was raised in.
- * @param $line
- * The line number the error was raised at.
- * @param $context
- * An array that points to the active symbol table at the point the error occurred.
- */
-function _drupal_error_handler($error_level, $message, $filename, $line, $context) {
- require_once DRUPAL_ROOT . '/includes/errors.inc';
- _drupal_error_handler_real($error_level, $message, $filename, $line, $context);
-}
-
-/**
- * Custom PHP exception handler.
- *
- * Uncaught exceptions are those not enclosed in a try/catch block. They are
- * always fatal: the execution of the script will stop as soon as the exception
- * handler exits.
- *
- * @param $exception
- * The exception object that was thrown.
- */
-function _drupal_exception_handler($exception) {
- require_once DRUPAL_ROOT . '/includes/errors.inc';
-
- try {
- // Log the message to the watchdog and return an error page to the user.
- _drupal_log_error(_drupal_decode_exception($exception), TRUE);
- }
- catch (Exception $exception2) {
- // Another uncaught exception was thrown while handling the first one.
- // If we are displaying errors, then do so with no possibility of a further uncaught exception being thrown.
- if (error_displayable()) {
- print '<h1>Additional uncaught exception thrown while handling exception.</h1>';
- print '<h2>Original</h2><p>' . _drupal_render_exception_safe($exception) . '</p>';
- print '<h2>Additional</h2><p>' . _drupal_render_exception_safe($exception2) . '</p><hr />';
- }
- }
-}
-
-/**
- * Bootstrap configuration: Setup script environment and load settings.php.
- */
-function _drupal_bootstrap_configuration() {
- // Set the Drupal custom error handler.
- set_error_handler('_drupal_error_handler');
- set_exception_handler('_drupal_exception_handler');
-
- drupal_environment_initialize();
- // Start a page timer:
- timer_start('page');
- // Initialize the configuration, including variables from settings.php.
- drupal_settings_initialize();
-}
-
-/**
- * Bootstrap page cache: Try to serve a page from cache.
- */
-function _drupal_bootstrap_page_cache() {
- global $user;
-
- // Allow specifying special cache handlers in settings.php, like
- // using memcached or files for storing cache information.
- require_once DRUPAL_ROOT . '/includes/cache.inc';
- foreach (variable_get('cache_backends', array()) as $include) {
- require_once DRUPAL_ROOT . '/' . $include;
- }
- // Check for a cache mode force from settings.php.
- if (variable_get('page_cache_without_database')) {
- $cache_enabled = TRUE;
- }
- else {
- drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE);
- $cache_enabled = variable_get('cache');
- }
- drupal_block_denied(ip_address());
- // If there is no session cookie and cache is enabled (or forced), try
- // to serve a cached page.
- if (!isset($_COOKIE[session_name()]) && $cache_enabled) {
- // Make sure there is a user object because its timestamp will be
- // checked, hook_boot might check for anonymous user etc.
- $user = drupal_anonymous_user();
- // Get the page from the cache.
- $cache = drupal_page_get_cache();
- // If there is a cached page, display it.
- if (is_object($cache)) {
- header('X-Drupal-Cache: HIT');
- // Restore the metadata cached with the page.
- $_GET['q'] = $cache->data['path'];
- drupal_set_title($cache->data['title'], PASS_THROUGH);
- date_default_timezone_set(drupal_get_user_timezone());
- // If the skipping of the bootstrap hooks is not enforced, call
- // hook_boot.
- if (variable_get('page_cache_invoke_hooks', TRUE)) {
- bootstrap_invoke_all('boot');
- }
- drupal_serve_page_from_cache($cache);
- // If the skipping of the bootstrap hooks is not enforced, call
- // hook_exit.
- if (variable_get('page_cache_invoke_hooks', TRUE)) {
- bootstrap_invoke_all('exit');
- }
- // We are done.
- exit;
- }
- else {
- header('X-Drupal-Cache: MISS');
- }
- }
-}
-
-/**
- * Bootstrap database: Initialize database system and register autoload functions.
- */
-function _drupal_bootstrap_database() {
- // Redirect the user to the installation script if Drupal has not been
- // installed yet (i.e., if no $databases array has been defined in the
- // settings.php file) and we are not already installing.
- if (empty($GLOBALS['databases']) && !drupal_installation_attempted()) {
- include_once DRUPAL_ROOT . '/includes/install.inc';
- install_goto('install.php');
- }
-
- // The user agent header is used to pass a database prefix in the request when
- // running tests. However, for security reasons, it is imperative that we
- // validate we ourselves made the request.
- if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^(simpletest\d+);/", $_SERVER['HTTP_USER_AGENT'], $matches)) {
- if (!drupal_valid_test_ua($_SERVER['HTTP_USER_AGENT'])) {
- header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
- exit;
- }
-
- // The first part of the user agent is the prefix itself.
- $test_prefix = $matches[1];
-
- // Set the test run id for use in other parts of Drupal.
- $test_info = &$GLOBALS['drupal_test_info'];
- $test_info['test_run_id'] = $test_prefix;
- $test_info['in_child_site'] = TRUE;
-
- foreach ($GLOBALS['databases']['default'] as &$value) {
- // Extract the current default database prefix.
- if (!isset($value['prefix'])) {
- $current_prefix = '';
- }
- elseif (is_array($value['prefix'])) {
- $current_prefix = $value['prefix']['default'];
- }
- else {
- $current_prefix = $value['prefix'];
- }
-
- // Remove the current database prefix and replace it by our own.
- $value['prefix'] = array(
- 'default' => $current_prefix . $test_prefix,
- );
- }
- }
-
- // Initialize the database system. Note that the connection
- // won't be initialized until it is actually requested.
- require_once DRUPAL_ROOT . '/includes/database/database.inc';
-
- // Register autoload functions so that we can access classes and interfaces.
- // The database autoload routine comes first so that we can load the database
- // system without hitting the database. That is especially important during
- // the install or upgrade process.
- spl_autoload_register('db_autoload');
- spl_autoload_register('drupal_autoload_class');
- spl_autoload_register('drupal_autoload_interface');
-}
-
-/**
- * Bootstrap variables: Load system variables and all enabled bootstrap modules.
- */
-function _drupal_bootstrap_variables() {
- global $conf;
-
- // Initialize the lock system.
- require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'includes/lock.inc');
- lock_initialize();
-
- // Load variables from the database, but do not overwrite variables set in settings.php.
- $conf = variable_initialize(isset($conf) ? $conf : array());
- // Load bootstrap modules.
- require_once DRUPAL_ROOT . '/includes/module.inc';
- module_load_all(TRUE);
-}
-
-/**
- * Bootstrap page header: Invoke hook_boot(), initialize locking system, and send default HTTP headers.
- */
-function _drupal_bootstrap_page_header() {
- bootstrap_invoke_all('boot');
-
- if (!drupal_is_cli()) {
- ob_start();
- drupal_page_header();
- }
-}
-
-/**
- * Returns the current bootstrap phase for this Drupal process.
- *
- * The current phase is the one most recently completed by drupal_bootstrap().
- *
- * @see drupal_bootstrap()
- */
-function drupal_get_bootstrap_phase() {
- return drupal_bootstrap();
-}
-
-/**
- * Validate the HMAC and timestamp of a user agent header from simpletest.
- */
-function drupal_valid_test_ua($user_agent) {
- global $drupal_hash_salt;
-
- list($prefix, $time, $salt, $hmac) = explode(';', $user_agent);
- $check_string = $prefix . ';' . $time . ';' . $salt;
- // We use the salt from settings.php to make the HMAC key, since
- // the database is not yet initialized and we can't access any Drupal variables.
- // The file properties add more entropy not easily accessible to others.
- $filepath = DRUPAL_ROOT . '/includes/bootstrap.inc';
- $key = $drupal_hash_salt . filectime($filepath) . fileinode($filepath);
- $time_diff = REQUEST_TIME - $time;
- // Since we are making a local request a 5 second time window is allowed,
- // and the HMAC must match.
- return ($time_diff >= 0) && ($time_diff <= 5) && ($hmac == drupal_hmac_base64($check_string, $key));
-}
-
-/**
- * Generate a user agent string with a HMAC and timestamp for simpletest.
- */
-function drupal_generate_test_ua($prefix) {
- global $drupal_hash_salt;
- static $key;
-
- if (!isset($key)) {
- // We use the salt from settings.php to make the HMAC key, since
- // the database is not yet initialized and we can't access any Drupal variables.
- // The file properties add more entropy not easily accessible to others.
- $filepath = DRUPAL_ROOT . '/includes/bootstrap.inc';
- $key = $drupal_hash_salt . filectime($filepath) . fileinode($filepath);
- }
- // Generate a moderately secure HMAC based on the database credentials.
- $salt = uniqid('', TRUE);
- $check_string = $prefix . ';' . time() . ';' . $salt;
- return $check_string . ';' . drupal_hmac_base64($check_string, $key);
-}
-
-/**
- * Enables use of the theme system without requiring database access.
- *
- * Loads and initializes the theme system for site installs, updates and when
- * the site is in maintenance mode. This also applies when the database fails.
- *
- * @see _drupal_maintenance_theme()
- */
-function drupal_maintenance_theme() {
- require_once DRUPAL_ROOT . '/includes/theme.maintenance.inc';
- _drupal_maintenance_theme();
-}
-
-/**
- * Return TRUE if a Drupal installation is currently being attempted.
- */
-function drupal_installation_attempted() {
- return defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install';
-}
-
-/**
- * Return the name of the localization function. Use in code that needs to
- * run both during installation and normal operation.
- */
-function get_t() {
- static $t;
- // This is not converted to drupal_static because there is no point in
- // resetting this as it can not change in the course of a request.
- if (!isset($t)) {
- $t = drupal_installation_attempted() ? 'st' : 't';
- }
- return $t;
-}
-
-/**
- * Initialize all the defined language types.
- */
-function drupal_language_initialize() {
- $types = language_types();
-
- // Ensure the language is correctly returned, even without multilanguage support.
- // Useful for eg. XML/HTML 'lang' attributes.
- if (!drupal_multilingual()) {
- $default = language_default();
- foreach ($types as $type) {
- $GLOBALS[$type] = $default;
- }
- }
- else {
- include_once DRUPAL_ROOT . '/includes/language.inc';
- foreach ($types as $type) {
- $GLOBALS[$type] = language_initialize($type);
- }
- // Allow modules to react on language system initialization in multilingual
- // environments.
- bootstrap_invoke_all('language_init');
- }
-}
-
-/**
- * The built-in language types.
- *
- * @return
- * An array of key-values pairs where the key is the language type and the
- * value is its configurability.
- */
-function drupal_language_types() {
- return array(
- LANGUAGE_TYPE_INTERFACE => TRUE,
- LANGUAGE_TYPE_CONTENT => FALSE,
- LANGUAGE_TYPE_URL => FALSE,
- );
-}
-
-/**
- * Return true if there is more than one language enabled.
- */
-function drupal_multilingual() {
- return variable_get('language_count', 1) > 1;
-}
-
-/**
- * Return an array of the available language types.
- */
-function language_types() {
- return array_keys(variable_get('language_types', drupal_language_types()));
-}
-
-/**
- * Get a list of languages set up indexed by the specified key
- *
- * @param $field The field to index the list with.
- */
-function language_list($field = 'language') {
- $languages = &drupal_static(__FUNCTION__);
- // Init language list
- if (!isset($languages)) {
- if (drupal_multilingual() || module_exists('locale')) {
- $languages['language'] = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC')->fetchAllAssoc('language');
- }
- else {
- // No locale module, so use the default language only.
- $default = language_default();
- $languages['language'][$default->language] = $default;
- }
- }
-
- // Return the array indexed by the right field
- if (!isset($languages[$field])) {
- $languages[$field] = array();
- foreach ($languages['language'] as $lang) {
- // Some values should be collected into an array
- if (in_array($field, array('enabled', 'weight'))) {
- $languages[$field][$lang->$field][$lang->language] = $lang;
- }
- else {
- $languages[$field][$lang->$field] = $lang;
- }
- }
- }
- return $languages[$field];
-}
-
-/**
- * Default language used on the site
- *
- * @param $property
- * Optional property of the language object to return
- */
-function language_default($property = NULL) {
- $language = variable_get('language_default', (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''));
- return $property ? $language->$property : $language;
-}
-
-/**
- * Returns the requested URL path of the page being viewed.
- *
- * Examples:
- * - http://example.com/node/306 returns "node/306".
- * - http://example.com/drupalfolder/node/306 returns "node/306" while
- * base_path() returns "/drupalfolder/".
- * - http://example.com/path/alias (which is a path alias for node/306) returns
- * "path/alias" as opposed to the internal path.
- *
- * @return
- * The requested Drupal URL path.
- *
- * @see current_path()
- */
-function request_path() {
- static $path;
-
- if (isset($path)) {
- return $path;
- }
-
- if (isset($_GET['q'])) {
- // This is a request with a ?q=foo/bar query string. $_GET['q'] is
- // overwritten in drupal_path_initialize(), but request_path() is called
- // very early in the bootstrap process, so the original value is saved in
- // $path and returned in later calls.
- $path = $_GET['q'];
- }
- elseif (isset($_SERVER['REQUEST_URI'])) {
- // This is a request using a clean URL. Extract the path from REQUEST_URI.
- $request_path = strtok($_SERVER['REQUEST_URI'], '?');
- $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
- // Unescape and strip $base_path prefix, leaving q without a leading slash.
- $path = substr(urldecode($request_path), $base_path_len + 1);
- }
- else {
- // This is the front page.
- $path = '';
- }
-
- // Under certain conditions Apache's RewriteRule directive prepends the value
- // assigned to $_GET['q'] with a slash. Moreover we can always have a trailing
- // slash in place, hence we need to normalize $_GET['q'].
- $path = trim($path, '/');
-
- return $path;
-}
-
-/**
- * Return a component of the current Drupal path.
- *
- * When viewing a page at the path "admin/structure/types", for example, arg(0)
- * returns "admin", arg(1) returns "structure", and arg(2) returns "types".
- *
- * Avoid use of this function where possible, as resulting code is hard to read.
- * In menu callback functions, attempt to use named arguments. See the explanation
- * in menu.inc for how to construct callbacks that take arguments. When attempting
- * to use this function to load an element from the current path, e.g. loading the
- * node on a node page, please use menu_get_object() instead.
- *
- * @param $index
- * The index of the component, where each component is separated by a '/'
- * (forward-slash), and where the first component has an index of 0 (zero).
- * @param $path
- * A path to break into components. Defaults to the path of the current page.
- *
- * @return
- * The component specified by $index, or NULL if the specified component was
- * not found.
- */
-function arg($index = NULL, $path = NULL) {
- // Even though $arguments doesn't need to be resettable for any functional
- // reasons (the result of explode() does not depend on any run-time
- // information), it should be resettable anyway in case a module needs to
- // free up the memory used by it.
- // Use the advanced drupal_static() pattern, since this is called very often.
- static $drupal_static_fast;
- if (!isset($drupal_static_fast)) {
- $drupal_static_fast['arguments'] = &drupal_static(__FUNCTION__);
- }
- $arguments = &$drupal_static_fast['arguments'];
-
- if (!isset($path)) {
- $path = $_GET['q'];
- }
- if (!isset($arguments[$path])) {
- $arguments[$path] = explode('/', $path);
- }
- if (!isset($index)) {
- return $arguments[$path];
- }
- if (isset($arguments[$path][$index])) {
- return $arguments[$path][$index];
- }
-}
-
-/**
- * If Drupal is behind a reverse proxy, we use the X-Forwarded-For header
- * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address of
- * the proxy server, and not the client's. The actual header name can be
- * configured by the reverse_proxy_header variable.
- *
- * @return
- * IP address of client machine, adjusted for reverse proxy and/or cluster
- * environments.
- */
-function ip_address() {
- $ip_address = &drupal_static(__FUNCTION__);
-
- if (!isset($ip_address)) {
- $ip_address = $_SERVER['REMOTE_ADDR'];
-
- if (variable_get('reverse_proxy', 0)) {
- $reverse_proxy_header = variable_get('reverse_proxy_header', 'HTTP_X_FORWARDED_FOR');
- if (!empty($_SERVER[$reverse_proxy_header])) {
- // If an array of known reverse proxy IPs is provided, then trust
- // the XFF header if request really comes from one of them.
- $reverse_proxy_addresses = variable_get('reverse_proxy_addresses', array());
-
- // Turn XFF header into an array.
- $forwarded = explode(',', $_SERVER[$reverse_proxy_header]);
-
- // Trim the forwarded IPs; they may have been delimited by commas and spaces.
- $forwarded = array_map('trim', $forwarded);
-
- // Tack direct client IP onto end of forwarded array.
- $forwarded[] = $ip_address;
-
- // Eliminate all trusted IPs.
- $untrusted = array_diff($forwarded, $reverse_proxy_addresses);
-
- // The right-most IP is the most specific we can trust.
- $ip_address = array_pop($untrusted);
- }
- }
- }
-
- return $ip_address;
-}
-
-/**
- * @ingroup schemaapi
- * @{
- */
-
-/**
- * Get the schema definition of a table, or the whole database schema.
- *
- * The returned schema will include any modifications made by any
- * module that implements hook_schema_alter().
- *
- * @param $table
- * The name of the table. If not given, the schema of all tables is returned.
- * @param $rebuild
- * If true, the schema will be rebuilt instead of retrieved from the cache.
- */
-function drupal_get_schema($table = NULL, $rebuild = FALSE) {
- static $schema = array();
-
- if (empty($schema) || $rebuild) {
- // Try to load the schema from cache.
- if (!$rebuild && $cached = cache_get('schema')) {
- $schema = $cached->data;
- }
- // Otherwise, rebuild the schema cache.
- else {
- $schema = array();
- // Load the .install files to get hook_schema.
- // On some databases this function may be called before bootstrap has
- // been completed, so we force the functions we need to load just in case.
- if (function_exists('module_load_all_includes')) {
-
- // There is currently a bug in module_list() where it caches what it
- // was last called with, which is not always what you want.
- // module_load_all_includes() calls module_list(), but if this function
- // is called very early in the bootstrap process then it will be
- // uninitialized and therefore return no modules. Instead, we have to
- // "prime" module_list() here to to values we want, specifically
- // "yes rebuild the list and don't limit to bootstrap".
- // TODO: Remove this call after http://drupal.org/node/222109 is fixed.
- module_list(TRUE, FALSE);
- module_load_all_includes('install');
- }
-
- require_once DRUPAL_ROOT . '/includes/common.inc';
- // Invoke hook_schema for all modules.
- foreach (module_implements('schema') as $module) {
- // Cast the result of hook_schema() to an array, as a NULL return value
- // would cause array_merge() to set the $schema variable to NULL as well.
- // That would break modules which use $schema further down the line.
- $current = (array) module_invoke($module, 'schema');
- _drupal_schema_initialize($module, $current);
- $schema = array_merge($schema, $current);
- }
-
- drupal_alter('schema', $schema);
- // If the schema is empty, avoid saving it: some database engines require
- // the schema to perform queries, and this could lead to infinite loops.
- if (!empty($schema) && (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL)) {
- cache_set('schema', $schema);
- }
- }
- }
-
- if (!isset($table)) {
- return $schema;
- }
- elseif (isset($schema[$table])) {
- return $schema[$table];
- }
- else {
- return FALSE;
- }
-}
-
-/**
- * @} End of "ingroup schemaapi".
- */
-
-
-/**
- * @ingroup registry
- * @{
- */
-
-/**
- * Confirm that an interface is available.
- *
- * This function is rarely called directly. Instead, it is registered as an
- * spl_autoload() handler, and PHP calls it for us when necessary.
- *
- * @param $interface
- * The name of the interface to check or load.
- * @return
- * TRUE if the interface is currently available, FALSE otherwise.
- */
-function drupal_autoload_interface($interface) {
- return _registry_check_code('interface', $interface);
-}
-
-/**
- * Confirm that a class is available.
- *
- * This function is rarely called directly. Instead, it is registered as an
- * spl_autoload() handler, and PHP calls it for us when necessary.
- *
- * @param $class
- * The name of the class to check or load.
- * @return
- * TRUE if the class is currently available, FALSE otherwise.
- */
-function drupal_autoload_class($class) {
- return _registry_check_code('class', $class);
-}
-
-/**
- * Helper to check for a resource in the registry.
- *
- * @param $type
- * The type of resource we are looking up, or one of the constants
- * REGISTRY_RESET_LOOKUP_CACHE or REGISTRY_WRITE_LOOKUP_CACHE, which
- * signal that we should reset or write the cache, respectively.
- * @param $name
- * The name of the resource, or NULL if either of the REGISTRY_* constants
- * is passed in.
- * @return
- * TRUE if the resource was found, FALSE if not.
- * NULL if either of the REGISTRY_* constants is passed in as $type.
- */
-function _registry_check_code($type, $name = NULL) {
- static $lookup_cache, $cache_update_needed;
-
- if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
- return TRUE;
- }
-
- if (!isset($lookup_cache)) {
- $lookup_cache = array();
- if ($cache = cache_get('lookup_cache', 'cache_bootstrap')) {
- $lookup_cache = $cache->data;
- }
- }
-
- // When we rebuild the registry, we need to reset this cache so
- // we don't keep lookups for resources that changed during the rebuild.
- if ($type == REGISTRY_RESET_LOOKUP_CACHE) {
- $cache_update_needed = TRUE;
- $lookup_cache = NULL;
- return;
- }
-
- // Called from drupal_page_footer, we write to permanent storage if there
- // changes to the lookup cache for this request.
- if ($type == REGISTRY_WRITE_LOOKUP_CACHE) {
- if ($cache_update_needed) {
- cache_set('lookup_cache', $lookup_cache, 'cache_bootstrap');
- }
- return;
- }
-
- // $type is either 'interface' or 'class', so we only need the first letter to
- // keep the cache key unique.
- $cache_key = $type[0] . $name;
- if (isset($lookup_cache[$cache_key])) {
- if ($lookup_cache[$cache_key]) {
- require_once DRUPAL_ROOT . '/' . $lookup_cache[$cache_key];
- }
- return (bool) $lookup_cache[$cache_key];
- }
-
- // This function may get called when the default database is not active, but
- // there is no reason we'd ever want to not use the default database for
- // this query.
- $file = Database::getConnection('default', 'default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(
- ':name' => $name,
- ':type' => $type,
- ))
- ->fetchField();
-
- // Flag that we've run a lookup query and need to update the cache.
- $cache_update_needed = TRUE;
-
- // Misses are valuable information worth caching, so cache even if
- // $file is FALSE.
- $lookup_cache[$cache_key] = $file;
-
- if ($file) {
- require_once DRUPAL_ROOT . '/' . $file;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-/**
- * Rescan all enabled modules and rebuild the registry.
- *
- * Rescans all code in modules or includes directories, storing the location of
- * each interface or class in the database.
- */
-function registry_rebuild() {
- system_rebuild_module_data();
- registry_update();
-}
-
-/**
- * Update the registry based on the latest files listed in the database.
- *
- * This function should be used when system_rebuild_module_data() does not need
- * to be called, because it is already known that the list of files in the
- * {system} table matches those in the file system.
- *
- * @see registry_rebuild()
- */
-function registry_update() {
- require_once DRUPAL_ROOT . '/includes/registry.inc';
- _registry_update();
-}
-
-/**
- * @} End of "ingroup registry".
- */
-
-/**
- * Central static variable storage.
- *
- * All functions requiring a static variable to persist or cache data within
- * a single page request are encouraged to use this function unless it is
- * absolutely certain that the static variable will not need to be reset during
- * the page request. By centralizing static variable storage through this
- * function, other functions can rely on a consistent API for resetting any
- * other function's static variables.
- *
- * Example:
- * @code
- * function language_list($field = 'language') {
- * $languages = &drupal_static(__FUNCTION__);
- * if (!isset($languages)) {
- * // If this function is being called for the first time after a reset,
- * // query the database and execute any other code needed to retrieve
- * // information about the supported languages.
- * ...
- * }
- * if (!isset($languages[$field])) {
- * // If this function is being called for the first time for a particular
- * // index field, then execute code needed to index the information already
- * // available in $languages by the desired field.
- * ...
- * }
- * // Subsequent invocations of this function for a particular index field
- * // skip the above two code blocks and quickly return the already indexed
- * // information.
- * return $languages[$field];
- * }
- * function locale_translate_overview_screen() {
- * // When building the content for the translations overview page, make
- * // sure to get completely fresh information about the supported languages.
- * drupal_static_reset('language_list');
- * ...
- * }
- * @endcode
- *
- * In a few cases, a function can have certainty that there is no legitimate
- * use-case for resetting that function's static variable. This is rare,
- * because when writing a function, it's hard to forecast all the situations in
- * which it will be used. A guideline is that if a function's static variable
- * does not depend on any information outside of the function that might change
- * during a single page request, then it's ok to use the "static" keyword
- * instead of the drupal_static() function.
- *
- * Example:
- * @code
- * function actions_do(...) {
- * // $stack tracks the number of recursive calls.
- * static $stack;
- * $stack++;
- * if ($stack > variable_get('actions_max_stack', 35)) {
- * ...
- * return;
- * }
- * ...
- * $stack--;
- * }
- * @endcode
- *
- * In a few cases, a function needs a resettable static variable, but the
- * function is called many times (100+) during a single page request, so
- * every microsecond of execution time that can be removed from the function
- * counts. These functions can use a more cumbersome, but faster variant of
- * calling drupal_static(). It works by storing the reference returned by
- * drupal_static() in the calling function's own static variable, thereby
- * removing the need to call drupal_static() for each iteration of the function.
- * Conceptually, it replaces:
- * @code
- * $foo = &drupal_static(__FUNCTION__);
- * @endcode
- * with:
- * @code
- * // Unfortunately, this does not work.
- * static $foo = &drupal_static(__FUNCTION__);
- * @endcode
- * However, the above line of code does not work, because PHP only allows static
- * variables to be initializied by literal values, and does not allow static
- * variables to be assigned to references.
- * - http://php.net/manual/en/language.variables.scope.php#language.variables.scope.static
- * - http://php.net/manual/en/language.variables.scope.php#language.variables.scope.references
- * The example below shows the syntax needed to work around both limitations.
- * For benchmarks and more information, see http://drupal.org/node/619666.
- *
- * Example:
- * @code
- * function user_access($string, $account = NULL) {
- * // Use the advanced drupal_static() pattern, since this is called very often.
- * static $drupal_static_fast;
- * if (!isset($drupal_static_fast)) {
- * $drupal_static_fast['perm'] = &drupal_static(__FUNCTION__);
- * }
- * $perm = &$drupal_static_fast['perm'];
- * ...
- * }
- * @endcode
- *
- * @param $name
- * Globally unique name for the variable. For a function with only one static,
- * variable, the function name (e.g. via the PHP magic __FUNCTION__ constant)
- * is recommended. For a function with multiple static variables add a
- * distinguishing suffix to the function name for each one.
- * @param $default_value
- * Optional default value.
- * @param $reset
- * TRUE to reset a specific named variable, or all variables if $name is NULL.
- * Resetting every variable should only be used, for example, for running
- * unit tests with a clean environment. Should be used only though via
- * function drupal_static_reset() and the return value should not be used in
- * this case.
- *
- * @return
- * Returns a variable by reference.
- *
- * @see drupal_static_reset()
- */
-function &drupal_static($name, $default_value = NULL, $reset = FALSE) {
- static $data = array(), $default = array();
- // First check if dealing with a previously defined static variable.
- if (isset($data[$name]) || array_key_exists($name, $data)) {
- // Non-NULL $name and both $data[$name] and $default[$name] statics exist.
- if ($reset) {
- // Reset pre-existing static variable to its default value.
- $data[$name] = $default[$name];
- }
- return $data[$name];
- }
- // Neither $data[$name] nor $default[$name] static variables exist.
- if (isset($name)) {
- if ($reset) {
- // Reset was called before a default is set and yet a variable must be
- // returned.
- return $data;
- }
- // First call with new non-NULL $name. Initialize a new static variable.
- $default[$name] = $data[$name] = $default_value;
- return $data[$name];
- }
- // Reset all: ($name == NULL). This needs to be done one at a time so that
- // references returned by earlier invocations of drupal_static() also get
- // reset.
- foreach ($default as $name => $value) {
- $data[$name] = $value;
- }
- // As the function returns a reference, the return should always be a
- // variable.
- return $data;
-}
-
-/**
- * Reset one or all centrally stored static variable(s).
- *
- * @param $name
- * Name of the static variable to reset. Omit to reset all variables.
- */
-function drupal_static_reset($name = NULL) {
- drupal_static($name, NULL, TRUE);
-}
-
-/**
- * Detect whether the current script is running in a command-line environment.
- */
-function drupal_is_cli() {
- return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
-}
-
-/**
- * Formats text for emphasized display in a placeholder inside a sentence.
- * Used automatically by t().
- *
- * @param $text
- * The text to format (plain-text).
- *
- * @return
- * The formatted text (html).
- */
-function drupal_placeholder($text) {
- return '<em class="placeholder">' . check_plain($text) . '</em>';
-}
-
-/**
- * Register a function for execution on shutdown.
- *
- * Wrapper for register_shutdown_function() that catches thrown exceptions to
- * avoid "Exception thrown without a stack frame in Unknown".
- *
- * @param $callback
- * The shutdown function to register.
- * @param ...
- * Additional arguments to pass to the shutdown function.
- *
- * @return
- * Array of shutdown functions to be executed.
- *
- * @see register_shutdown_function()
- * @ingroup php_wrappers
- */
-function &drupal_register_shutdown_function($callback = NULL) {
- // We cannot use drupal_static() here because the static cache is reset during
- // batch processing, which breaks batch handling.
- static $callbacks = array();
-
- if (isset($callback)) {
- // Only register the internal shutdown function once.
- if (empty($callbacks)) {
- register_shutdown_function('_drupal_shutdown_function');
- }
- $args = func_get_args();
- array_shift($args);
- // Save callback and arguments
- $callbacks[] = array('callback' => $callback, 'arguments' => $args, 'cwd' => getcwd());
- }
- return $callbacks;
-}
-
-/**
- * Internal function used to execute registered shutdown functions.
- */
-function _drupal_shutdown_function() {
- $callbacks = &drupal_register_shutdown_function();
-
- try {
- while (list($key, $callback) = each($callbacks)) {
- chdir($callback['cwd']);
- call_user_func_array($callback['callback'], $callback['arguments']);
- }
- }
- catch (Exception $exception) {
- // If we are displaying errors, then do so with no possibility of a further uncaught exception being thrown.
- require_once DRUPAL_ROOT . '/includes/errors.inc';
- if (error_displayable()) {
- print '<h1>Uncaught exception thrown in shutdown function.</h1>';
- print '<p>' . _drupal_render_exception_safe($exception) . '</p><hr />';
- }
- }
-}
diff --git a/includes/cache-install.inc b/includes/cache-install.inc
deleted file mode 100644
index 545f1a2..0000000
--- a/includes/cache-install.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Provides a stub cache implementation to be used during installation.
- */
-
-/**
- * A stub cache implementation to be used during the installation process.
- *
- * The stub implementation is needed when database access is not yet available.
- * Because Drupal's caching system never requires that cached data be present,
- * these stub functions can short-circuit the process and sidestep the need for
- * any persistent storage. Obviously, using this cache implementation during
- * normal operations would have a negative impact on performance.
- */
-class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface {
- function get($cid) {
- return FALSE;
- }
-
- function getMultiple(&$cids) {
- return array();
- }
-
- function set($cid, $data, $expire = CACHE_PERMANENT) {
- }
-
- function clear($cid = NULL, $wildcard = FALSE) {
- // If there is a database cache, attempt to clear it whenever possible. The
- // reason for doing this is that the database cache can accumulate data
- // during installation due to any full bootstraps that may occur at the
- // same time (for example, AJAX requests triggered by the installer). If we
- // didn't try to clear it whenever this function is called, the data in the
- // cache would become stale; for example, the installer sometimes calls
- // variable_set(), which updates the {variable} table and then clears the
- // cache to make sure that the next page request picks up the new value.
- // Not actually clearing the cache here therefore leads old variables to be
- // loaded on the first page requests after installation, which can cause
- // subtle bugs, some of which would not be fixed unless the site
- // administrator cleared the cache manually.
- try {
- if (class_exists('Database')) {
- parent::clear($cid, $wildcard);
- }
- }
- // If the attempt at clearing the cache causes an error, that means that
- // either the database connection is not set up yet or the relevant cache
- // table in the database has not yet been created, so we can safely do
- // nothing here.
- catch (Exception $e) {
- }
- }
-
- function isEmpty() {
- return TRUE;
- }
-}
diff --git a/includes/cache.inc b/includes/cache.inc
deleted file mode 100644
index 2a729ef..0000000
--- a/includes/cache.inc
+++ /dev/null
@@ -1,501 +0,0 @@
-<?php
-// $Id$
-
-/**
- * Get the cache object for a cache bin.
- *
- * By default, this returns an instance of the DrupalDatabaseCache class.
- * Classes implementing DrupalCacheInterface can register themselves both as a
- * default implementation and for specific bins.
- *
- * @see DrupalCacheInterface
- *
- * @param $bin
- * The cache bin for which the cache object should be returned.
- * @return DrupalCacheInterface
- * The cache object associated with the specified bin.
- */
-function _cache_get_object($bin) {
- // We do not use drupal_static() here because we do not want to change the
- // storage of a cache bin mid-request.
- static $cache_objects;
- if (!isset($cache_objects[$bin])) {
- $class = variable_get('cache_class_' . $bin);
- if (!isset($class)) {
- $class = variable_get('cache_default_class', 'DrupalDatabaseCache');
- }
- $cache_objects[$bin] = new $class($bin);
- }
- return $cache_objects[$bin];
-}
-
-/**
- * Return data from the persistent cache
- *
- * Data may be stored as either plain text or as serialized data. cache_get
- * will automatically return unserialized objects and arrays.
- *
- * @param $cid
- * The cache ID of the data to retrieve.
- * @param $bin
- * The cache bin to store the data in. Valid core values are 'cache_block',
- * 'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form',
- * 'cache_menu', 'cache_page', 'cache_path', 'cache_update' or 'cache' for
- * the default cache.
- *
- * @return
- * The cache or FALSE on failure.
- */
-function cache_get($cid, $bin = 'cache') {
- return _cache_get_object($bin)->get($cid);
-}
-
-/**
- * Return data from the persistent cache when given an array of cache IDs.
- *
- * @param $cids
- * An array of cache IDs for the data to retrieve. This is passed by
- * reference, and will have the IDs successfully returned from cache removed.
- * @param $bin
- * The cache bin where the data is stored.
- * @return
- * An array of the items successfully returned from cache indexed by cid.
- */
-function cache_get_multiple(array &$cids, $bin = 'cache') {
- return _cache_get_object($bin)->getMultiple($cids);
-}
-
-/**
- * Store data in the persistent cache.
- *
- * The persistent cache is split up into several cache bins. In the default
- * cache implementation, each cache bin corresponds to a database table by the
- * same name. Other implementations might want to store several bins in data
- * structures that get flushed together. While it is not a problem for most
- * cache bins if the entries in them are flushed before their expire time, some
- * might break functionality or are extremely expensive to recalculate. These
- * will be marked with a (*). The other bins expired automatically by core.
- * Contributed modules can add additional bins and get them expired
- * automatically by implementing hook_flush_caches().
- *
- * - cache: Generic cache storage bin (used for variables, theme registry,
- * locale date, list of simpletest tests etc).
- *
- * - cache_block: Stores the content of various blocks.
- *
- * - cache field: Stores the field data belonging to a given object.
- *
- * - cache_filter: Stores filtered pieces of content.
- *
- * - cache_form(*): Stores multistep forms. Flushing this bin means that some
- * forms displayed to users lose their state and the data already submitted
- * to them.
- *
- * - cache_menu: Stores the structure of visible navigation menus per page.
- *
- * - cache_page: Stores generated pages for anonymous users. It is flushed
- * very often, whenever a page changes, at least for every ode and comment
- * submission. This is the only bin affected by the page cache setting on
- * the administrator panel.
- *
- * - cache path: Stores the system paths that have an alias.
- *
- * - cache update(*): Stores available releases. The update server (for
- * example, drupal.org) needs to produce the relevant XML for every project
- * installed on the current site. As this is different for (almost) every
- * site, it's very expensive to recalculate for the update server.
- *
- * The reasons for having several bins are as follows:
- *
- * - smaller bins mean smaller database tables and allow for faster selects and
- * inserts
- * - we try to put fast changing cache items and rather static ones into
- * different bins. The effect is that only the fast changing bins will need a
- * lot of writes to disk. The more static bins will also be better cacheable
- * with MySQL's query cache.
- *
- * @param $cid
- * The cache ID of the data to store.
- * @param $data
- * The data to store in the cache. Complex data types will be automatically
- * serialized before insertion.
- * Strings will be stored as plain text and not serialized.
- * @param $bin
- * The cache bin to store the data in. Valid core values are 'cache_block',
- * 'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form',
- * 'cache_menu', 'cache_page', 'cache_update' or 'cache' for the default
- * cache.
- * @param $expire
- * One of the following values:
- * - CACHE_PERMANENT: Indicates that the item should never be removed unless
- * explicitly told to using cache_clear_all() with a cache ID.
- * - CACHE_TEMPORARY: Indicates that the item should be removed at the next
- * general cache wipe.
- * - A Unix timestamp: Indicates that the item should be kept at least until
- * the given time, after which it behaves like CACHE_TEMPORARY.
- */
-function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
- return _cache_get_object($bin)->set($cid, $data, $expire);
-}
-
-/**
- * Expire data from the cache.
- *
- * If called without arguments, expirable entries will be cleared from the
- * cache_page and cache_block bins.
- *
- * @param $cid
- * If set, the cache ID to delete. Otherwise, all cache entries that can
- * expire are deleted.
- *
- * @param $bin
- * If set, the bin $bin to delete from. Mandatory
- * argument if $cid is set.
- *
- * @param $wildcard
- * If $wildcard is TRUE, cache IDs starting with $cid are deleted in
- * addition to the exact cache ID specified by $cid. If $wildcard is
- * TRUE and $cid is '*' then the entire table $table is emptied.
- */
-function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
- if (!isset($cid) && !isset($bin)) {
- // Clear the block cache first, so stale data will
- // not end up in the page cache.
- if (module_exists('block')) {
- cache_clear_all(NULL, 'cache_block');
- }
- cache_clear_all(NULL, 'cache_page');
- return;
- }
- return _cache_get_object($bin)->clear($cid, $wildcard);
-}
-
-/**
- * Check if a cache bin is empty.
- *
- * A cache bin is considered empty if it does not contain any valid data for any
- * cache ID.
- *
- * @param $bin
- * The cache bin to check.
- * @return
- * TRUE if the cache bin specified is empty.
- */
-function cache_is_empty($bin) {
- return _cache_get_object($bin)->isEmpty();
-}
-
-/**
- * Interface for cache implementations.
- *
- * All cache implementations have to implement this interface.
- * DrupalDatabaseCache provides the default implementation, which can be
- * consulted as an example.
- *
- * To make Drupal use your implementation for a certain cache bin, you have to
- * set a variable with the name of the cache bin as its key and the name of
- * your class as its value. For example, if your implementation of
- * DrupalCacheInterface was called MyCustomCache, the following line would make
- * Drupal use it for the 'cache_page' bin:
- * @code
- * variable_set('cache_page', 'MyCustomCache');
- * @endcode
- *
- * Additionally, you can register your cache implementation to be used by
- * default for all cache bins by setting the variable 'cache_default_class' to
- * the name of your implementation of the DrupalCacheInterface, e.g.
- * @code
- * variable_set('cache_default_class', 'MyCustomCache');
- * @endcode
- *
- * @see _cache_get_object()
- * @see DrupalDatabaseCache
- */
-interface DrupalCacheInterface {
- /**
- * Constructor.
- *
- * @param $bin
- * The cache bin for which the object is created.
- */
- function __construct($bin);
-
- /**
- * Return data from the persistent cache. Data may be stored as either plain
- * text or as serialized data. cache_get will automatically return
- * unserialized objects and arrays.
- *
- * @param $cid
- * The cache ID of the data to retrieve.
- * @return
- * The cache or FALSE on failure.
- */
- function get($cid);
-
- /**
- * Return data from the persistent cache when given an array of cache IDs.
- *
- * @param $cids
- * An array of cache IDs for the data to retrieve. This is passed by
- * reference, and will have the IDs successfully returned from cache
- * removed.
- * @return
- * An array of the items successfully returned from cache indexed by cid.
- */
- function getMultiple(&$cids);
-
- /**
- * Store data in the persistent cache.
- *
- * @param $cid
- * The cache ID of the data to store.
- * @param $data
- * The data to store in the cache. Complex data types will be automatically
- * serialized before insertion.
- * Strings will be stored as plain text and not serialized.
- * @param $expire
- * One of the following values:
- * - CACHE_PERMANENT: Indicates that the item should never be removed unless
- * explicitly told to using cache_clear_all() with a cache ID.
- * - CACHE_TEMPORARY: Indicates that the item should be removed at the next
- * general cache wipe.
- * - A Unix timestamp: Indicates that the item should be kept at least until
- * the given time, after which it behaves like CACHE_TEMPORARY.
- */
- function set($cid, $data, $expire = CACHE_PERMANENT);
-
-
- /**
- * Expire data from the cache. If called without arguments, expirable
- * entries will be cleared from the cache_page and cache_block bins.
- *
- * @param $cid
- * If set, the cache ID to delete. Otherwise, all cache entries that can
- * expire are deleted.
- * @param $wildcard
- * If set to TRUE, the $cid is treated as a substring
- * to match rather than a complete ID. The match is a right hand
- * match. If '*' is given as $cid, the bin $bin will be emptied.
- */
- function clear($cid = NULL, $wildcard = FALSE);
-
- /**
- * Check if a cache bin is empty.
- *
- * A cache bin is considered empty if it does not contain any valid data for
- * any cache ID.
- *
- * @return
- * TRUE if the cache bin specified is empty.
- */
- function isEmpty();
-}
-
-/**
- * Default cache implementation.
- *
- * This is Drupal's default cache implementation. It uses the database to store
- * cached data. Each cache bin corresponds to a database table by the same name.
- */
-class DrupalDatabaseCache implements DrupalCacheInterface {
- protected $bin;
-
- function __construct($bin) {
- $this->bin = $bin;
- }
-
- function get($cid) {
- try {
- // Garbage collection necessary when enforcing a minimum cache lifetime.
- $this->garbageCollection($this->bin);
- $cache = db_query("SELECT data, created, expire, serialized FROM {" . $this->bin . "} WHERE cid = :cid", array(':cid' => $cid))->fetchObject();
- return $this->prepareItem($cache);
- }
- catch (Exception $e) {
- // If the database is never going to be available, cache requests should
- // return FALSE in order to allow exception handling to occur.
- return FALSE;
- }
- }
-
- function getMultiple(&$cids) {
- try {
- // Garbage collection necessary when enforcing a minimum cache lifetime.
- $this->garbageCollection($this->bin);
- $query = db_select($this->bin);
- $query->fields($this->bin, array('cid', 'data', 'created', 'expire', 'serialized'));
- $query->condition($this->bin . '.cid', $cids, 'IN');
- $result = $query->execute();
- $cache = array();
- foreach ($result as $item) {
- $item = $this->prepareItem($item);
- if ($item) {
- $cache[$item->cid] = $item;
- }
- }
- $cids = array_diff($cids, array_keys($cache));
- return $cache;
- }
- catch (Exception $e) {
- // If the database is never going to be available, cache requests should
- // return FALSE in order to allow exception handling to occur.
- return array();
- }
- }
-
- /**
- * Garbage collection for get() and getMultiple().
- *
- * @param $bin
- * The bin being requested.
- */
- protected function garbageCollection() {
- global $user;
-
- // Garbage collection necessary when enforcing a minimum cache lifetime.
- $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
- if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME)) {
- // Reset the variable immediately to prevent a meltdown in heavy load situations.
- variable_set('cache_flush_' . $this->bin, 0);
- // Time to flush old cache data
- db_delete($this->bin)
- ->condition('expire', CACHE_PERMANENT, '<>')
- ->condition('expire', $cache_flush, '<=')
- ->execute();
- }
- }
-
- /**
- * Prepare a cached item.
- *
- * Checks that items are either permanent or did not expire, and unserializes
- * data as appropriate.
- *
- * @param $cache
- * An item loaded from cache_get() or cache_get_multiple().
- * @return
- * The item with data unserialized as appropriate or FALSE if there is no
- * valid item to load.
- */
- protected function prepareItem($cache) {
- global $user;
-
- if (!isset($cache->data)) {
- return FALSE;
- }
- // If enforcing a minimum cache lifetime, validate that the data is
- // currently valid for this user before we return it by making sure the cache
- // entry was created before the timestamp in the current session's cache
- // timer. The cache variable is loaded into the $user object by _drupal_session_read()
- // in session.inc. If the data is permanent or we're not enforcing a minimum
- // cache lifetime always return the cached data.
- if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && $user->cache > $cache->created) {
- // This cache data is too old and thus not valid for us, ignore it.
- return FALSE;
- }
-
- if ($cache->serialized) {
- $cache->data = unserialize($cache->data);
- }
-
- return $cache;
- }
-
- function set($cid, $data, $expire = CACHE_PERMANENT) {
- $fields = array(
- 'serialized' => 0,
- 'created' => REQUEST_TIME,
- 'expire' => $expire,
- );
- if (!is_string($data)) {
- $fields['data'] = serialize($data);
- $fields['serialized'] = 1;
- }
- else {
- $fields['data'] = $data;
- $fields['serialized'] = 0;
- }
-
- try {
- db_merge($this->bin)
- ->key(array('cid' => $cid))
- ->fields($fields)
- ->execute();
- }
- catch (Exception $e) {
- // The database may not be available, so we'll ignore cache_set requests.
- }
- }
-
- function clear($cid = NULL, $wildcard = FALSE) {
- global $user;
-
- if (empty($cid)) {
- if (variable_get('cache_lifetime', 0)) {
- // We store the time in the current user's $user->cache variable which
- // will be saved into the sessions bin by _drupal_session_write(). We then
- // simulate that the cache was flushed for this user by not returning
- // cached data that was cached before the timestamp.
- $user->cache = REQUEST_TIME;
-
- $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
- if ($cache_flush == 0) {
- // This is the first request to clear the cache, start a timer.
- variable_set('cache_flush_' . $this->bin, REQUEST_TIME);
- }
- elseif (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) {
- // Clear the cache for everyone, cache_lifetime seconds have
- // passed since the first request to clear the cache.
- db_delete($this->bin)
- ->condition('expire', CACHE_PERMANENT, '<>')
- ->condition('expire', REQUEST_TIME, '<')
- ->execute();
- variable_set('cache_flush_' . $this->bin, 0);
- }
- }
- else {
- // No minimum cache lifetime, flush all temporary cache entries now.
- db_delete($this->bin)
- ->condition('expire', CACHE_PERMANENT, '<>')
- ->condition('expire', REQUEST_TIME, '<')
- ->execute();
- }
- }
- else {
- if ($wildcard) {
- if ($cid == '*') {
- db_truncate($this->bin)->execute();
- }
- else {
- db_delete($this->bin)
- ->condition('cid', db_like($cid) . '%', 'LIKE')
- ->execute();
- }
- }
- elseif (is_array($cid)) {
- // Delete in chunks when a large array is passed.
- do {
- db_delete($this->bin)
- ->condition('cid', array_splice($cid, 0, 1000), 'IN')
- ->execute();
- }
- while (count($cid));
- }
- else {
- db_delete($this->bin)
- ->condition('cid', $cid)
- ->execute();
- }
- }
- }
-
- function isEmpty() {
- $this->garbageCollection();
- $query = db_select($this->bin);
- $query->addExpression('1');
- $result = $query->range(0, 1)
- ->execute()
- ->fetchField();
- return empty($result);
- }
-}
diff --git a/includes/common.inc b/includes/common.inc
deleted file mode 100644
index afb08ea..0000000
--- a/includes/common.inc
+++ /dev/null
@@ -1,6902 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Common functions that many Drupal modules will need to reference.
- *
- * The functions that are critical and need to be available even when serving
- * a cached page are instead located in bootstrap.inc.
- */
-
-/**
- * @defgroup php_wrappers PHP wrapper functions
- * @{
- * Functions that are wrappers or custom implementations of PHP functions.
- *
- * Certain PHP functions should not be used in Drupal. Instead, Drupal's
- * replacement functions should be used.
- *
- * For example, for improved or more secure UTF8-handling, or RFC-compliant
- * handling of URLs in Drupal.
- *
- * For ease of use and memorizing, all these wrapper functions use the same name
- * as the original PHP function, but prefixed with "drupal_". Beware, however,
- * that not all wrapper functions support the same arguments as the original
- * functions.
- *
- * You should always use these wrapper functions in your code.
- *
- * Wrong:
- * @code
- * $my_substring = substr($original_string, 0, 5);
- * @endcode
- *
- * Correct:
- * @code
- * $my_substring = drupal_substr($original_string, 0, 5);
- * @endcode
- *
- * @} End of "defgroup php_wrappers".
- */
-
-/**
- * Return status for saving which involved creating a new item.
- */
-define('SAVED_NEW', 1);
-
-/**
- * Return status for saving which involved an update to an existing item.
- */
-define('SAVED_UPDATED', 2);
-
-/**
- * Return status for saving which deleted an existing item.
- */
-define('SAVED_DELETED', 3);
-
-/**
- * The default weight of system CSS files added to the page.
- */
-define('CSS_SYSTEM', -100);
-
-/**
- * The default weight of CSS files added to the page.
- */
-define('CSS_DEFAULT', 0);
-
-/**
- * The default weight of theme CSS files added to the page.
- */
-define('CSS_THEME', 100);
-
-/**
- * The weight of JavaScript libraries, settings or jQuery plugins being
- * added to the page.
- */
-define('JS_LIBRARY', -100);
-
-/**
- * The default weight of JavaScript being added to the page.
- */
-define('JS_DEFAULT', 0);
-
-/**
- * The weight of theme JavaScript code being added to the page.
- */
-define('JS_THEME', 100);
-
-/**
- * Error code indicating that the request made by drupal_http_request() exceeded
- * the specified timeout.
- */
-define('HTTP_REQUEST_TIMEOUT', 1);
-
-/**
- * Constants defining cache granularity for blocks and renderable arrays.
- *
- * Modules specify the caching patterns for their blocks using binary
- * combinations of these constants in their hook_block_info():
- * $block[delta]['cache'] = DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE;
- * DRUPAL_CACHE_PER_ROLE is used as a default when no caching pattern is
- * specified. Use DRUPAL_CACHE_CUSTOM to disable standard block cache and
- * implement
- *
- * The block cache is cleared in cache_clear_all(), and uses the same clearing
- * policy than page cache (node, comment, user, taxonomy added or updated...).
- * Blocks requiring more fine-grained clearing might consider disabling the
- * built-in block cache (DRUPAL_NO_CACHE) and roll their own.
- *
- * Note that user 1 is excluded from block caching.
- */
-
-/**
- * The block should not get cached. This setting should be used:
- * - for simple blocks (notably those that do not perform any db query),
- * where querying the db cache would be more expensive than directly generating
- * the content.
- * - for blocks that change too frequently.
- */
-define('DRUPAL_NO_CACHE', -1);
-
-/**
- * The block is handling its own caching in its hook_block_view(). From the
- * perspective of the block cache system, this is equivalent to DRUPAL_NO_CACHE.
- * Useful when time based expiration is needed or a site uses a node access
- * which invalidates standard block cache.
- */
-define('DRUPAL_CACHE_CUSTOM', -2);
-
-/**
- * The block or element can change depending on the roles the user viewing the
- * page belongs to. This is the default setting for blocks, used when the block
- * does not specify anything.
- */
-define('DRUPAL_CACHE_PER_ROLE', 0x0001);
-
-/**
- * The block or element can change depending on the user viewing the page.
- * This setting can be resource-consuming for sites with large number of users,
- * and thus should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.
- */
-define('DRUPAL_CACHE_PER_USER', 0x0002);
-
-/**
- * The block or element can change depending on the page being viewed.
- */
-define('DRUPAL_CACHE_PER_PAGE', 0x0004);
-
-/**
- * The block or element is the same for every user on every page where it is visible.
- */
-define('DRUPAL_CACHE_GLOBAL', 0x0008);
-
-/**
- * Add content to a specified region.
- *
- * @param $region
- * Page region the content is added to.
- * @param $data
- * Content to be added.
- */
-function drupal_add_region_content($region = NULL, $data = NULL) {
- static $content = array();
-
- if (!is_null($region) && !is_null($data)) {
- $content[$region][] = $data;
- }
- return $content;
-}
-
-/**
- * Get assigned content for a given region.
- *
- * @param $region
- * A specified region to fetch content for. If NULL, all regions will be
- * returned.
- * @param $delimiter
- * Content to be inserted between imploded array elements.
- */
-function drupal_get_region_content($region = NULL, $delimiter = ' ') {
- $content = drupal_add_region_content();
- if (isset($region)) {
- if (isset($content[$region]) && is_array($content[$region])) {
- return implode($delimiter, $content[$region]);
- }
- }
- else {
- foreach (array_keys($content) as $region) {
- if (is_array($content[$region])) {
- $content[$region] = implode($delimiter, $content[$region]);
- }
- }
- return $content;
- }
-}
-
-/**
- * Get the name of the currently active install profile.
- *
- * When this function is called during Drupal's initial installation process,
- * the name of the profile that's about to be installed is stored in the global
- * installation state. At all other times, the standard Drupal systems variable
- * table contains the name of the current profile, and we can call variable_get()
- * to determine what one is active.
- *
- * @return $profile
- * The name of the install profile.
- */
-function drupal_get_profile() {
- global $install_state;
-
- if (isset($install_state['parameters']['profile'])) {
- $profile = $install_state['parameters']['profile'];
- }
- else {
- $profile = variable_get('install_profile', 'standard');
- }
-
- return $profile;
-}
-
-
-/**
- * Set the breadcrumb trail for the current page.
- *
- * @param $breadcrumb
- * Array of links, starting with "home" and proceeding up to but not including
- * the current page.
- */
-function drupal_set_breadcrumb($breadcrumb = NULL) {
- $stored_breadcrumb = &drupal_static(__FUNCTION__);
-
- if (!is_null($breadcrumb)) {
- $stored_breadcrumb = $breadcrumb;
- }
- return $stored_breadcrumb;
-}
-
-/**
- * Get the breadcrumb trail for the current page.
- */
-function drupal_get_breadcrumb() {
- $breadcrumb = drupal_set_breadcrumb();
-
- if (is_null($breadcrumb)) {
- $breadcrumb = menu_get_active_breadcrumb();
- }
-
- return $breadcrumb;
-}
-
-/**
- * Returns a string containing RDF namespace declarations for use in XML and
- * XHTML output.
- */
-function drupal_get_rdf_namespaces() {
- $xml_rdf_namespaces = array();
-
- // Serializes the RDF namespaces in XML namespace syntax.
- if (function_exists('rdf_get_namespaces')) {
- foreach (rdf_get_namespaces() as $prefix => $uri) {
- $xml_rdf_namespaces[] = 'xmlns:' . $prefix . '="' . $uri . '"';
- }
- }
- return count($xml_rdf_namespaces) ? "\n " . implode("\n ", $xml_rdf_namespaces) : '';
-}
-
-/**
- * Add output to the head tag of the HTML page.
- *
- * This function can be called as long the headers aren't sent. Pass no
- * arguments (or NULL for both) to retrieve the currently stored elements.
- *
- * @param $data
- * A renderable array. If the '#type' key is not set then 'html_tag' will be
- * added as the default '#type'.
- * @param $key
- * A unique string key to allow implementations of hook_html_head_alter() to
- * identify the element in $data. Required if $data is not NULL.
- *
- * @return
- * An array of all stored HEAD elements.
- *
- * @see theme_html_tag()
- */
-function drupal_add_html_head($data = NULL, $key = NULL) {
- $stored_head = &drupal_static(__FUNCTION__);
-
- if (!isset($stored_head)) {
- // Make sure the defaults, including Content-Type, come first.
- $stored_head = _drupal_default_html_head();
- }
-
- if (isset($data) && isset($key)) {
- if (!isset($data['#type'])) {
- $data['#type'] = 'html_tag';
- }
- $stored_head[$key] = $data;
- }
- return $stored_head;
-}
-
-/**
- * Returns elements that are always displayed in the HEAD tag of the HTML page.
- */
-function _drupal_default_html_head() {
- // Add default elements. Make sure the Content-Type comes first because the
- // IE browser may be vulnerable to XSS via encoding attacks from any content
- // that comes before this META tag, such as a TITLE tag.
- $elements['system_meta_content_type'] = array(
- '#type' => 'html_tag',
- '#tag' => 'meta',
- '#attributes' => array(
- 'http-equiv' => 'Content-Type',
- 'content' => 'text/html; charset=utf-8',
- ),
- // Security: This always has to be output first.
- '#weight' => -1000,
- );
- // Show Drupal and the major version number in the META GENERATOR tag.
- // Get the major version.
- list($version, ) = explode('.', VERSION);
- $elements['system_meta_generator'] = array(
- '#type' => 'html_tag',
- '#tag' => 'meta',
- '#attributes' => array(
- 'name' => 'Generator',
- 'content' => 'Drupal ' . $version . ' (http://drupal.org)',
- ),
- );
- // Also send the generator in the HTTP header.
- $elements['system_meta_generator']['#attached']['drupal_add_http_header'][] = array('X-Generator', $elements['system_meta_generator']['#attributes']['content']);
- return $elements;
-}
-
-/**
- * Retrieve output to be displayed in the HEAD tag of the HTML page.
- */
-function drupal_get_html_head() {
- $elements = drupal_add_html_head();
- drupal_alter('html_head', $elements);
- return drupal_render($elements);
-}
-
-/**
- * Add a feed URL for the current page.
- *
- * This function can be called as long the HTML header hasn't been sent.
- *
- * @param $url
- * A url for the feed.
- * @param $title
- * The title of the feed.
- */
-function drupal_add_feed($url = NULL, $title = '') {
- $stored_feed_links = &drupal_static(__FUNCTION__, array());
-
- if (isset($url)) {
- $stored_feed_links[$url] = theme('feed_icon', array('url' => $url, 'title' => $title));
-
- drupal_add_html_head_link(array('rel' => 'alternate',
- 'type' => 'application/rss+xml',
- 'title' => $title,
- 'href' => $url));
- }
- return $stored_feed_links;
-}
-
-/**
- * Get the feed URLs for the current page.
- *
- * @param $delimiter
- * A delimiter to split feeds by.
- */
-function drupal_get_feeds($delimiter = "\n") {
- $feeds = drupal_add_feed();
- return implode($feeds, $delimiter);
-}
-
-/**
- * @name HTTP handling
- * @{
- * Functions to properly handle HTTP responses.
- */
-
-/**
- * Process a URL query parameter array to remove unwanted elements.
- *
- * @param $query
- * (optional) An array to be processed. Defaults to $_GET.
- * @param $exclude
- * (optional) A list of $query array keys to remove. Use "parent[child]" to
- * exclude nested items. Defaults to array('q').
- * @param $parent
- * Internal use only. Used to build the $query array key for nested items.
- *
- * @return
- * An array containing query parameters, which can be used for url().
- */
-function drupal_get_query_parameters(array $query = NULL, array $exclude = array('q'), $parent = '') {
- // Set defaults, if none given.
- if (!isset($query)) {
- $query = $_GET;
- }
- // If $exclude is empty, there is nothing to filter.
- if (empty($exclude)) {
- return $query;
- }
- elseif (!$parent) {
- $exclude = array_flip($exclude);
- }
-
- $params = array();
- foreach ($query as $key => $value) {
- $string_key = ($parent ? $parent . '[' . $key . ']' : $key);
- if (isset($exclude[$string_key])) {
- continue;
- }
-
- if (is_array($value)) {
- $params[$key] = drupal_get_query_parameters($value, $exclude, $string_key);
- }
- else {
- $params[$key] = $value;
- }
- }
-
- return $params;
-}
-
-/**
- * Split an URL-encoded query string into an array.
- *
- * @param $query
- * The query string to split.
- *
- * @return
- * An array of url decoded couples $param_name => $value.
- */
-function drupal_get_query_array($query) {
- $result = array();
- if (!empty($query)) {
- foreach (explode('&', $query) as $param) {
- $param = explode('=', $param);
- $result[$param[0]] = isset($param[1]) ? rawurldecode($param[1]) : '';
- }
- }
- return $result;
-}
-
-/**
- * Parse an array into a valid, rawurlencoded query string.
- *
- * This differs from http_build_query() as we need to rawurlencode() (instead of
- * urlencode()) all query parameters.
- *
- * @param $query
- * The query parameter array to be processed, e.g. $_GET.
- * @param $parent
- * Internal use only. Used to build the $query array key for nested items.
- *
- * @return
- * A rawurlencoded string which can be used as or appended to the URL query
- * string.
- *
- * @see drupal_get_query_parameters()
- * @ingroup php_wrappers
- */
-function drupal_http_build_query(array $query, $parent = '') {
- $params = array();
-
- foreach ($query as $key => $value) {
- $key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key));
-
- // Recurse into children.
- if (is_array($value)) {
- $params[] = drupal_http_build_query($value, $key);
- }
- // If a query parameter value is NULL, only append its key.
- elseif (!isset($value)) {
- $params[] = $key;
- }
- else {
- // For better readability of paths in query strings, we decode slashes.
- $params[] = $key . '=' . str_replace('%2F', '/', rawurlencode($value));
- }
- }
-
- return implode('&', $params);
-}
-
-/**
- * Prepare a 'destination' URL query parameter for use in combination with drupal_goto().
- *
- * Used to direct the user back to the referring page after completing a form.
- * By default the current URL is returned. If a destination exists in the
- * previous request, that destination is returned. As such, a destination can
- * persist across multiple pages.
- *
- * @see drupal_goto()
- */
-function drupal_get_destination() {
- $destination = &drupal_static(__FUNCTION__);
-
- if (isset($destination)) {
- return $destination;
- }
-
- if (isset($_GET['destination'])) {
- $destination = array('destination' => $_GET['destination']);
- }
- else {
- $path = $_GET['q'];
- $query = drupal_http_build_query(drupal_get_query_parameters());
- if ($query != '') {
- $path .= '?' . $query;
- }
- $destination = array('destination' => $path);
- }
- return $destination;
-}
-
-/**
- * Wrapper around parse_url() to parse a system URL string into an associative array, suitable for url().
- *
- * This function should only be used for URLs that have been generated by the
- * system, resp. url(). It should not be used for URLs that come from external
- * sources, or URLs that link to external resources.
- *
- * The returned array contains a 'path' that may be passed separately to url().
- * For example:
- * @code
- * $options = drupal_parse_url($_GET['destination']);
- * $my_url = url($options['path'], $options);
- * $my_link = l('Example link', $options['path'], $options);
- * @endcode
- *
- * This is required, because url() does not support relative URLs containing a
- * query string or fragment in its $path argument. Instead, any query string
- * needs to be parsed into an associative query parameter array in
- * $options['query'] and the fragment into $options['fragment'].
- *
- * @param $url
- * The URL string to parse, f.e. $_GET['destination'].
- *
- * @return
- * An associative array containing the keys:
- * - 'path': The path of the URL. If the given $url is external, this includes
- * the scheme and host.
- * - 'query': An array of query parameters of $url, if existent.
- * - 'fragment': The fragment of $url, if existent.
- *
- * @see url()
- * @see drupal_goto()
- * @ingroup php_wrappers
- */
-function drupal_parse_url($url) {
- $options = array(
- 'path' => NULL,
- 'query' => array(),
- 'fragment' => '',
- );
-
- // External URLs: not using parse_url() here, so we do not have to rebuild
- // the scheme, host, and path without having any use for it.
- if (strpos($url, '://') !== FALSE) {
- // Split off everything before the query string into 'path'.
- $parts = explode('?', $url);
- $options['path'] = $parts[0];
- // If there is a query string, transform it into keyed query parameters.
- if (isset($parts[1])) {
- $query_parts = explode('#', $parts[1]);
- parse_str($query_parts[0], $options['query']);
- // Take over the fragment, if there is any.
- if (isset($query_parts[1])) {
- $options['fragment'] = $query_parts[1];
- }
- }
- }
- // Internal URLs.
- else {
- // parse_url() does not support relative URLs, so make it absolute. E.g. the
- // relative URL "foo/bar:1" isn't properly parsed.
- $parts = parse_url('http://example.com/' . $url);
- // Strip the leading slash that was just added.
- $options['path'] = substr($parts['path'], 1);
- if (isset($parts['query'])) {
- parse_str($parts['query'], $options['query']);
- }
- if (isset($parts['fragment'])) {
- $options['fragment'] = $parts['fragment'];
- }
- }
- // The 'q' parameter contains the path of the current page if clean URLs are
- // disabled. It overrides the 'path' of the URL when present, even if clean
- // URLs are enabled, due to how Apache rewriting rules work.
- if (isset($options['query']['q'])) {
- $options['path'] = $options['query']['q'];
- unset($options['query']['q']);
- }
-
- return $options;
-}
-
-/**
- * Encodes a Drupal path for use in a URL.
- *
- * For aesthetic reasons slashes are not escaped.
- *
- * Note that url() takes care of calling this function, so a path passed to that
- * function should not be encoded in advance.
- *
- * @param $path
- * The Drupal path to encode.
- */
-function drupal_encode_path($path) {
- return str_replace('%2F', '/', rawurlencode($path));
-}
-
-/**
- * Send the user to a different Drupal page.
- *
- * This issues an on-site HTTP redirect. The function makes sure the redirected
- * URL is formatted correctly.
- *
- * Usually the redirected URL is constructed from this function's input
- * parameters. However you may override that behavior by setting a
- * destination in either the $_REQUEST-array (i.e. by using
- * the query string of an URI) This is used to direct the user back to
- * the proper page after completing a form. For example, after editing
- * a post on the 'admin/content'-page or after having logged on using the
- * 'user login'-block in a sidebar. The function drupal_get_destination()
- * can be used to help set the destination URL.
- *
- * Drupal will ensure that messages set by drupal_set_message() and other
- * session data are written to the database before the user is redirected.
- *
- * This function ends the request; use it instead of a return in your menu
- * callback.
- *
- * @param $path
- * A Drupal path or a full URL.
- * @param $options
- * An associative array of additional URL options to pass to url().
- * @param $http_response_code
- * Valid values for an actual "goto" as per RFC 2616 section 10.3 are:
- * - 301 Moved Permanently (the recommended value for most redirects)
- * - 302 Found (default in Drupal and PHP, sometimes used for spamming search
- * engines)
- * - 303 See Other
- * - 304 Not Modified
- * - 305 Use Proxy
- * - 307 Temporary Redirect (alternative to "503 Site Down for Maintenance")
- * Note: Other values are defined by RFC 2616, but are rarely used and poorly
- * supported.
- *
- * @see drupal_get_destination()
- * @see url()
- */
-function drupal_goto($path = '', array $options = array(), $http_response_code = 302) {
- // A destination in $_GET always overrides the function arguments.
- // We do not allow absolute URLs to be passed via $_GET, as this can be an attack vector.
- if (isset($_GET['destination']) && !url_is_external($_GET['destination'])) {
- $destination = drupal_parse_url($_GET['destination']);
- $path = $destination['path'];
- $options['query'] = $destination['query'];
- $options['fragment'] = $destination['fragment'];
- }
-
- drupal_alter('drupal_goto', $path, $options, $http_response_code);
-
- // The 'Location' HTTP header must be absolute.
- $options['absolute'] = TRUE;
-
- $url = url($path, $options);
-
- header('Location: ' . $url, TRUE, $http_response_code);
-
- // The "Location" header sends a redirect status code to the HTTP daemon. In
- // some cases this can be wrong, so we make sure none of the code below the
- // drupal_goto() call gets executed upon redirection.
- drupal_exit($url);
-}
-
-/**
- * Deliver a "site is under maintenance" message to the browser.
- *
- * Page callback functions wanting to report a "site offline" message should
- * return MENU_SITE_OFFLINE instead of calling drupal_site_offline(). However,
- * functions that are invoked in contexts where that return value might not
- * bubble up to menu_execute_active_handler() should call drupal_site_offline().
- */
-function drupal_site_offline() {
- drupal_deliver_page(MENU_SITE_OFFLINE);
-}
-
-/**
- * Deliver a "page not found" error to the browser.
- *
- * Page callback functions wanting to report a "page not found" message should
- * return MENU_NOT_FOUND instead of calling drupal_not_found(). However,
- * functions that are invoked in contexts where that return value might not
- * bubble up to menu_execute_active_handler() should call drupal_not_found().
- */
-function drupal_not_found() {
- drupal_deliver_page(MENU_NOT_FOUND);
-}
-
-/**
- * Deliver a "access denied" error to the browser.
- *
- * Page callback functions wanting to report an "access denied" message should
- * return MENU_ACCESS_DENIED instead of calling drupal_access_denied(). However,
- * functions that are invoked in contexts where that return value might not
- * bubble up to menu_execute_active_handler() should call drupal_access_denied().
- */
-function drupal_access_denied() {
- drupal_deliver_page(MENU_ACCESS_DENIED);
-}
-
-/**
- * Perform an HTTP request.
- *
- * This is a flexible and powerful HTTP client implementation. Correctly
- * handles GET, POST, PUT or any other HTTP requests. Handles redirects.
- *
- * @param $url
- * A string containing a fully qualified URI.
- * @param $options
- * (optional) An array which can have one or more of following keys:
- * - headers
- * An array containing request headers to send as name/value pairs.
- * - method
- * A string containing the request method. Defaults to 'GET'.
- * - data
- * A string containing the request body. Defaults to NULL.
- * - max_redirects
- * An integer representing how many times a redirect may be followed.
- * Defaults to 3.
- * - timeout
- * A float representing the maximum number of seconds the function call
- * may take. The default is 30 seconds. If a timeout occurs, the error
- * code is set to the HTTP_REQUEST_TIMEOUT constant.
- * - context
- * A context resource created with stream_context_create().
- * @return
- * An object which can have one or more of the following parameters:
- * - request
- * A string containing the request body that was sent.
- * - code
- * An integer containing the response status code, or the error code if
- * an error occurred.
- * - protocol
- * The response protocol (e.g. HTTP/1.1 or HTTP/1.0).
- * - status_message
- * The status message from the response, if a response was received.
- * - redirect_code
- * If redirected, an integer containing the initial response status code.
- * - redirect_url
- * If redirected, a string containing the redirection location.
- * - error
- * If an error occurred, the error message. Otherwise not set.
- * - headers
- * An array containing the response headers as name/value pairs. HTTP
- * header names are case-insensitive (RFC 2616, section 4.2), so for easy
- * access the array keys are returned in lower case.
- * - data
- * A string containing the response body that was received.
- */
-function drupal_http_request($url, array $options = array()) {
- $result = new stdClass();
-
- // Parse the URL and make sure we can handle the schema.
- $uri = @parse_url($url);
-
- if ($uri == FALSE) {
- $result->error = 'unable to parse URL';
- $result->code = -1001;
- return $result;
- }
-
- if (!isset($uri['scheme'])) {
- $result->error = 'missing schema';
- $result->code = -1002;
- return $result;
- }
-
- timer_start(__FUNCTION__);
-
- // Merge the default options.
- $options += array(
- 'headers' => array(),
- 'method' => 'GET',
- 'data' => NULL,
- 'max_redirects' => 3,
- 'timeout' => 30.0,
- 'context' => NULL,
- );
- // stream_socket_client() requires timeout to be a float.
- $options['timeout'] = (float) $options['timeout'];
-
- switch ($uri['scheme']) {
- case 'http':
- case 'feed':
- $port = isset($uri['port']) ? $uri['port'] : 80;
- $socket = 'tcp://' . $uri['host'] . ':' . $port;
- // RFC 2616: "non-standard ports MUST, default ports MAY be included".
- // We don't add the standard port to prevent from breaking rewrite rules
- // checking the host that do not take into account the port number.
- $options['headers']['Host'] = $uri['host'] . ($port != 80 ? ':' . $port : '');
- break;
- case 'https':
- // Note: Only works when PHP is compiled with OpenSSL support.
- $port = isset($uri['port']) ? $uri['port'] : 443;
- $socket = 'ssl://' . $uri['host'] . ':' . $port;
- $options['headers']['Host'] = $uri['host'] . ($port != 443 ? ':' . $port : '');
- break;
- default:
- $result->error = 'invalid schema ' . $uri['scheme'];
- $result->code = -1003;
- return $result;
- }
-
- if (empty($options['context'])) {
- $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout']);
- }
- else {
- // Create a stream with context. Allows verification of a SSL certificate.
- $fp = @stream_socket_client($socket, $errno, $errstr, $options['timeout'], STREAM_CLIENT_CONNECT, $options['context']);
- }
-
- // Make sure the socket opened properly.
- if (!$fp) {
- // When a network error occurs, we use a negative number so it does not
- // clash with the HTTP status codes.
- $result->code = -$errno;
- $result->error = trim($errstr) ? trim($errstr) : t('Error opening socket @socket', array('@socket' => $socket));
-
- // Mark that this request failed. This will trigger a check of the web
- // server's ability to make outgoing HTTP requests the next time that
- // requirements checking is performed.
- // See system_requirements()
- variable_set('drupal_http_request_fails', TRUE);
-
- return $result;
- }
-
- // Construct the path to act on.
- $path = isset($uri['path']) ? $uri['path'] : '/';
- if (isset($uri['query'])) {
- $path .= '?' . $uri['query'];
- }
-
- // Merge the default headers.
- $options['headers'] += array(
- 'User-Agent' => 'Drupal (+http://drupal.org/)',
- );
-
- // Only add Content-Length if we actually have any content or if it is a POST
- // or PUT request. Some non-standard servers get confused by Content-Length in
- // at least HEAD/GET requests, and Squid always requires Content-Length in
- // POST/PUT requests.
- $content_length = strlen($options['data']);
- if ($content_length > 0 || $options['method'] == 'POST' || $options['method'] == 'PUT') {
- $options['headers']['Content-Length'] = $content_length;
- }
-
- // If the server URL has a user then attempt to use basic authentication.
- if (isset($uri['user'])) {
- $options['headers']['Authorization'] = 'Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : ''));
- }
-
- // If the database prefix is being used by SimpleTest to run the tests in a copied
- // database then set the user-agent header to the database prefix so that any
- // calls to other Drupal pages will run the SimpleTest prefixed database. The
- // user-agent is used to ensure that multiple testing sessions running at the
- // same time won't interfere with each other as they would if the database
- // prefix were stored statically in a file or database variable.
- $test_info = &$GLOBALS['drupal_test_info'];
- if (!empty($test_info['test_run_id'])) {
- $options['headers']['User-Agent'] = drupal_generate_test_ua($test_info['test_run_id']);
- }
-
- $request = $options['method'] . ' ' . $path . " HTTP/1.0\r\n";
- foreach ($options['headers'] as $name => $value) {
- $request .= $name . ': ' . trim($value) . "\r\n";
- }
- $request .= "\r\n" . $options['data'];
- $result->request = $request;
- // Calculate how much time is left of the original timeout value.
- $timeout = $options['timeout'] - timer_read(__FUNCTION__) / 1000;
- if ($timeout > 0) {
- stream_set_timeout($fp, floor($timeout), floor(1000000 * fmod($timeout, 1)));
- fwrite($fp, $request);
- }
-
- // Fetch response. Due to PHP bugs like http://bugs.php.net/bug.php?id=43782
- // and http://bugs.php.net/bug.php?id=46049 we can't rely on feof(), but
- // instead must invoke stream_get_meta_data() each iteration.
- $info = stream_get_meta_data($fp);
- $alive = !$info['eof'] && !$info['timed_out'];
- $response = '';
-
- while ($alive) {
- // Calculate how much time is left of the original timeout value.
- $timeout = $options['timeout'] - timer_read(__FUNCTION__) / 1000;
- if ($timeout <= 0) {
- $info['timed_out'] = TRUE;
- break;
- }
- stream_set_timeout($fp, floor($timeout), floor(1000000 * fmod($timeout, 1)));
- $chunk = fread($fp, 1024);
- $response .= $chunk;
- $info = stream_get_meta_data($fp);
- $alive = !$info['eof'] && !$info['timed_out'] && $chunk;
- }
- fclose($fp);
-
- if ($info['timed_out']) {
- $result->code = HTTP_REQUEST_TIMEOUT;
- $result->error = 'request timed out';
- return $result;
- }
- // Parse response headers from the response body.
- list($response, $result->data) = explode("\r\n\r\n", $response, 2);
- $response = preg_split("/\r\n|\n|\r/", $response);
-
- // Parse the response status line.
- list($protocol, $code, $status_message) = explode(' ', trim(array_shift($response)), 3);
- $result->protocol = $protocol;
- $result->status_message = $status_message;
-
- $result->headers = array();
-
- // Parse the response headers.
- while ($line = trim(array_shift($response))) {
- list($name, $value) = explode(':', $line, 2);
- $name = strtolower($name);
- if (isset($result->headers[$name]) && $name == 'set-cookie') {
- // RFC 2109: the Set-Cookie response header comprises the token Set-
- // Cookie:, followed by a comma-separated list of one or more cookies.
- $result->headers[$name] .= ',' . trim($value);
- }
- else {
- $result->headers[$name] = trim($value);
- }
- }
-
- $responses = array(
- 100 => 'Continue',
- 101 => 'Switching Protocols',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary Redirect',
- 400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Time-out',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Large',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested range not satisfiable',
- 417 => 'Expectation Failed',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Time-out',
- 505 => 'HTTP Version not supported',
- );
- // RFC 2616 states that all unknown HTTP codes must be treated the same as the
- // base code in their class.
- if (!isset($responses[$code])) {
- $code = floor($code / 100) * 100;
- }
- $result->code = $code;
-
- switch ($code) {
- case 200: // OK
- case 304: // Not modified
- break;
- case 301: // Moved permanently
- case 302: // Moved temporarily
- case 307: // Moved temporarily
- $location = $result->headers['location'];
- $options['timeout'] -= timer_read(__FUNCTION__) / 1000;
- if ($options['timeout'] <= 0) {
- $result->code = HTTP_REQUEST_TIMEOUT;
- $result->error = 'request timed out';
- }
- elseif ($options['max_redirects']) {
- // Redirect to the new location.
- $options['max_redirects']--;
- $result = drupal_http_request($location, $options);
- $result->redirect_code = $code;
- }
- $result->redirect_url = $location;
- break;
- default:
- $result->error = $status_message;
- }
-
- return $result;
-}
-/**
- * @} End of "HTTP handling".
- */
-
-function _fix_gpc_magic(&$item) {
- if (is_array($item)) {
- array_walk($item, '_fix_gpc_magic');
- }
- else {
- $item = stripslashes($item);
- }
-}
-
-/**
- * Helper function to strip slashes from $_FILES skipping over the tmp_name keys
- * since PHP generates single backslashes for file paths on Windows systems.
- *
- * tmp_name does not have backslashes added see
- * http://php.net/manual/en/features.file-upload.php#42280
- */
-function _fix_gpc_magic_files(&$item, $key) {
- if ($key != 'tmp_name') {
- if (is_array($item)) {
- array_walk($item, '_fix_gpc_magic_files');
- }
- else {
- $item = stripslashes($item);
- }
- }
-}
-
-/**
- * Fix double-escaping problems caused by "magic quotes" in some PHP installations.
- */
-function fix_gpc_magic() {
- $fixed = &drupal_static(__FUNCTION__, FALSE);
- if (!$fixed && ini_get('magic_quotes_gpc')) {
- array_walk($_GET, '_fix_gpc_magic');
- array_walk($_POST, '_fix_gpc_magic');
- array_walk($_COOKIE, '_fix_gpc_magic');
- array_walk($_REQUEST, '_fix_gpc_magic');
- array_walk($_FILES, '_fix_gpc_magic_files');
- $fixed = TRUE;
- }
-}
-
-/**
- * @defgroup validation Input validation
- * @{
- * Functions to validate user input.
- */
-
-/**
- * Verify the syntax of the given e-mail address.
- *
- * Empty e-mail addresses are allowed. See RFC 2822 for details.
- *
- * @param $mail
- * A string containing an e-mail address.
- * @return
- * TRUE if the address is in a valid format.
- */
-function valid_email_address($mail) {
- return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
-}
-
-/**
- * Verify the syntax of the given URL.
- *
- * This function should only be used on actual URLs. It should not be used for
- * Drupal menu paths, which can contain arbitrary characters.
- * Valid values per RFC 3986.
- * @param $url
- * The URL to verify.
- * @param $absolute
- * Whether the URL is absolute (beginning with a scheme such as "http:").
- * @return
- * TRUE if the URL is in a valid format.
- */
-function valid_url($url, $absolute = FALSE) {
- if ($absolute) {
- return (bool)preg_match("
- /^ # Start at the beginning of the text
- (?:ftp|https?|feed):\/\/ # Look for ftp, http, https or feed schemes
- (?: # Userinfo (optional) which is typically
- (?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)* # a username or a username and password
- (?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@ # combination
- )?
- (?:
- (?:[a-z0-9\-\.]|%[0-9a-f]{2})+ # A domain name or a IPv4 address
- |(?:\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\]) # or a well formed IPv6 address
- )
- (?::[0-9]+)? # Server port number (optional)
- (?:[\/|\?]
- (?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2}) # The path and query (optional)
- *)?
- $/xi", $url);
- }
- else {
- return (bool)preg_match("/^(?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})+$/i", $url);
- }
-}
-
-/**
- * @} End of "defgroup validation".
- */
-
-/**
- * Register an event for the current visitor to the flood control mechanism.
- *
- * @param $name
- * The name of an event.
- * @param $window
- * Optional number of seconds before this event expires. Defaults to 3600 (1
- * hour). Typically uses the same value as the flood_is_allowed() $window
- * parameter. Expired events are purged on cron run to prevent the flood table
- * from growing indefinitely.
- * @param $identifier
- * Optional identifier (defaults to the current user's IP address).
- */
-function flood_register_event($name, $window = 3600, $identifier = NULL) {
- if (!isset($identifier)) {
- $identifier = ip_address();
- }
- db_insert('flood')
- ->fields(array(
- 'event' => $name,
- 'identifier' => $identifier,
- 'timestamp' => REQUEST_TIME,
- 'expiration' => REQUEST_TIME + $window,
- ))
- ->execute();
-}
-
-/**
- * Make the flood control mechanism forget about an event for the current visitor.
- *
- * @param $name
- * The name of an event.
- * @param $identifier
- * Optional identifier (defaults to the current user's IP address).
- */
-function flood_clear_event($name, $identifier = NULL) {
- if (!isset($identifier)) {
- $identifier = ip_address();
- }
- db_delete('flood')
- ->condition('event', $name)
- ->condition('identifier', $identifier)
- ->execute();
-}
-
-/**
- * Checks whether user is allowed to proceed with the specified event.
- *
- * Events can have thresholds saying that each user can only do that event
- * a certain number of times in a time window. This function verifies that the
- * current user has not exceeded this threshold.
- *
- * @param $name
- * The unique name of the event.
- * @param $threshold
- * The maximum number of times each user can do this event per time window.
- * @param $window
- * Number of seconds in the time window for this event (default is 3600
- * seconds, or 1 hour).
- * @param $identifier
- * Unique identifier of the current user. Defaults to their IP address.
- *
- * @return
- * TRUE if the user is allowed to proceed. FALSE if they have exceeded the
- * threshold and should not be allowed to proceed.
- */
-function flood_is_allowed($name, $threshold, $window = 3600, $identifier = NULL) {
- if (!isset($identifier)) {
- $identifier = ip_address();
- }
- $number = db_query("SELECT COUNT(*) FROM {flood} WHERE event = :event AND identifier = :identifier AND timestamp > :timestamp", array(
- ':event' => $name,
- ':identifier' => $identifier,
- ':timestamp' => REQUEST_TIME - $window))
- ->fetchField();
- return ($number < $threshold);
-}
-
-/**
- * @defgroup sanitization Sanitization functions
- * @{
- * Functions to sanitize values.
- *
- * See http://drupal.org/writing-secure-code for information
- * on writing secure code.
- */
-
-/**
- * Strips dangerous protocols (e.g. 'javascript:') from a URI.
- *
- * This function must be called for all URIs within user-entered input prior
- * to being output to an HTML attribute value. It is often called as part of
- * check_url() or filter_xss(), but those functions return an HTML-encoded
- * string, so this function can be called independently when the output needs to
- * be a plain-text string for passing to t(), l(), drupal_attributes(), or
- * another function that will call check_plain() separately.
- *
- * @param $uri
- * A plain-text URI that might contain dangerous protocols.
- *
- * @return
- * A plain-text URI stripped of dangerous protocols. As with all plain-text
- * strings, this return value must not be output to an HTML page without
- * check_plain() being called on it. However, it can be passed to functions
- * expecting plain-text strings.
- *
- * @see check_url()
- */
-function drupal_strip_dangerous_protocols($uri) {
- static $allowed_protocols;
-
- if (!isset($allowed_protocols)) {
- $allowed_protocols = array_flip(variable_get('filter_allowed_protocols', array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'telnet', 'webcal')));
- }
-
- // Iteratively remove any invalid protocol found.
- do {
- $before = $uri;
- $colonpos = strpos($uri, ':');
- if ($colonpos > 0) {
- // We found a colon, possibly a protocol. Verify.
- $protocol = substr($uri, 0, $colonpos);
- // If a colon is preceded by a slash, question mark or hash, it cannot
- // possibly be part of the URL scheme. This must be a relative URL, which
- // inherits the (safe) protocol of the base document.
- if (preg_match('![/?#]!', $protocol)) {
- break;
- }
- // Check if this is a disallowed protocol. Per RFC2616, section 3.2.3
- // (URI Comparison) scheme comparison must be case-insensitive.
- if (!isset($allowed_protocols[strtolower($protocol)])) {
- $uri = substr($uri, $colonpos + 1);
- }
- }
- } while ($before != $uri);
-
- return $uri;
-}
-
-/**
- * Strips dangerous protocols (e.g. 'javascript:') from a URI and encodes it for output to an HTML attribute value.
- *
- * @param $uri
- * A plain-text URI that might contain dangerous protocols.
- *
- * @return
- * A URI stripped of dangerous protocols and encoded for output to an HTML
- * attribute value. Because it is already encoded, it should not be set as a
- * value within a $attributes array passed to drupal_attributes(), because
- * drupal_attributes() expects those values to be plain-text strings. To pass
- * a filtered URI to drupal_attributes(), call
- * drupal_strip_dangerous_protocols() instead.
- *
- * @see drupal_strip_dangerous_protocols()
- */
-function check_url($uri) {
- return check_plain(drupal_strip_dangerous_protocols($uri));
-}
-
-/**
- * Very permissive XSS/HTML filter for admin-only use.
- *
- * Use only for fields where it is impractical to use the
- * whole filter system, but where some (mainly inline) mark-up
- * is desired (so check_plain() is not acceptable).
- *
- * Allows all tags that can be used inside an HTML body, save
- * for scripts and styles.
- */
-function filter_xss_admin($string) {
- return filter_xss($string, array('a', 'abbr', 'acronym', 'address', 'b', 'bdo', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'ins', 'kbd', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'));
-}
-
-/**
- * Filters an HTML string to prevent cross-site-scripting (XSS) vulnerabilities.
- *
- * Based on kses by Ulf Harnhammar, see http://sourceforge.net/projects/kses.
- * For examples of various XSS attacks, see: http://ha.ckers.org/xss.html.
- *
- * This code does four things:
- * - Removes characters and constructs that can trick browsers.
- * - Makes sure all HTML entities are well-formed.
- * - Makes sure all HTML tags and attributes are well-formed.
- * - Makes sure no HTML tags contain URLs with a disallowed protocol (e.g.
- * javascript:).
- *
- * @param $string
- * The string with raw HTML in it. It will be stripped of everything that can
- * cause an XSS attack.
- * @param $allowed_tags
- * An array of allowed tags.
- *
- * @return
- * An XSS safe version of $string, or an empty string if $string is not
- * valid UTF-8.
- *
- * @see drupal_validate_utf8()
- * @ingroup sanitization
- */
-function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {
- // Only operate on valid UTF-8 strings. This is necessary to prevent cross
- // site scripting issues on Internet Explorer 6.
- if (!drupal_validate_utf8($string)) {
- return '';
- }
- // Store the text format
- _filter_xss_split($allowed_tags, TRUE);
- // Remove NULL characters (ignored by some browsers)
- $string = str_replace(chr(0), '', $string);
- // Remove Netscape 4 JS entities
- $string = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);
-
- // Defuse all HTML entities
- $string = str_replace('&', '&amp;', $string);
- // Change back only well-formed entities in our whitelist
- // Decimal numeric entities
- $string = preg_replace('/&amp;#([0-9]+;)/', '&#\1', $string);
- // Hexadecimal numeric entities
- $string = preg_replace('/&amp;#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\1', $string);
- // Named entities
- $string = preg_replace('/&amp;([A-Za-z][A-Za-z0-9]*;)/', '&\1', $string);
-
- return preg_replace_callback('%
- (
- <(?=[^a-zA-Z!/]) # a lone <
- | # or
- <[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string
- | # or
- > # just a >
- )%x', '_filter_xss_split', $string);
-}
-
-/**
- * Processes an HTML tag.
- *
- * @param $m
- * An array with various meaning depending on the value of $store.
- * If $store is TRUE then the array contains the allowed tags.
- * If $store is FALSE then the array has one element, the HTML tag to process.
- * @param $store
- * Whether to store $m.
- * @return
- * If the element isn't allowed, an empty string. Otherwise, the cleaned up
- * version of the HTML element.
- */
-function _filter_xss_split($m, $store = FALSE) {
- static $allowed_html;
-
- if ($store) {
- $allowed_html = array_flip($m);
- return;
- }
-
- $string = $m[1];
-
- if (substr($string, 0, 1) != '<') {
- // We matched a lone ">" character
- return '&gt;';
- }
- elseif (strlen($string) == 1) {
- // We matched a lone "<" character
- return '&lt;';
- }
-
- if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches)) {
- // Seriously malformed
- return '';
- }
-
- $slash = trim($matches[1]);
- $elem = &$matches[2];
- $attrlist = &$matches[3];
-
- if (!isset($allowed_html[strtolower($elem)])) {
- // Disallowed HTML element
- return '';
- }
-
- if ($slash != '') {
- return "</$elem>";
- }
-
- // Is there a closing XHTML slash at the end of the attributes?
- $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist, -1, $count);
- $xhtml_slash = $count ? ' /' : '';
-
- // Clean up attributes
- $attr2 = implode(' ', _filter_xss_attributes($attrlist));
- $attr2 = preg_replace('/[<>]/', '', $attr2);
- $attr2 = strlen($attr2) ? ' ' . $attr2 : '';
-
- return "<$elem$attr2$xhtml_slash>";
-}
-
-/**
- * Processes a string of HTML attributes.
- *
- * @return
- * Cleaned up version of the HTML attributes.
- */
-function _filter_xss_attributes($attr) {
- $attrarr = array();
- $mode = 0;
- $attrname = '';
-
- while (strlen($attr) != 0) {
- // Was the last operation successful?
- $working = 0;
-
- switch ($mode) {
- case 0:
- // Attribute name, href for instance
- if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {
- $attrname = strtolower($match[1]);
- $skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');
- $working = $mode = 1;
- $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr);
- }
- break;
-
- case 1:
- // Equals sign or valueless ("selected")
- if (preg_match('/^\s*=\s*/', $attr)) {
- $working = 1; $mode = 2;
- $attr = preg_replace('/^\s*=\s*/', '', $attr);
- break;
- }
-
- if (preg_match('/^\s+/', $attr)) {
- $working = 1; $mode = 0;
- if (!$skip) {
- $attrarr[] = $attrname;
- }
- $attr = preg_replace('/^\s+/', '', $attr);
- }
- break;
-
- case 2:
- // Attribute value, a URL after href= for instance
- if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) {
- $thisval = filter_xss_bad_protocol($match[1]);
-
- if (!$skip) {
- $attrarr[] = "$attrname=\"$thisval\"";
- }
- $working = 1;
- $mode = 0;
- $attr = preg_replace('/^"[^"]*"(\s+|$)/', '', $attr);
- break;
- }
-
- if (preg_match("/^'([^']*)'(\s+|$)/", $attr, $match)) {
- $thisval = filter_xss_bad_protocol($match[1]);
-
- if (!$skip) {
- $attrarr[] = "$attrname='$thisval'";
- }
- $working = 1; $mode = 0;
- $attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr);
- break;
- }
-
- if (preg_match("%^([^\s\"']+)(\s+|$)%", $attr, $match)) {
- $thisval = filter_xss_bad_protocol($match[1]);
-
- if (!$skip) {
- $attrarr[] = "$attrname=\"$thisval\"";
- }
- $working = 1; $mode = 0;
- $attr = preg_replace("%^[^\s\"']+(\s+|$)%", '', $attr);
- }
- break;
- }
-
- if ($working == 0) {
- // not well formed, remove and try again
- $attr = preg_replace('/
- ^
- (
- "[^"]*("|$) # - a string that starts with a double quote, up until the next double quote or the end of the string
- | # or
- \'[^\']*(\'|$)| # - a string that starts with a quote, up until the next quote or the end of the string
- | # or
- \S # - a non-whitespace character
- )* # any number of the above three
- \s* # any number of whitespaces
- /x', '', $attr);
- $mode = 0;
- }
- }
-
- // The attribute list ends with a valueless attribute like "selected".
- if ($mode == 1 && !$skip) {
- $attrarr[] = $attrname;
- }
- return $attrarr;
-}
-
-/**
- * Processes an HTML attribute value and ensures it does not contain an URL with a disallowed protocol (e.g. javascript:).
- *
- * @param $string
- * The string with the attribute value.
- * @param $decode
- * (Deprecated) Whether to decode entities in the $string. Set to FALSE if the
- * $string is in plain text, TRUE otherwise. Defaults to TRUE. This parameter
- * is deprecated and will be removed in Drupal 8. To process a plain-text URI,
- * call drupal_strip_dangerous_protocols() or check_url() instead.
- * @return
- * Cleaned up and HTML-escaped version of $string.
- */
-function filter_xss_bad_protocol($string, $decode = TRUE) {
- // Get the plain text representation of the attribute value (i.e. its meaning).
- // @todo Remove the $decode parameter in Drupal 8, and always assume an HTML
- // string that needs decoding.
- if ($decode) {
- $string = decode_entities($string);
- }
- return check_plain(drupal_strip_dangerous_protocols($string));
-}
-
-/**
- * @} End of "defgroup sanitization".
- */
-
-/**
- * @defgroup format Formatting
- * @{
- * Functions to format numbers, strings, dates, etc.
- */
-
-/**
- * Formats an RSS channel.
- *
- * Arbitrary elements may be added using the $args associative array.
- */
-function format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) {
- global $language_content;
- $langcode = $langcode ? $langcode : $language_content->language;
-
- $output = "<channel>\n";
- $output .= ' <title>' . check_plain($title) . "</title>\n";
- $output .= ' <link>' . check_url($link) . "</link>\n";
-
- // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
- // We strip all HTML tags, but need to prevent double encoding from properly
- // escaped source data (such as &amp becoming &amp;amp;).
- $output .= ' <description>' . check_plain(decode_entities(strip_tags($description))) . "</description>\n";
- $output .= ' <language>' . check_plain($langcode) . "</language>\n";
- $output .= format_xml_elements($args);
- $output .= $items;
- $output .= "</channel>\n";
-
- return $output;
-}
-
-/**
- * Format a single RSS item.
- *
- * Arbitrary elements may be added using the $args associative array.
- */
-function format_rss_item($title, $link, $description, $args = array()) {
- $output = "<item>\n";
- $output .= ' <title>' . check_plain($title) . "</title>\n";
- $output .= ' <link>' . check_url($link) . "</link>\n";
- $output .= ' <description>' . check_plain($description) . "</description>\n";
- $output .= format_xml_elements($args);
- $output .= "</item>\n";
-
- return $output;
-}
-
-/**
- * Format XML elements.
- *
- * @param $array
- * An array where each item represent an element and is either a:
- * - (key => value) pair (<key>value</key>)
- * - Associative array with fields:
- * - 'key': element name
- * - 'value': element contents
- * - 'attributes': associative array of element attributes
- *
- * In both cases, 'value' can be a simple string, or it can be another array
- * with the same format as $array itself for nesting.
- */
-function format_xml_elements($array) {
- $output = '';
- foreach ($array as $key => $value) {
- if (is_numeric($key)) {
- if ($value['key']) {
- $output .= ' <' . $value['key'];
- if (isset($value['attributes']) && is_array($value['attributes'])) {
- $output .= drupal_attributes($value['attributes']);
- }
-
- if (isset($value['value']) && $value['value'] != '') {
- $output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) . '</' . $value['key'] . ">\n";
- }
- else {
- $output .= " />\n";
- }
- }
- }
- else {
- $output .= ' <' . $key . '>' . (is_array($value) ? format_xml_elements($value) : check_plain($value)) . "</$key>\n";
- }
- }
- return $output;
-}
-
-/**
- * Format a string containing a count of items.
- *
- * This function ensures that the string is pluralized correctly. Since t() is
- * called by this function, make sure not to pass already-localized strings to
- * it.
- *
- * For example:
- * @code
- * $output = format_plural($node->comment_count, '1 comment', '@count comments');
- * @endcode
- *
- * Example with additional replacements:
- * @code
- * $output = format_plural($update_count,
- * 'Changed the content type of 1 post from %old-type to %new-type.',
- * 'Changed the content type of @count posts from %old-type to %new-type.',
- * array('%old-type' => $info->old_type, '%new-type' => $info->new_type)));
- * @endcode
- *
- * @param $count
- * The item count to display.
- * @param $singular
- * The string for the singular case. Please make sure it is clear this is
- * singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
- * Do not use @count in the singular string.
- * @param $plural
- * The string for the plural case. Please make sure it is clear this is plural,
- * to ease translation. Use @count in place of the item count, as in "@count
- * new comments".
- * @param $args
- * An associative array of replacements to make after translation. Incidences
- * of any key in this array are replaced with the corresponding value.
- * Based on the first character of the key, the value is escaped and/or themed:
- * - !variable: inserted as is
- * - @variable: escape plain text to HTML (check_plain)
- * - %variable: escape text and theme as a placeholder for user-submitted
- * content (check_plain + theme_placeholder)
- * Note that you do not need to include @count in this array.
- * This replacement is done automatically for the plural case.
- * @param $options
- * An associative array of additional options, with the following keys:
- * - 'langcode' (default to the current language) The language code to
- * translate to a language other than what is used to display the page.
- * - 'context' (default to the empty context) The context the source string
- * belongs to.
- * @return
- * A translated string.
- */
-function format_plural($count, $singular, $plural, array $args = array(), array $options = array()) {
- $args['@count'] = $count;
- if ($count == 1) {
- return t($singular, $args, $options);
- }
-
- // Get the plural index through the gettext formula.
- $index = (function_exists('locale_get_plural')) ? locale_get_plural($count, isset($options['langcode']) ? $options['langcode'] : NULL) : -1;
- // Backwards compatibility.
- if ($index < 0) {
- return t($plural, $args, $options);
- }
- else {
- switch ($index) {
- case "0":
- return t($singular, $args, $options);
- case "1":
- return t($plural, $args, $options);
- default:
- unset($args['@count']);
- $args['@count[' . $index . ']'] = $count;
- return t(strtr($plural, array('@count' => '@count[' . $index . ']')), $args, $options);
- }
- }
-}
-
-/**
- * Parse a given byte count.
- *
- * @param $size
- * A size expressed as a number of bytes with optional SI or IEC binary unit
- * prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).
- * @return
- * An integer representation of the size in bytes.
- */
-function parse_size($size) {
- $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
- $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
- if ($unit) {
- // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
- return round($size * pow(DRUPAL_KILOBYTE, stripos('bkmgtpezy', $unit[0])));
- }
- else {
- return round($size);
- }
-}
-
-/**
- * Generate a string representation for the given byte count.
- *
- * @param $size
- * A size in bytes.
- * @param $langcode
- * Optional language code to translate to a language other than what is used
- * to display the page.
- * @return
- * A translated string representation of the size.
- */
-function format_size($size, $langcode = NULL) {
- if ($size < DRUPAL_KILOBYTE) {
- return format_plural($size, '1 byte', '@count bytes', array(), array('langcode' => $langcode));
- }
- else {
- $size = $size / DRUPAL_KILOBYTE; // Convert bytes to kilobytes.
- $units = array(
- t('@size KB', array(), array('langcode' => $langcode)),
- t('@size MB', array(), array('langcode' => $langcode)),
- t('@size GB', array(), array('langcode' => $langcode)),
- t('@size TB', array(), array('langcode' => $langcode)),
- t('@size PB', array(), array('langcode' => $langcode)),
- t('@size EB', array(), array('langcode' => $langcode)),
- t('@size ZB', array(), array('langcode' => $langcode)),
- t('@size YB', array(), array('langcode' => $langcode)),
- );
- foreach ($units as $unit) {
- if (round($size, 2) >= DRUPAL_KILOBYTE) {
- $size = $size / DRUPAL_KILOBYTE;
- }
- else {
- break;
- }
- }
- return str_replace('@size', round($size, 2), $unit);
- }
-}
-
-/**
- * Format a time interval with the requested granularity.
- *
- * @param $timestamp
- * The length of the interval in seconds.
- * @param $granularity
- * How many different units to display in the string.
- * @param $langcode
- * Optional language code to translate to a language other than
- * what is used to display the page.
- * @return
- * A translated string representation of the interval.
- */
-function format_interval($timestamp, $granularity = 2, $langcode = NULL) {
- $units = array(
- '1 year|@count years' => 31536000,
- '1 month|@count months' => 2592000,
- '1 week|@count weeks' => 604800,
- '1 day|@count days' => 86400,
- '1 hour|@count hours' => 3600,
- '1 min|@count min' => 60,
- '1 sec|@count sec' => 1
- );
- $output = '';
- foreach ($units as $key => $value) {
- $key = explode('|', $key);
- if ($timestamp >= $value) {
- $output .= ($output ? ' ' : '') . format_plural(floor($timestamp / $value), $key[0], $key[1], array(), array('langcode' => $langcode));
- $timestamp %= $value;
- $granularity--;
- }
-
- if ($granularity == 0) {
- break;
- }
- }
- return $output ? $output : t('0 sec', array(), array('langcode' => $langcode));
-}
-
-/**
- * Format a date with the given configured format or a custom format string.
- *
- * Drupal allows administrators to select formatting strings for 'short',
- * 'medium' and 'long' date formats. This function can handle these formats,
- * as well as any custom format.
- *
- * @param $timestamp
- * The exact date to format, as a UNIX timestamp.
- * @param $type
- * The format to use. Can be "short", "medium" or "long" for the preconfigured
- * date formats. If "custom" is specified, then $format is required as well.
- * @param $format
- * A PHP date format string as required by date(). A backslash should be used
- * before a character to avoid interpreting the character as part of a date
- * format.
- * @param $timezone
- * Time zone identifier; if omitted, the user's time zone is used.
- * @param $langcode
- * Optional language code to translate to a language other than what is used
- * to display the page.
- * @return
- * A translated date string in the requested format.
- */
-function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
- // Use the advanced drupal_static() pattern, since this is called very often.
- static $drupal_static_fast;
- if (!isset($drupal_static_fast)) {
- $drupal_static_fast['timezones'] = &drupal_static(__FUNCTION__);
- }
- $timezones = &$drupal_static_fast['timezones'];
-
- if (!isset($timezone)) {
- $timezone = date_default_timezone_get();
- }
- // Store DateTimeZone objects in an array rather than repeatedly
- // constructing identical objects over the life of a request.
- if (!isset($timezones[$timezone])) {
- $timezones[$timezone] = timezone_open($timezone);
- }
-
- // Use the default langcode if none is set.
- global $language;
- if (empty($langcode)) {
- $langcode = isset($language->language) ? $language->language : 'en';
- }
-
- switch ($type) {
- case 'short':
- $format = variable_get('date_format_short', 'm/d/Y - H:i');
- break;
- case 'long':
- $format = variable_get('date_format_long', 'l, F j, Y - H:i');
- break;
- case 'custom':
- // No change to format.
- break;
- case 'medium':
- default:
- $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
- }
-
- // Create a DateTime object from the timestamp.
- $date_time = date_create('@' . $timestamp);
- // Set the time zone for the DateTime object.
- date_timezone_set($date_time, $timezones[$timezone]);
-
- // Encode markers that should be translated. 'A' becomes '\xEF\AA\xFF'.
- // xEF and xFF are invalid UTF-8 sequences, and we assume they are not in the
- // input string.
- // Paired backslashes are isolated to prevent errors in read-ahead evaluation.
- // The read-ahead expression ensures that A matches, but not \A.
- $format = preg_replace(array('/\\\\\\\\/', '/(?<!\\\\)([AaeDlMTF])/'), array("\xEF\\\\\\\\\xFF", "\xEF\\\\\$1\$1\xFF"), $format);
-
- // Call date_format().
- $format = date_format($date_time, $format);
-
- // Pass the langcode to _format_date_callback().
- _format_date_callback(NULL, $langcode);
-
- // Translate the marked sequences.
- return preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
-}
-
-/**
- * Returns an ISO8601 formatted date based on the given date.
- *
- * Can be used as a callback for RDF mappings.
- *
- * @param $date
- * A UNIX timestamp.
- * @return string
- * An ISO8601 formatted date.
- */
-function date_iso8601($date) {
- // The DATE_ISO8601 constant cannot be used here because it does not match
- // date('c') and produces invalid RDF markup.
- return date('c', $date);
-}
-
-/**
- * Callback function for preg_replace_callback().
- */
-function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
- // We cache translations to avoid redundant and rather costly calls to t().
- static $cache, $langcode;
-
- if (!isset($matches)) {
- $langcode = $new_langcode;
- return;
- }
-
- $code = $matches[1];
- $string = $matches[2];
-
- if (!isset($cache[$langcode][$code][$string])) {
- $options = array(
- 'langcode' => $langcode,
- );
-
- if ($code == 'F') {
- $options['context'] = 'Long month name';
- }
-
- if ($code == '') {
- $cache[$langcode][$code][$string] = $string;
- }
- else {
- $cache[$langcode][$code][$string] = t($string, array(), $options);
- }
- }
- return $cache[$langcode][$code][$string];
-}
-
-/**
- * Format a username.
- *
- * By default, the passed in object's 'name' property is used if it exists, or
- * else, the site-defined value for the 'anonymous' variable. However, a module
- * may override this by implementing hook_username_alter(&$name, $account).
- *
- * @see hook_username_alter()
- *
- * @param $account
- * The account object for the user whose name is to be formatted.
- *
- * @return
- * An unsanitized string with the username to display. The code receiving
- * this result must ensure that check_plain() is called on it before it is
- * printed to the page.
- */
-function format_username($account) {
- $name = !empty($account->name) ? $account->name : variable_get('anonymous', t('Anonymous'));
- drupal_alter('username', $name, $account);
- return $name;
-}
-
-/**
- * @} End of "defgroup format".
- */
-
-/**
- * Generates an internal or external URL.
- *
- * When creating links in modules, consider whether l() could be a better
- * alternative than url().
- *
- * @param $path
- * The internal path or external URL being linked to, such as "node/34" or
- * "http://example.com/foo". A few notes:
- * - If you provide a full URL, it will be considered an external URL.
- * - If you provide only the path (e.g. "node/34"), it will be
- * considered an internal link. In this case, it should be a system URL,
- * and it will be replaced with the alias, if one exists. Additional query
- * arguments for internal paths must be supplied in $options['query'], not
- * included in $path.
- * - If you provide an internal path and $options['alias'] is set to TRUE, the
- * path is assumed already to be the correct path alias, and the alias is
- * not looked up.
- * - The special string '<front>' generates a link to the site's base URL.
- * - If your external URL contains a query (e.g. http://example.com/foo?a=b),
- * then you can either URL encode the query keys and values yourself and
- * include them in $path, or use $options['query'] to let this function
- * URL encode them.
- * @param $options
- * An associative array of additional options, with the following elements:
- * - 'query': An array of query key/value-pairs (without any URL-encoding) to
- * append to the URL.
- * - 'fragment': A fragment identifier (named anchor) to append to the URL.
- * Do not include the leading '#' character.
- * - 'absolute': Defaults to FALSE. Whether to force the out