Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • develop
  • master
  • topics/add-contribution-info
  • master-no-logins
  • issue-424
  • svn-trunk
  • svn-staging
  • svn-testing
  • 2010-11-11
  • 2010-12-15
  • 2011-01-11
  • 2011-01-18
  • 2011-01-26
  • 2011-02-10
  • 2011-02-23
  • 2011-03-09
  • 2011-03-15
  • 2011-03-30
  • 2011-04-05
  • 2011-05-03
  • 2011-05-12
  • 2011-06-16
  • 2011-06-21
  • 2011-06-23
  • 2011-06-29
  • 2011-06-30
  • 2011-07-11
  • 2011-07-18
  • 2011-07-20
  • 2011-07-21
  • 2011-07-28
  • 2011-08-03
  • 2011-08-05
  • 2011-08-15
  • 2011-08-17
  • 2011-08-29
  • 2011-08-30
  • 2011-09-19
  • 2011-10-03
  • 2011-10-06
  • 2011-10-27
  • 2011-11-01
  • 2011-11-08
  • 2011-11-08.2
  • 2011-11-14
  • 2011-11-17
  • 2011-12-05
  • 2011-12-16
  • 2012-01-12
  • 2012-01-13
  • 2012-02-07
  • 2012-03-01
  • 2012-04-02
  • 2012-04-03
  • 2012-04-18
  • 20120207
  • 7.1
  • 7.10
  • 7.11
  • 7.12
  • 7.13
  • 7.14
  • 7.15
  • 7.16
  • 7.16.1
  • 7.17
  • 7.18
  • 7.19
  • 7.2
  • 7.3
  • 7.3.1
  • 7.4
  • 7.5
  • 7.5.1
  • 7.6
  • 7.6.1
  • 7.7
  • 7.7.1
  • 7.7.2
  • 7.7.3
  • 7.8
  • 7.9
82 results

Target

Select target project
  • Ryan Klusman / UNL-CMS
  • yzha1 / UNL-CMS
  • PHP Extension & Application Repository / UNL-CMS
  • Brett Bieber / UNL-CMS
  • Tim Steiner / UNL-CMS
  • Eric Rasmussen / UNL-CMS
  • UNL Information Services / UNL-CMS
7 results
Select Git revision
  • issue-525
  • develop
  • topics/add-contribution-info
  • master
  • master-no-logins
  • issue-424
  • svn-trunk
  • svn-staging
  • svn-testing
  • 2010-11-11
  • 2010-12-15
  • 2011-01-11
  • 2011-01-18
  • 2011-01-26
  • 2011-02-10
  • 2011-02-23
  • 2011-03-09
  • 2011-03-15
  • 2011-03-30
  • 2011-04-05
  • 2011-05-03
  • 2011-05-12
  • 2011-06-16
  • 2011-06-21
  • 2011-06-23
  • 2011-06-29
  • 2011-06-30
  • 2011-07-11
  • 2011-07-18
  • 2011-07-20
  • 2011-07-21
  • 2011-07-28
  • 2011-08-03
  • 2011-08-05
  • 2011-08-15
  • 2011-08-17
  • 2011-08-29
  • 2011-08-30
  • 2011-09-19
  • 2011-10-03
  • 2011-10-06
  • 2011-10-27
  • 2011-11-01
  • 2011-11-08
  • 2011-11-08.2
  • 2011-11-14
  • 2011-11-17
  • 2011-12-05
  • 2011-12-16
  • 2012-01-12
  • 2012-01-13
  • 2012-02-07
  • 2012-03-01
  • 2012-04-02
  • 2012-04-03
  • 2012-04-18
  • 20120207
  • 7.1
  • 7.2
  • 7.3
  • 7.3.1
  • 7.4
  • 7.5
  • 7.5.1
  • 7.6
  • 7.6.1
66 results
Show changes
1000 files
+ 69819
17619
Compare changes
  • Side-by-side
  • Inline

Files

.gitignore

0 → 100644
+19 −0
Original line number Original line Diff line number Diff line
.htaccess
.htaccess-subsite-map.txt
sites/sites.php
sites/*/
!sites/all/
!sites/default/
sites/all/settings.php
sites/default/files
sites/default/settings.php

.buildpath
.project
.settings
.settings/*

/sites/all/themes/explore_center
/resetunlcms.sh
/UNL_CMS.sublime-project
/UNL_CMS.sublime-workspace
 No newline at end of file

.gitmodules

0 → 100644
+18 −0
Original line number Original line Diff line number Diff line
[submodule "vendor/WDN-TinyMCE"]
  path = vendor/WDN-TinyMCE
  url = git@github.unl.edu:iim/TinyMCE.git
[submodule "vendor/NmcFramework"]
  path = vendor/NmcFramework
  url = git@github.unl.edu:UNL-Information-Services/NMC-PHP-Framework.git
[submodule "sites/all/modules/diff"]
  path = sites/all/modules/diff
  url = http://git.drupal.org/project/diff.git
[submodule "sites/all/modules/tims"]
  path = sites/all/modules/tims
  url = https://github.com/unlcms/tims.git
[submodule "vendor/Twig"]
	path = vendor/Twig
	url = https://github.com/fabpot/Twig.git
[submodule "sites/all/themes/unl_og"]
	path = sites/all/themes/unl_og
	url = git@github.com:unlcms/unl_og.git
+5 −0
Original line number Original line Diff line number Diff line
# This file is automatically generated.
# Do not edit it unless you know what you are doing!

# %UNL_CREATION_TOOL_STUB%
+33 −19
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
#
#


# Protect files and directories from prying eyes.
# 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)$">
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(|~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
  Order allow,deny
  Order allow,deny
</FilesMatch>
</FilesMatch>


@@ -16,12 +16,6 @@ Options +FollowSymLinks
# Make Drupal handle any 404 errors.
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
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.
# Set the default handler.
DirectoryIndex index.php index.html index.htm
DirectoryIndex index.php index.html index.htm


@@ -62,15 +56,29 @@ DirectoryIndex index.php index.html index.htm
<IfModule mod_rewrite.c>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteEngine on


  # THIS SECTION IS AUTOMATICALY GENERATED.
  # Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

  # THIS SECTION IS FOR UNL SUBSITES
  # DO NOT EDIT!!!!
  # DO NOT EDIT!!!!


  # Add the following line to your httpd.conf
  # RewriteMap drupal_subsites txt:<DRUPAL_ROOT>/.htaccess-subsite-map.txt
  # Do not uncomment the previous line.

  RewriteRule .*/cron.php cron.php
  RewriteRule .*/cron.php cron.php
  RewriteRule .*/update.php update.php
  RewriteRule .*/update.php update.php
  RewriteRule ^(.*?/(misc|modules|sites|themes))(.*) ${drupal_subsites:$1|$1}$3


  # %UNL_CREATION_TOOL_STUB%
  RewriteCond ${drupal_subsites://%{HTTP_HOST}%{REQUEST_URI}|NOT_FOUND} !^NOT_FOUND$
  RewriteRule (.*) ${drupal_subsites://%{HTTP_HOST}%{REQUEST_URI}|$1} [R,L]

  # END SUBSITE AREA.


  # END AUTOMATICALLY GENERATED AREA.


  # Block access to "hidden" directories whose names begin with a period. This
  # Block access to "hidden" directories whose names begin with a period. This
  # includes directories used by version control systems such as Subversion or
  # includes directories used by version control systems such as Subversion or
@@ -94,14 +102,15 @@ DirectoryIndex index.php index.html index.htm
  # To redirect all users to access the site WITH the 'www.' prefix,
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} .
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
  # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]


  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # VirtualDocumentRoot and the rewrite rules are not working properly.
@@ -113,6 +122,13 @@ DirectoryIndex index.php index.html index.htm
  # uncomment the following line:
  # uncomment the following line:
  # RewriteBase /
  # RewriteBase /


  # Allow public files to be accessed without the sites/<site_dir>/files prefix
  # The following line must be added to your apache configuration for this context:
  # RewriteMap drupal prg:<DRUPAL_ROOT>/rewrite.php
  # Do not uncomment the previous line.  Only the next two.
  # RewriteCond %{REQUEST_FILENAME} !-f
  # RewriteRule (.*) ${drupal:%{HTTP_HOST};delim;%{REQUEST_URI};delim;$1}

  # Pass all requests not referring directly to files in the filesystem to
  # Pass all requests not referring directly to files in the filesystem to
  # index.php. Clean URLs are handled in drupal_environment_initialize().
  # index.php. Clean URLs are handled in drupal_environment_initialize().
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-f
@@ -139,11 +155,9 @@ DirectoryIndex index.php index.html index.htm


    <FilesMatch "(\.js\.gz|\.css\.gz)$">
    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      # Serve correct encoding type.
      Header append Content-Encoding gzip
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
      Header append Vary Accept-Encoding
    </FilesMatch>
    </FilesMatch>
  </IfModule>
  </IfModule>
</IfModule>
</IfModule>

# $Id: .htaccess,v 1.110 2010/10/11 23:49:48 dries Exp $
+684 −14

File changed.

Preview size limit exceeded, changes collapsed.

+24 −5
Original line number Original line Diff line number Diff line
// $Id: COPYRIGHT.txt,v 1.6 2010/01/02 10:20:21 dries Exp $
All Drupal code is Copyright 2001 - 2012 by the original authors.

All Drupal code is Copyright 2001 - 2010 by the original authors.


This program is free software; you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
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
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -21,5 +20,25 @@ Drupal includes works under other copyright notices and distributed
according to the terms of the GNU General Public License or a compatible
according to the terms of the GNU General Public License or a compatible
license, including:
license, including:


  jQuery - Copyright (c) 2008 - 2009 John Resig
Javascript

  Farbtastic - Copyright (c) 2010 Matt Farina

  jQuery - Copyright (c) 2010 John Resig

  jQuery BBQ - Copyright (c) 2010 "Cowboy" Ben Alman

  jQuery Cookie - Copyright (c) 2006 Klaus Hartl

  jQuery Form - Copyright (c) 2010 Mike Alsup

  jQuery Once - Copyright (c) 2009 Konstantin K�fer

  jQuery UI - Copyright (c) 2010 by the original authors
    (http://jqueryui.com/about)

  Sizzle.js - Copyright (c) 2010 The Dojo Foundation (http://sizzlejs.com/)

PHP


  ArchiveTar - Copyright (c) 1997 - 2008 Vincent Blavet
+5 −6
Original line number Original line Diff line number Diff line
// $Id: INSTALL.mysql.txt,v 1.12 2010/01/11 16:25:15 webchick Exp $


CREATE THE MySQL DATABASE
CREATE THE MySQL DATABASE
--------------------------
--------------------------


This step is only necessary if you don't already have a database set-up (e.g. by
This step is only necessary if you don't already have a database set up (e.g.,
your host). In the following examples, 'username' is an example MySQL user which
by your host). In the following examples, 'username' is an example MySQL user
has the CREATE and GRANT privileges. Use the appropriate user name for your
which has the CREATE and GRANT privileges. Use the appropriate user name for
system.
your system.


First, you must create a new database for your Drupal site (here, 'databasename'
First, you must create a new database for your Drupal site (here, 'databasename'
is the name of the new database):
is the name of the new database):
@@ -19,7 +18,7 @@ initial database files. Next you must log in and set the access database rights:
  mysql -u username -p
  mysql -u username -p


Again, you will be asked for the 'username' database password. At the MySQL
Again, you will be asked for the 'username' database password. At the MySQL
prompt, enter following command:
prompt, enter the following command:


  GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
  GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
  ON databasename.*
  ON databasename.*
+24 −24
Original line number Original line Diff line number Diff line
// $Id: INSTALL.pgsql.txt,v 1.9 2010/04/07 15:07:58 dries Exp $


CREATE THE PostgreSQL DATABASE
CREATE THE PostgreSQL DATABASE
------------------------------
------------------------------
@@ -7,38 +6,39 @@ Note that the database must be created with UTF-8 (Unicode) encoding.


1. CREATE DATABASE USER
1. CREATE DATABASE USER


   This step is only necessary if you don't already have a user set up (e.g.
   This step is only necessary if you don't already have a user set up (e.g., by
   by your host) or you want to create new user for use with Drupal only. The
   your host), or want to create a new user for use with Drupal only. The
   following command creates a new user named "username" and asks for a
   following command creates a new user named 'username' and asks for a password
   password for that user:
   for that user:


     createuser --pwprompt --encrypted --no-createrole --no-createdb username
     createuser --pwprompt --encrypted --no-createrole --no-createdb username


   If there are no errors then the command was successful
   If there are no errors, then the command was successful.


2. CREATE THE DRUPAL DATABASE
2. CREATE DRUPAL DATABASE


   This step is only necessary if you don't already have a database set up (e.g.
   This step is only necessary if you don't already have a database set up
   by your host) or you want to create new database for use with Drupal only.
   (e.g., by your host) or want to create a new database for use with Drupal
   The following command creates a new database named "databasename", which is
   only. The following command creates a new database named 'databasename',
   owned by previously created "username":
   which is owned by the previously created 'username':


     createdb --encoding=UTF8 --owner=username databasename
     createdb --encoding=UTF8 --owner=username databasename


   If there are no errors then the command was successful
   If there are no errors, then the command was successful.


3. CREATE A SCHEMA OR SCHEMAS (Optional advanced)
3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)


   Drupal will run across different schemas within your database if you so wish.
   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
   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
   inside settings.php to define a schema for Drupal to run inside of, or
  that are shared inside of a separate schema. Drupal will not create schemas for
   specify tables that are shared inside of a separate schema. Drupal will not
  you, infact the user that Drupal runs as should not be allowed to. You'll need
   create schemas for you. In fact, the user that Drupal runs as should not be
  execute the SQL below as a superuser (such as a postgres user) and replace
   allowed to do this. You'll need to execute the SQL below as a superuser,
  'drupaluser' with the username that Drupal uses to connect to PostgreSQL with
   replace 'username' with the username that Drupal uses to connect to
  and replace schema_name with a schema name you wish to use such as 'shared':
   PostgreSQL, and replace 'schema_name' with a schema name you wish to use,

   such as 'shared':
    CREATE SCHEMA schema_name AUTHORIZATION drupaluser;


     CREATE SCHEMA schema_name AUTHORIZATION username;
  Do this for as many schemas as you need. See default.settings.php for how to

  set which tables use which schemas.
   Do this for as many schemas as you need. See default.settings.php for
   instructions on how to set which tables use which schemas.
+9 −15
Original line number Original line Diff line number Diff line
// $Id: INSTALL.sqlite.txt,v 1.3 2010/09/01 02:39:57 dries Exp $


SQLITE REQUIREMENTS
SQLITE REQUIREMENTS
-------------------
-------------------


To use SQLite with your Drupal installation, the following requirements must
To use SQLite with your Drupal installation, the following requirements must be
be met: server has PHP 5.2 or later with PDO, and the PDO SQLite driver must
met: Server has PHP 5.2 or later with PDO, and the PDO SQLite driver must be
be enabled.
enabled.


SQLITE DATABASE CREATION
SQLITE DATABASE CREATION
------------------------
------------------------


The Drupal installer will create the SQLite database for you. The only
The Drupal installer will create the SQLite database for you. The only
requirement is the installer must have write permissions the directory where
requirement is that the installer must have write permissions to the directory
the database file resides. This directory (not just the database file) also has
where the database file resides. This directory (not just the database file) also
to remain writeable by the web server going forward for SQLite to continue to be
has to remain writeable by the web server going forward for SQLite to continue to
able to operate.
be able to operate.


On the "Database configuration" form in the "Database name" field, you must
On the "Database configuration" form in the "Database file" field, you must
supply the exact path to where you wish your database file to reside. It is
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
strongly suggested that you choose a path that is outside of the webroot, yet
ensure that the directory is writeable by the web server.
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
If you must place your database file in your webroot, you could try using the
following in your "Database name" field:
following in your "Database file" field:


  sites/default/files/.ht.sqlite
  sites/default/files/.ht.sqlite


@@ -30,8 +29,3 @@ 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.
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
If not, please consult the documentation of your webserver on how to protect a
file from downloading.
file from downloading.

USERNAME, PASSWORD, and ADVANCED OPTIONS
----------------------------------------
No username, password, or advanced options are necessary, and they should not be
used.
+236 −237

File changed.

Preview size limit exceeded, changes collapsed.

+7 −8
Original line number Original line Diff line number Diff line
// $Id: LICENSE.txt,v 1.7 2009/01/26 14:08:40 dries Exp $
                    GNU GENERAL PUBLIC LICENSE
                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991
                       Version 2, June 1991


+123 −113
Original line number Original line Diff line number Diff line
// $Id: MAINTAINERS.txt,v 1.48 2010/09/30 13:28:08 dries Exp $

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.


Drupal core is built and maintained by the Drupal project community. Everyone is
encouraged to submit issues and changes (patches) to improve Drupal, and to
contribute in other ways -- see http://drupal.org/contribute to find out how.


Branch maintainers
Branch maintainers
------------------
------------------


Drupal 7
The Drupal Core branch maintainers oversee the development of Drupal as a whole.
- Dries Buytaert 'dries' <http://drupal.org/user/1>
The branch maintainers for Drupal 7 are:
- Angela Byron 'webchick' <http://drupal.org/user/24967>

- Dries Buytaert 'dries' http://drupal.org/user/1
- Angela Byron 'webchick' http://drupal.org/user/24967
- David Rothstein 'David_Rothstein' http://drupal.org/user/124982




Component maintainers
Component maintainers
---------------------
---------------------


AJAX system
The Drupal Core component maintainers oversee the development of Drupal
- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
subsystems. See http://drupal.org/contribute/core-maintainers for more
- Randy Fay 'rfay' <http://drupal.org/user/30906>
information on their responsibilities, and to find out how to become a component
- Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
maintainer. Current component maintainers for Drupal 7:

Ajax system
- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040
- Earl Miles 'merlinofchaos' http://drupal.org/user/26979


Base system
Base system
- Károly Négyesi 'chx' <http://drupal.org/user/9446>
- Károly Négyesi 'chx' http://drupal.org/user/9446
- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- Damien Tournoud 'DamZ' http://drupal.org/user/22211
- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23


Batch system
Batch system
- Yves Chedemois 'yched' <http://drupal.org/user/39567>
- Yves Chedemois 'yched' http://drupal.org/user/39567


Cache system
Cache system
- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- Damien Tournoud 'DamZ' http://drupal.org/user/22211
- Nathaniel Catchpole 'catch' http://drupal.org/user/35733


Cron system
Cron system
- Károly Négyesi 'chx' <http://drupal.org/user/9446>
- Károly Négyesi 'chx' http://drupal.org/user/9446
- Derek Wright 'dww' <http://drupal.org/user/46549>
- Derek Wright 'dww' http://drupal.org/user/46549


Database system
Database system
- Larry Garfield 'Crell' <http://drupal.org/user/26398>
- Larry Garfield 'Crell' http://drupal.org/user/26398


  - MySQL driver
  - MySQL driver
    - Larry Garfield 'Crell' <http://drupal.org/user/26398>
    - Larry Garfield 'Crell' http://drupal.org/user/26398
    - David Strauss 'David Strauss' <hhttp://drupal.org/user/93254>
    - David Strauss 'David Strauss' http://drupal.org/user/93254


  - PostgreSQL driver
  - PostgreSQL driver
    - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
    - Damien Tournoud 'DamZ' http://drupal.org/user/22211
    - Josh Waihi 'fiasco' <http://drupal.org/user/188162>
    - Josh Waihi 'fiasco' http://drupal.org/user/188162


  - Sqlite driver
  - Sqlite driver
    - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
    - Damien Tournoud 'DamZ' http://drupal.org/user/22211
    - Károly Négyesi 'chx' <http://drupal.org/user/9446>
    - Károly Négyesi 'chx' http://drupal.org/user/9446

Database update system
- Károly Négyesi 'chx' http://drupal.org/user/9446
- Ashok Modi 'BTMash' http://drupal.org/user/60422


Entity system
Entity system
- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
- Wolfgang Ziegler 'fago' http://drupal.org/user/16747
- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
- Nathaniel Catchpole 'catch' http://drupal.org/user/35733
- Franz Heinzmann 'Frando' http://drupal.org/user/21850


File system
File system
- Andrew Morton 'drewish' <http://drupal.org/user/34869>
- Andrew Morton 'drewish' http://drupal.org/user/34869
- Aaron Winborn 'aaron' <http://drupal.org/user/33420>
- Aaron Winborn 'aaron' http://drupal.org/user/33420


Form system
Form system
- Károly Négyesi 'chx' <http://drupal.org/user/9446>
- Károly Négyesi 'chx' http://drupal.org/user/9446
- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040
- Wolfgang Ziegler 'fago' <http://drupal.org/user/16747>
- Wolfgang Ziegler 'fago' http://drupal.org/user/16747
- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
- Daniel F. Kudwien 'sun' http://drupal.org/user/54136
- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
- Franz Heinzmann 'Frando' http://drupal.org/user/21850


Image system
Image system
- Andrew Morton 'drewish' <http://drupal.org/user/34869>
- Andrew Morton 'drewish' http://drupal.org/user/34869
- Nathan Haug 'quicksketch' <http://drupal.org/user/35821>
- Nathan Haug 'quicksketch' http://drupal.org/user/35821


Install system
Install system
- David Rothstein 'David_Rothstein' <http://drupal.org/user/124982>
- David Rothstein 'David_Rothstein' http://drupal.org/user/124982


JavaScript
JavaScript
- ?
- Théodore Biadala 'nod_' http://drupal.org/user/598310
- Steve De Jonghe 'seutje' http://drupal.org/user/264148
- Jesse Renée Beach 'jessebeach' http://drupal.org/user/748566


Language system
Language system
- Francesco Placella 'plach' <http://drupal.org/user/183211>
- Francesco Placella 'plach' http://drupal.org/user/183211
- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
- Daniel F. Kudwien 'sun' http://drupal.org/user/54136


Lock system
Lock system
- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- Damien Tournoud 'DamZ' http://drupal.org/user/22211


Mail system
Mail system
- ?
- ?


Markup
Markup
- Jacine Rodriguez 'Jacine' <http://drupal.org/user/88931>
- Jacine Luisi 'Jacine' http://drupal.org/user/88931
- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
- Daniel F. Kudwien 'sun' http://drupal.org/user/54136


Menu system
Menu system
- Peter Wolanin 'pwolanin' <http://drupal.org/user/49851>
- Peter Wolanin 'pwolanin' http://drupal.org/user/49851
- Károly Négyesi 'chx' <http://drupal.org/user/9446>
- Károly Négyesi 'chx' http://drupal.org/user/9446


Path system
Path system
- Dave Reid 'davereid' <http://drupal.org/user/53892>
- Dave Reid 'davereid' http://drupal.org/user/53892
- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
- Nathaniel Catchpole 'catch' http://drupal.org/user/35733


Render system
Render system
- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23
- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040
- Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
- Franz Heinzmann 'Frando' http://drupal.org/user/21850


Theme system
Theme system
- Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
- Earl Miles 'merlinofchaos' http://drupal.org/user/26979
- Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040
- Joon Park 'dvessel' <http://drupal.org/user/56782>
- Joon Park 'dvessel' http://drupal.org/user/56782
- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095


Token system
Token system
- Dave Reid 'davereid' <http://drupal.org/user/53892>
- Dave Reid 'davereid' http://drupal.org/user/53892

Update system
- ?


XML-RPC system
XML-RPC system
- Frederic G. Marand 'fgm' <http://drupal.org/user/27985>
- Frederic G. Marand 'fgm' http://drupal.org/user/27985




Topic coordinators
Topic coordinators
------------------
------------------


Accessibility
Accessibility
- Everett Zufelt 'Everett Zufelt' <http://drupal.org/user/406552>
- Everett Zufelt 'Everett Zufelt' http://drupal.org/user/406552
- Brandon Bowersox 'brandonojc' <http://drupal.org/user/186415> 
- Brandon Bowersox-Johnson 'bowersox' http://drupal.org/user/186415


Documentation
Documentation
- Addison Berry 'add1sun' <http://drupal.org/user/65088>
- Jennifer Hodgdon 'jhodgdon' http://drupal.org/user/155601
- Jennifer Hodgdon 'jhodgdon' <http://drupal.org/user/155601>


Security
Security
- Heine Deelstra 'Heine' <http://drupal.org/user/17943>
- Greg Knaddison 'greggles' http://drupal.org/user/36762


Translations
Translations
- Gerhard Killesreiter 'killes' <http://drupal.org/user/83>
- Gerhard Killesreiter 'killes' http://drupal.org/user/83


User experience and usability
User experience and usability
- Roy Scholten 'yoroy' <http://drupal.org/user/41502>
- Roy Scholten 'yoroy' http://drupal.org/user/41502
- Bojhan Somers 'Bojhan' <http://drupal.org/user/87969>
- Bojhan Somers 'Bojhan' http://drupal.org/user/87969


Node Access
- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23
- Ken Rickard 'agentrickard' http://drupal.org/user/20975
- Jess Myrbo 'xjm' http://drupal.org/user/65776


Module maintainers
Module maintainers
------------------
------------------
@@ -150,144 +161,143 @@ Aggregator module
- ?
- ?


Block module
Block module
- ?
- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095


Blog module
Blog module
- ?
- ?


Book module
Book module
- Peter Wolanin 'pwolanin' <http://drupal.org/user/49851>
- Peter Wolanin 'pwolanin' http://drupal.org/user/49851


Color module
Color module
- ?
- ?


Comment module
Comment module
- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
- Nathaniel Catchpole 'catch' http://drupal.org/user/35733


Contact module
Contact module
- Dave Reid 'davereid' <http://drupal.org/user/53892>
- Dave Reid 'davereid' http://drupal.org/user/53892


Contextual module
Contextual module
- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
- Daniel F. Kudwien 'sun' http://drupal.org/user/54136


Dashboard module
Dashboard module
- ?
- ?


Database logging module
Database logging module
- Khalid Baheyeldin 'kbahey' <http://drupal.org/user/4063>
- Khalid Baheyeldin 'kbahey' http://drupal.org/user/4063


Field module
Field module
- Yves Chedemois 'yched' <http://drupal.org/user/39567>
- Yves Chedemois 'yched' http://drupal.org/user/39567
- Barry Jaspan 'bjaspan' <http://drupal.org/user/46413>
- Barry Jaspan 'bjaspan' http://drupal.org/user/46413


Field UI module
Field UI module
- Yves Chedemois 'yched' <http://drupal.org/user/39567>
- Yves Chedemois 'yched' http://drupal.org/user/39567


File module
File module
- Aaron Winborn 'aaron' <http://drupal.org/user/33420>
- Aaron Winborn 'aaron' http://drupal.org/user/33420


Filter module
Filter module
- Daniel F. Kudwien 'sun' <http://drupal.org/user/54136>
- Daniel F. Kudwien 'sun' http://drupal.org/user/54136


Forum module
Forum module
- ?
- Lee Rowlands 'larowlan' http://drupal.org/user/395439


Help module
Help module
- ?
- ?


Image module
Image module
- Nathan Haug 'quicksketch' <http://drupal.org/user/35821>
- Nathan Haug 'quicksketch' http://drupal.org/user/35821


Locale module
Locale module
- Gábor Hojtsy 'Gábor Hojtsy' <http://drupal.org/user/4166>
- Gábor Hojtsy 'Gábor Hojtsy' http://drupal.org/user/4166


Menu module
Menu module
- ?
- ?


Node module
Node module
- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23
- David Strauss 'David Strauss' <http://drupal.org/user/93254>
- David Strauss 'David Strauss' http://drupal.org/user/93254


OpenID module
OpenID module
- Heine Deelstra 'Heine' <http://drupal.org/user/17943>
- Vojtech Kusy 'wojtha' http://drupal.org/user/56154
- Christian Schmidt 'c960657' <http://drupal.org/user/216078>
- Christian Schmidt 'c960657' http://drupal.org/user/216078
- Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
- Damien Tournoud 'DamZ' http://drupal.org/user/22211


Overlay module
Overlay module
- Katherine Senzee 'ksenzee' <http://drupal.org/user/139855>
- Katherine Senzee 'ksenzee' http://drupal.org/user/139855


Path module
Path module
- Dave Reid 'davereid' <http://drupal.org/user/53892>
- Dave Reid 'davereid' http://drupal.org/user/53892


PHP module
PHP module
- ?
- ?


Poll module
Poll module
- ?
- Andrei Mateescu 'amateescu' http://drupal.org/user/729614


Profile module
Profile module
- ?
- ?


RDF module
RDF module
- Stéphane Corlosquet 'scor' <http://drupal.org/user/52142>
- Stéphane Corlosquet 'scor' http://drupal.org/user/52142


Search module
Search module
- Doug Green 'douggreen' <http://drupal.org/user/29191>
- Doug Green 'douggreen' http://drupal.org/user/29191


Shortcut module
Shortcut module
- David Rothstein 'David_Rothstein' <http://drupal.org/user/124982>
- David Rothstein 'David_Rothstein' http://drupal.org/user/124982


Simpletest module
Simpletest module
- Jimmy Berry 'boombatower' <http://drupal.org/user/214218>
- Jimmy Berry 'boombatower' http://drupal.org/user/214218
- Károly Négyesi 'chx' <http://drupal.org/user/9446>
- Károly Négyesi 'chx' http://drupal.org/user/9446


Statistics module
Statistics module
- Dave Reid 'davereid' <http://drupal.org/user/53892>
- Tim Millwood 'timmillwood' http://drupal.org/user/227849


Syslog module
Syslog module
- Khalid Baheyeldin 'kbahey' <http://drupal.org/user/4063>
- Khalid Baheyeldin 'kbahey' http://drupal.org/user/4063


System module
System module
- ?
- ?


Taxonomy module
Taxonomy module
- Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
- Jess Myrbo 'xjm' http://drupal.org/user/65776
- Benjamin Doherty 'bangpound' <http://drupal.org/user/100456>
- Nathaniel Catchpole 'catch' http://drupal.org/user/35733
- Benjamin Doherty 'bangpound' http://drupal.org/user/100456


Toolbar module
Toolbar module
- ?
- ?


Tracker module
Tracker module
- David Strauss 'David Strauss' <http://drupal.org/user/93254>
- David Strauss 'David Strauss' http://drupal.org/user/93254


Translation module
Translation module
- Francesco Placella 'plach' <http://drupal.org/user/183211>
- Francesco Placella 'plach' http://drupal.org/user/183211


Trigger module
Trigger module
- ?
- ?


Update module
Update module
- Derek Wright 'dww' <http://drupal.org/user/46549>
- Derek Wright 'dww' http://drupal.org/user/46549
- Dave Reid 'davereid' <http://drupal.org/user/53892>


User module
User module
- Moshe Weitzman 'moshe weitzman' <http://drupal.org/user/23>
- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23
- David Strauss 'David Strauss' <http://drupal.org/user/93254>
- David Strauss 'David Strauss' http://drupal.org/user/93254




Theme maintainers
Theme maintainers
-----------------
-----------------


Bartik theme
Bartik theme
- Jen Simmons 'jensimmons' <http://drupal.org/user/140882>
- Jen Simmons 'jensimmons' http://drupal.org/user/140882
- Jeff Burns 'Jeff Burnz' <http://drupal.org/user/61393>
- Jeff Burns 'Jeff Burnz' http://drupal.org/user/61393


Garland theme
Garland theme
- ?
- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095


Seven theme
Seven theme
- Jeff Burns 'Jeff Burnz' <http://drupal.org/user/61393>
- Jeff Burns 'Jeff Burnz' http://drupal.org/user/61393


Stark theme
Stark theme
- John Wilkins 'JohnAlbin' <http://drupal.org/user/32095>
- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095

README.md

0 → 100644
+163 −0
Original line number Original line Diff line number Diff line
## Requirements:

  * [Core drupal requirements](http://drupal.org/requirements)
  * PHP LDAP Extension
  * PHP Tidy Extension (for migration tool)

## Get Started:

In this example the web root is /Library/WebServer/Documents and Apache runs as _www - modify the instructions below according to your setup

  *  Fork UNL-Information-Services/UNL-CMS and clone your fork into /Library/WebServer/Documents/workspace/UNL-CMS
  *  Create a local database (example name: unlcms)
  *  From /Library/WebServer/Documents/workspace/UNL-CMS run:

        git submodule init
        git submodule update

  *  Create this file in your home directory with a name like resetunlcms.sh

        echo 'Resetting UNL-CMS... Get ready for action!'

        mysqldump -uYOURUSERNAME -pYOURPASS --add-drop-table --no-data unlcms | grep ^DROP | mysql -uYOURUSERNAME -pYOURPASS unlcms
        echo 'unlcms database emptied....'

        cd /Library/WebServer/Documents/workspace/UNL-CMS/sites/default
        rm -rf files
        rm settings.php
        mkdir files
        chown _www files
        cp default.settings.php settings.php
        chown _www settings.php

        cd /Library/WebServer/Documents/workspace/UNL-CMS/sites
        sudo rm -rf localhost.*
        sudo rm -rf MYDEVMACHINE.unl.edu.*
        sudo rm -rf unl.edu.*
        sudo rm sites.php
        cp example.sites.php sites.php

        echo 'Resetting .htaccess'
        cd /Library/WebServer/Documents/workspace/UNL-CMS
        sudo rm .htaccess
        sudo rm .htaccess-subsite-map.txt
        cp .htaccess.sample .htaccess
        cp .htaccess-subsite-map.txt.sample .htaccess-subsite-map.txt
        sudo chown YOURUSER .htaccess
        sudo chown YOURUSER .htaccess-subsite-map.txt
        sed -i "" 's/# RewriteBase \/drupal\//RewriteBase \/workspace\/UNL-CMS\//' ".htaccess"

        echo 'Done.'
        echo 'Note: If you want clean urls you need to look at the .htaccess file where it says "Allow public files to be accessed without the sites/<site_dir>/files prefix"';

  *  Run that script. (Can also be run whenever you want to reset your dev environment.)

        sudo sh ~/resetunlcms.sh

  *  Go to http://localhost/workspace/UNL-CMS and go through the install process


## Install Issues:

  * Can't create a new site with Drush/UNL Cron if pdo_pgsql is enabled

    If pdo_pgsql is enabled on the php install that is running drush/unl cron then it will fail without modification.
    Adding the following junk values for pgsql solves the problem at line 414 (D7.10) of install_run_task inside install.core.inc

              $form_state['values']['pgsql']['username'] = 'xxxx'; //add this
              $form_state['values']['pgsql']['database'] = 'xxxx'; //add this
              drupal_form_submit($function, $form_state); //existing code
              $errors = form_get_errors(); //existing code


## Hacks of Core:

  *  includes/bootstrap.inc

     - function drupal_settings_initialize(). UNL change: include a "global" settings file that applies to all sites.

     - function conf_path(). UNL change: Add $default_domains array support for sites.php to list which domains are ok to use with 'unl.edu.*' site_dirs.
       If no $default_domains array is defined in sites.php, this code will do nothing.

     - Fix so that drupal_serve_page_from_cache() won't override a cached Vary header. http://drupal.org/node/1321086

  *  rewrite.php

     This custom file is used to allow public files to be accessed without the sites/<site_dir>/files prefix.

  *  sites/sites.php

     Added support for $default_domains array. See conf_path() in includes/bootstrap.inc

  *  sites/example.sites.php

     Added an example of the $default_domains array. Added the stub record needed for creating site aliases.

  *  modules/field/modules/text/text.module

     - Add nl2br() on Plain Text processor. See http://drupal.org/node/1152216#comment-7174876

## Hacks of Contrib modules:

  *  drush/commands/core/drupal/site_install.inc

     - function drush_core_site_install_version(). UNL change: Setting this to FALSE because we don't want them and they're hard coded.

  *  drush/commands/core/site_install.drush.inc

     - function drush_core_pre_site_install(). UNL change: Inserted a return before code that would otherwise drop the entire database.

  *  drush/includes/environment.inc

     - Fix so that drush pulls in the correct uri parameter. See http://drupal.org/node/1331106

  *  entity/entity.module, entity/modules/callbacks.inc

     - Add 'uri callback' for file entities. See http://drupal.org/node/1481372#comment-6529650

  *  media/includes/media.variables.inc

     - Convert FILE_ENTITY_DEFAULT_ALLOWED_EXTENSIONS to the new variable. See http://drupal.org/node/1846674#comment-6760286

  *  og_menu
	
     - Applied og_menu-jquery_selector.patch. See:http://drupal.org/node/1051542

  *  redirect

     - Merge global redirect functions into Redirect module. See http://drupal.org/node/905914

  *  upload_replace.module

     - Drupal 7 bug fixes. See http://drupal.org/node/1115484#comment-5646558

  *  webform.module

     - Make Safe Key values accessible via tokens. See http://drupal.org/node/1340010#comment-6709520 Patch applied: http://drupal.org/files/webform-1340010-19.patch

  *  workbench_moderation.module

     - Fix broken books in workbench_moderation_node_presave(). See http://drupal.org/node/1505060

  *  wysiwyg/editors/js/tinymce-3.js

     - Comment out the part that switches wrappers from table-based to div. We need the original TinyMCE code for the PDW toggle plugin to work

## How to Contribute

Development is handled through GitHub

All code changes must be committed via git to a local fork and contributed back to the project via a pull request.

Ideally each developer should have a fork of the project on GitHub where they can push changes.

In your local clone:

 * git pull origin develop
 * git checkout -b topics/whatever-you-work-on (or bugfix/NUM — for bugs)
 * write code and commit
 * git push origin topics/whatever-you-work-on
 * on github open a pull request from your branch to develop
 * have someone else review

Another developer will review your changes and merge in to the develop branch.

README.txt

0 → 100644
+123 −0
Original line number Original line Diff line number Diff line

CONTENTS OF THIS FILE
---------------------

 * About Drupal
 * Configuration and features
 * Installation profiles
 * Appearance
 * Developing for Drupal

ABOUT DRUPAL
------------

Drupal is an open source content management platform supporting a variety of
websites ranging from personal weblogs to large community-driven websites. For
more information, see the Drupal website at http://drupal.org/, and join the
Drupal community at http://drupal.org/community.

Legal information about Drupal:
 * Know your rights when using Drupal:
   See LICENSE.txt in the same directory as this document.
 * Learn about the Drupal trademark and logo policy:
   http://drupal.com/trademark

CONFIGURATION AND FEATURES
--------------------------

Drupal core (what you get when you download and extract a drupal-x.y.tar.gz or
drupal-x.y.zip file from http://drupal.org/project/drupal) has what you need to
get started with your website. It includes several modules (extensions that add
functionality) for common website features, such as managing content, user
accounts, image uploading, and search. Core comes with many options that allow
site-specific configuration. In addition to the core modules, there are
thousands of contributed modules (for functionality not included with Drupal
core) available for download.

More about configuration:
 * Install, upgrade, and maintain Drupal:
   See INSTALL.txt and UPGRADE.txt in the same directory as this document.
 * Learn about how to use Drupal to create your site:
   http://drupal.org/documentation
 * Download contributed modules to sites/all/modules to extend Drupal's
   functionality:
   http://drupal.org/project/modules
 * See also: "Developing for Drupal" for writing your own modules, below.

INSTALLATION PROFILES
---------------------

Installation profiles define additional steps (such as enabling modules,
defining content types, etc.) that run after the base installation provided
by core when Drupal is first installed. There are two basic installation
profiles provided with Drupal core.

Installation profiles from the Drupal community modify the installation process
to provide a website for a specific use case, such as a CMS for media
publishers, a web-based project tracking tool, or a full-fledged CRM for
non-profit organizations raising money and accepting donations. They can be
distributed as bare installation profiles or as "distributions". Distributions
include Drupal core, the installation profile, and all other required
extensions, such as contributed and custom modules, themes, and third-party
libraries. Bare installation profiles require you to download Drupal Core and
the required extensions separately; place the downloaded profile in the
/profiles directory before you start the installation process. Note that the
contents of this directory may be overwritten during updates of Drupal core;
it is advised to keep code backups or use a version control system.

Additionally, modules and themes may be placed inside subdirectories in a
specific installation profile such as profiles/your_site_profile/modules and
profiles/your_site_profile/themes respectively to restrict their usage to only
sites that were installed with that specific profile.

More about installation profiles and distributions:
* Read about the difference between installation profiles and distributions:
  http://drupal.org/node/1089736
* Download contributed installation profiles and distributions:
  http://drupal.org/project/distributions
* Develop your own installation profile or distribution:
  http://drupal.org/developing/distributions

APPEARANCE
----------

In Drupal, the appearance of your site is set by the theme (themes are
extensions that set fonts, colors, and layout). Drupal core comes with several
themes. More themes are available for download, and you can also create your own
custom theme.

More about themes:
 * Download contributed themes to sites/all/themes to modify Drupal's
   appearance:
   http://drupal.org/project/themes
 * Develop your own theme:
   http://drupal.org/documentation/theme

DEVELOPING FOR DRUPAL
---------------------

Drupal contains an extensive API that allows you to add to and modify the
functionality of your site. The API consists of "hooks", which allow modules to
react to system events and customize Drupal's behavior, and functions that
standardize common operations such as database queries and form generation. The
flexible hook architecture means that you should never need to directly modify
the files that come with Drupal core to achieve the functionality you want;
instead, functionality modifications take the form of modules.

When you need new functionality for your Drupal site, search for existing
contributed modules. If you find a module that matches except for a bug or an
additional needed feature, change the module and contribute your improvements
back to the project in the form of a "patch". Create new custom modules only
when nothing existing comes close to what you need.

More about developing:
 * Search for existing contributed modules:
   http://drupal.org/project/modules
 * Contribute a patch:
   http://drupal.org/patch/submit
 * Develop your own module:
   http://drupal.org/developing/modules
 * Follow best practices:
   http://drupal.org/best-practices
 * Refer to the API documentation:
   http://api.drupal.org/api/drupal/7
+77 −64
Original line number Original line Diff line number Diff line
// $Id: UPGRADE.txt,v 1.26 2010/10/22 00:31:59 dries Exp $

INTRODUCTION
INTRODUCTION
------------
------------
This document describes how to:
This document describes how to:


  * Update your Drupal site from one minor 7.x version to another minor 7.x
  * Update your Drupal site from one minor 7.x version to another minor 7.x
    version; for example, from 7.9 to 7.10.
    version; for example, from 7.8 to 7.9, or from 7.6 to 7.10.


  * Upgrade your Drupal site's major version from 6.x to 7.x.
  * Upgrade your Drupal site's major version from 6.x to 7.x.


@@ -13,18 +11,24 @@ First steps and definitions:


  * If you are upgrading to Drupal version x.y, then x is known as the major
  * If you are upgrading to Drupal version x.y, then x is known as the major
    version number, and y is known as the minor version number. The download
    version number, and y is known as the minor version number. The download
    file will be named drupal-x.y.tar.gz.
    file will be named drupal-x.y.tar.gz (or drupal-x.y.zip).

  * The "Don't hack core" principle is respected. If you modified core files
    outside of the 'sites' directory, see http://drupal.org/node/144376.


  * All directories mentioned in this document are always relative to the
  * All directories mentioned in this document are relative to the directory of
    directory of your Drupal installation.
    your Drupal installation.


  * Make a full backup of all files, directories, and your database(s) before
  * Make a full backup of all files, directories, and your database(s) before
    starting. Instructions may be found at
    starting, and save it outside your Drupal installation directory.
    http://drupal.org/upgrade/backing-up-the-db
    Instructions may be found at http://drupal.org/upgrade/backing-up-the-db


  * It is wise to try an update or upgrade on a test copy of your site before
    applying it to your live site. Even minor updates can cause your site's
    behavior to change.

  * Each new release of Drupal has release notes, which explain the changes made
    since the previous version and any special instructions needed to update or
    upgrade to the new version. You can find a link to the release notes for the
    version you are upgrading or updating to on the Drupal project page
    (http://drupal.org/project/drupal).


UPGRADE PROBLEMS
UPGRADE PROBLEMS
----------------
----------------
@@ -36,29 +40,40 @@ If you encounter errors during this process,
    you created before you started the upgrade process. Do not attempt to do
    you created before you started the upgrade process. Do not attempt to do
    further upgrades on a site that had update problems.
    further upgrades on a site that had update problems.


  * Consult one of the support options listed on http://drupal.org/support.
  * Consult one of the support options listed on http://drupal.org/support


More in-depth information on upgrading can be found at http://drupal.org/upgrade
More in-depth information on upgrading can be found at http://drupal.org/upgrade



MINOR VERSION UPDATES
MINOR VERSION UPDATES
---------------------
---------------------
To update from one minor 7.x version of Drupal to another 7.x version, after
To update from one minor 7.x version of Drupal to any later 7.x version, after
following the instructions in the INTRODUCTION section at the top of this file:
following the instructions in the INTRODUCTION section at the top of this file:


1. Log in as a user with the permission "Administer software updates".
1. Log in as a user with the permission "Administer software updates".
   IMPORTANT! Do not close your browser until the final step is complete.


2. Go to Administer » Configuration » Development » Maintenance mode.
2. Go to Administration > Configuration > Development > Maintenance mode.
   Enable the "Put site into maintenance mode" checkbox and save the
   Enable the "Put site into maintenance mode" checkbox and save the
   configuration.
   configuration.


3. Remove all old core files and directories, EXCEPT for the 'sites' directory
3. Remove all old core files and directories, except for the 'sites' directory
   and any custom files you added elsewhere.
   and any custom files you added elsewhere.


   If you made modifications to files like .htaccess or robots.txt, you will
   If you made modifications to files like .htaccess or robots.txt, you will
   need to re-apply them from your backup, after the new files are in place.
   need to re-apply them from your backup, after the new files are in place.


   Sometimes an update includes changes to default.settings.php (this will be
   noted in the release notes). If that's the case, follow these steps:

   - Make a backup copy of your settings.php file, with a different file name.

   - Make a copy of the new default.settings.php file, and name the copy
     settings.php (overwriting your previous settings.php file).

   - Copy the custom and site-specific entries from the backup you made into the
     new settings.php file. You will definitely need the lines giving the
     database information, and you will also want to copy in any other
     customizations you have added.

4. Download the latest Drupal 7.x release from http://drupal.org to a
4. Download the latest Drupal 7.x release from http://drupal.org to a
   directory outside of your web root. Extract the archive and copy the files
   directory outside of your web root. Extract the archive and copy the files
   into your Drupal directory.
   into your Drupal directory.
@@ -88,7 +103,7 @@ following the instructions in the INTRODUCTION section at the top of this file:


   - Open settings.php with a text editor.
   - Open settings.php with a text editor.


   - There is a line that says:
   - Find the line that says:
     $update_free_access = FALSE;
     $update_free_access = FALSE;


   - Change it into:
   - Change it into:
@@ -96,63 +111,72 @@ following the instructions in the INTRODUCTION section at the top of this file:


   - Once the upgrade is done, $update_free_access must be reverted to FALSE.
   - Once the upgrade is done, $update_free_access must be reverted to FALSE.


7. Go to Administration » Reports » Status report. Verify that everything is
7. Go to Administration > Reports > Status report. Verify that everything is
   is working as expected.
   working as expected.


8. Ensure that $update_free_access is FALSE in settings.php.
8. Ensure that $update_free_access is FALSE in settings.php.


9. Go to Administration » Configuration » Development » Maintenance mode.
9. Go to Administration > Configuration > Development > Maintenance mode.
   Disable the "Put site into maintenance mode" checkbox and save the
   Disable the "Put site into maintenance mode" checkbox and save the
   configuration.
   configuration.



MAJOR VERSION UPGRADE
MAJOR VERSION UPGRADE
---------------------
---------------------
To upgrade from a previous major version of Drupal to Drupal 7.x, after
To upgrade from a previous major version of Drupal to Drupal 7.x, after
following the instructions in the INTRODUCTION section at the top of this file:
following the instructions in the INTRODUCTION section at the top of this file:


1. Update to the latest available version of Drupal 6.x.
1. Check on the Drupal 7 status of your contributed and custom modules and
   themes. See http://drupal.org/node/948216 for information on upgrading
   contributed modules and themes. See http://drupal.org/node/895314 for a list
   of modules that have been moved into core for Drupal 7, and instructions on
   how to update them. See http://drupal.org/update/modules for information on
   how to update your custom modules, and http://drupal.org/update/theme for
   custom themes.

   You may decide at this point that you cannot upgrade your site, because
   needed modules or themes are not ready for Drupal 7.


   If your current version is Drupal 5.x, you have to upgrade to 6.x first.
2. Update to the latest available version of Drupal 6.x (if your current version
   Download Drupal 6.x and follow the instructions in UPGRADE.txt instead.
   is Drupal 5.x, you have to upgrade to 6.x first). If you need to update,
   This document only applies for upgrades from 6.x to 7.x.
   download Drupal 6.x and follow the instructions in its UPGRADE.txt. This
   document only applies for upgrades from 6.x to 7.x.


2. Check the availability of your modules and themes for Drupal 7.x. See
3. In addition to updating to the latest available version of Drupal 6.x core,
   http://drupal.org/node/948216
   you must also upgrade all of your contributed modules for Drupal to their
   latest Drupal 6.x versions.


3. Log in as user ID 1 (the site maintenance user).
4. Log in as user ID 1 (the site maintenance user).


4. Go to Administer » Site configuration » Site maintenance. Select "Off-line"
5. Go to Administer > Site configuration > Site maintenance. Select
   and save the configuration.
   "Off-line" and save the configuration.


5. Go to Administer » Site building » Themes. Enable "Garland" and select it as
6. Go to Administer > Site building > Themes. Enable "Garland" and select it as
   default theme.
   the default theme.


6. Go to Administer » Site building » Modules. Disable all modules that are not
7. Go to Administer > Site building > Modules. Disable all modules that are not
   listed under "Core - required" or "Core - optional". It is possible that some
   listed under "Core - required" or "Core - optional". It is possible that some
   modules cannot be disabled, because others depend on them. Repeat this step
   modules cannot be disabled, because others depend on them. Repeat this step
   until all non-core modules are disabled.
   until all non-core modules are disabled.


   In case you already know that you will not re-enable some modules for Drupal
   If you know that you will not re-enable some modules for Drupal 7.x and you
   7.x and you no longer need their data, then you can uninstall them under the
   no longer need their data, then you can uninstall them under the Uninstall
   Uninstall tab afterwards. See http://drupal.org/node/895314 for a list of
   tab after disabling them.
   modules whose functionality has been moved into core for Drupal 7.x.


7. On the command line or in your FTP client, remove the file
8. On the command line or in your FTP client, remove the file


     sites/default/default.settings.php
     sites/default/default.settings.php


8. Remove all old core files and directories, EXCEPT for the 'sites' directory
9. Remove all old core files and directories, except for the 'sites' directory
   and any custom files you added elsewhere.
   and any custom files you added elsewhere.


   If you made modifications to files like .htaccess or robots.txt, you will
   If you made modifications to files like .htaccess or robots.txt, you will
   need to re-apply them from your backup, after the new files are in place.
   need to re-apply them from your backup, after the new files are in place.


9. If you uninstalled any modules, remove them from the sites/all/modules and
10. If you uninstalled any modules, remove them from the sites/all/modules and
   other sites/*/modules directories. Leave other modules in place, even though
   other sites/*/modules directories. Leave other modules in place, even though
   they are incompatible with Drupal 7.x.
   they are incompatible with Drupal 7.x.


10. Download the latest Drupal 7.x release from http://drupal.org to a
11. Download the latest Drupal 7.x release from http://drupal.org to a
   directory outside of your web root. Extract the archive and copy the files
   directory outside of your web root. Extract the archive and copy the files
   into your Drupal directory.
   into your Drupal directory.


@@ -171,14 +195,14 @@ following the instructions in the INTRODUCTION section at the top of this file:
   from http://drupal.org using your web browser, extract it, and then use an
   from http://drupal.org using your web browser, extract it, and then use an
   FTP client to upload the files to your web root.
   FTP client to upload the files to your web root.


11. Re-apply any modifications to files such as .htaccess or robots.txt.
12. Re-apply any modifications to files such as .htaccess or robots.txt.


12. Make your settings.php file writeable, so that the update process can
13. Make your settings.php file writeable, so that the update process can
   convert it to the format of Drupal 7.x. settings.php is usually located in
   convert it to the format of Drupal 7.x. settings.php is usually located in


     sites/default/settings.php
     sites/default/settings.php


13. Run update.php by visiting http://www.example.com/update.php (replace
14. Run update.php by visiting http://www.example.com/update.php (replace
   www.example.com with your domain name). This will update the core database
   www.example.com with your domain name). This will update the core database
   tables.
   tables.


@@ -186,7 +210,7 @@ following the instructions in the INTRODUCTION section at the top of this file:


   - Open settings.php with a text editor.
   - Open settings.php with a text editor.


   - There is a line that says:
   - Find the line that says:
     $update_free_access = FALSE;
     $update_free_access = FALSE;


   - Change it into:
   - Change it into:
@@ -194,30 +218,19 @@ following the instructions in the INTRODUCTION section at the top of this file:


   - Once the upgrade is done, $update_free_access must be reverted to FALSE.
   - Once the upgrade is done, $update_free_access must be reverted to FALSE.


14. Backup your database after the core upgrade has run.
15. Backup your database after the core upgrade has run.

15. Replace your non-core modules, following this procedure:

   - Check your notes for any special upgrade instructions.
   - Entirely delete the old module directory in sites/all/modules/.
   - Download, extract, and move the new module directory to sites/all/modules/.


16. Go to Administration » Modules. Re-enable your non-core modules.
16. Replace and update your non-core modules and themes, following the
   procedures at http://drupal.org/node/948216


17. Re-run update.php.
17. Go to Administration > Reports > Status report. Verify that everything is
   working as expected.


18. If applicable, return the site to its original theme following the same
18. Ensure that $update_free_access is FALSE in settings.php.
   procedure as in 15., but putting the theme in sites/all/themes/.


19. Go to Administration » Reports » Status report. Verify that everything is
19. Go to Administration > Configuration > Development > Maintenance mode.
   is working as expected.

20. Ensure that $update_free_access is FALSE in settings.php.

21. Go to Administration » Configuration » Development » Maintenance mode.
   Disable the "Put site into maintenance mode" checkbox and save the
   Disable the "Put site into maintenance mode" checkbox and save the
   configuration.
   configuration.


To get started with Drupal 7 administration, visit
To get started with Drupal 7 administration, visit
http://drupal.org/getting-started/7/admin
http://drupal.org/getting-started/7/admin
+32 −33
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: authorize.php,v 1.8 2010/04/22 10:16:24 webchick Exp $


/**
/**
 * @file
 * @file
 * Administrative script for running authorized file operations.
 * Administrative script for running authorized file operations.
 *
 *
 * Using this script, the site owner (the user actually owning the files on
 * Using this script, the site owner (the user actually owning the files on the
 * the webserver) can authorize certain file-related operations to proceed
 * webserver) can authorize certain file-related operations to proceed with
 * with elevated privileges, for example to deploy and upgrade modules or
 * elevated privileges, for example to deploy and upgrade modules or themes.
 * themes. Users should not visit this page directly, but instead use an
 * Users should not visit this page directly, but instead use an administrative
 * administrative user interface which knows how to redirect the user to this
 * user interface which knows how to redirect the user to this script as part of
 * script as part of a multistep process. This script actually performs the
 * a multistep process. This script actually performs the selected operations
 * selected operations without loading all of Drupal, to be able to more
 * without loading all of Drupal, to be able to more gracefully recover from
 * gracefully recover from errors. Access to the script is controlled by a
 * errors. Access to the script is controlled by a global killswitch in
 * global killswitch in settings.php ('allow_authorize_operations') and via
 * settings.php ('allow_authorize_operations') and via the 'administer software
 * the 'administer software updates' permission.
 * updates' permission.
 *
 *
 * There are helper functions for setting up an operation to run via this
 * There are helper functions for setting up an operation to run via this
 * system in modules/system/system.module. For more information, see:
 * system in modules/system/system.module. For more information, see:
@@ -22,21 +21,22 @@
 */
 */


/**
/**
 * Root directory of Drupal installation.
 * Defines the root directory of the Drupal installation.
 */
 */
define('DRUPAL_ROOT', getcwd());
define('DRUPAL_ROOT', getcwd());


/**
/**
 * Global flag to identify update.php and authorize.php runs, and so
 * Global flag to identify update.php and authorize.php runs.
 * avoid various unwanted operations, such as hook_init() and
 *
 * hook_exit() invokes, css/js preprocessing and translation, and
 * Identifies update.php and authorize.php runs, avoiding unwanted operations
 * solve some theming issues. This flag is checked on several places
 * such as hook_init() and hook_exit() invokes, css/js preprocessing and
 * in Drupal code (not just authorize.php).
 * translation, and solves some theming issues. The flag is checked in other
 * places in Drupal code (not just authorize.php).
 */
 */
define('MAINTENANCE_MODE', 'update');
define('MAINTENANCE_MODE', 'update');


/**
/**
 * Render a 403 access denied page for authorize.php
 * Renders a 403 access denied page for authorize.php.
 */
 */
function authorize_access_denied_page() {
function authorize_access_denied_page() {
  drupal_add_http_header('Status', '403 Forbidden');
  drupal_add_http_header('Status', '403 Forbidden');
@@ -46,13 +46,13 @@ function authorize_access_denied_page() {
}
}


/**
/**
 * Determine if the current user is allowed to run authorize.php.
 * Determines if the current user is allowed to run authorize.php.
 *
 *
 * The killswitch in settings.php overrides all else, otherwise, the user must
 * The killswitch in settings.php overrides all else, otherwise, the user must
 * have access to the 'administer software updates' permission.
 * have access to the 'administer software updates' permission.
 *
 *
 * @return
 * @return
 *   TRUE if the current user can run authorize.php, otherwise FALSE.
 *   TRUE if the current user can run authorize.php, and FALSE if not.
 */
 */
function authorize_access_allowed() {
function authorize_access_allowed() {
  return variable_get('allow_authorize_operations', TRUE) && user_access('administer software updates');
  return variable_get('allow_authorize_operations', TRUE) && user_access('administer software updates');
@@ -61,7 +61,6 @@ function authorize_access_allowed() {
// *** Real work of the script begins here. ***
// *** Real work of the script begins here. ***


require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
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/common.inc';
require_once DRUPAL_ROOT . '/includes/file.inc';
require_once DRUPAL_ROOT . '/includes/file.inc';
require_once DRUPAL_ROOT . '/includes/module.inc';
require_once DRUPAL_ROOT . '/includes/module.inc';
@@ -75,7 +74,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
global $conf;
global $conf;


// We have to enable the user and system modules, even to check access and
// We have to enable the user and system modules, even to check access and
// display errors via the maintainence theme.
// display errors via the maintenance theme.
$module_list['system']['filename'] = 'modules/system/system.module';
$module_list['system']['filename'] = 'modules/system/system.module';
$module_list['user']['filename'] = 'modules/user/user.module';
$module_list['user']['filename'] = 'modules/user/user.module';
module_list(TRUE, FALSE, FALSE, $module_list);
module_list(TRUE, FALSE, FALSE, $module_list);
@@ -113,7 +112,7 @@ if (authorize_access_allowed()) {
  }
  }


  if (isset($_SESSION['authorize_operation']['page_title'])) {
  if (isset($_SESSION['authorize_operation']['page_title'])) {
    drupal_set_title(check_plain($_SESSION['authorize_operation']['page_title']));
    drupal_set_title($_SESSION['authorize_operation']['page_title']);
  }
  }
  else {
  else {
    drupal_set_title(t('Authorize file system changes'));
    drupal_set_title(t('Authorize file system changes'));
@@ -125,10 +124,10 @@ if (authorize_access_allowed()) {
    // Clear the session out.
    // Clear the session out.
    unset($_SESSION['authorize_results']);
    unset($_SESSION['authorize_results']);
    unset($_SESSION['authorize_operation']);
    unset($_SESSION['authorize_operation']);
    unset($_SESSION['authorize_filetransfer_backends']);
    unset($_SESSION['authorize_filetransfer_info']);


    if (!empty($results['page_title'])) {
    if (!empty($results['page_title'])) {
      drupal_set_title(check_plain($results['page_title']));
      drupal_set_title($results['page_title']);
    }
    }
    if (!empty($results['page_message'])) {
    if (!empty($results['page_message'])) {
      drupal_set_message($results['page_message']['message'], $results['page_message']['type']);
      drupal_set_message($results['page_message']['message'], $results['page_message']['type']);
@@ -140,20 +139,21 @@ if (authorize_access_allowed()) {
    if (is_array($results['tasks'])) {
    if (is_array($results['tasks'])) {
      $links += $results['tasks'];
      $links += $results['tasks'];
    }
    }

    else {
      $links = array_merge($links, array(
      $links = array_merge($links, array(
        l(t('Administration pages'), 'admin'),
        l(t('Administration pages'), 'admin'),
        l(t('Front page'), '<front>'),
        l(t('Front page'), '<front>'),
      ));
      ));
    }


    $output .= theme('item_list', array('items' => $links));
    $output .= theme('item_list', array('items' => $links, 'title' => t('Next steps')));
  }
  }
  // If a batch is running, let it run.
  // If a batch is running, let it run.
  elseif (isset($_GET['batch'])) {
  elseif (isset($_GET['batch'])) {
    $output = _batch_page();
    $output = _batch_page();
  }
  }
  else {
  else {
    if (empty($_SESSION['authorize_operation']) || empty($_SESSION['authorize_filetransfer_backends'])) {
    if (empty($_SESSION['authorize_operation']) || empty($_SESSION['authorize_filetransfer_info'])) {
      $output = t('It appears you have reached this page in error.');
      $output = t('It appears you have reached this page in error.');
    }
    }
    elseif (!$batch = batch_get()) {
    elseif (!$batch = batch_get()) {
@@ -172,4 +172,3 @@ else {
if (!empty($output)) {
if (!empty($output)) {
  print theme('update_page', array('content' => $output, 'show_messages' => $show_messages));
  print theme('update_page', array('content' => $output, 'show_messages' => $show_messages));
}
}
+0 −1
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: cron.php,v 1.43 2009/11/02 03:30:49 webchick Exp $


/**
/**
 * @file
 * @file
+13 −9
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: actions.inc,v 1.39 2010/08/22 11:04:09 dries Exp $


/**
/**
 * @file
 * @file
@@ -23,7 +22,7 @@
 * - $a1, $a2: Optional additional information, which can be passed into
 * - $a1, $a2: Optional additional information, which can be passed into
 *   actions_do() and will be passed along to the action function.
 *   actions_do() and will be passed along to the action function.
 *
 *
 * @} End of "defgroup actions".
 * @}
 */
 */


/**
/**
@@ -49,6 +48,7 @@
 *   Passed along to the callback.
 *   Passed along to the callback.
 * @param $a2
 * @param $a2
 *   Passed along to the callback.
 *   Passed along to the callback.
 *
 * @return
 * @return
 *   An associative array containing the results of the functions that
 *   An associative array containing the results of the functions that
 *   perform the actions, keyed on action ID.
 *   perform the actions, keyed on action ID.
@@ -150,6 +150,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
 *
 *
 * @param $reset
 * @param $reset
 *   Reset the action info static cache.
 *   Reset the action info static cache.
 *
 * @return
 * @return
 *   An associative array keyed on action function name, with the same format
 *   An associative array keyed on action function name, with the same format
 *   as the return value of hook_action_info(), containing all
 *   as the return value of hook_action_info(), containing all
@@ -177,9 +178,9 @@ function actions_list($reset = FALSE) {
 * function and the actions returned by actions_list() are partially
 * function and the actions returned by actions_list() are partially
 * synchronized. Non-configurable actions from hook_action_info()
 * synchronized. Non-configurable actions from hook_action_info()
 * implementations are put into the database when actions_synchronize() is
 * implementations are put into the database when actions_synchronize() is
 * called, which happens when admin/config/system/actions is visited. Configurable
 * called, which happens when admin/config/system/actions is visited.
 * actions are not added to the database until they are configured in the
 * Configurable actions are not added to the database until they are configured
 * user interface, in which case a database row is created for each
 * in the user interface, in which case a database row is created for each
 * configuration of each action.
 * configuration of each action.
 *
 *
 * @return
 * @return
@@ -206,6 +207,7 @@ function actions_get_all_actions() {
 *   An associative array with function names or action IDs as keys
 *   An associative array with function names or action IDs as keys
 *   and associative arrays with keys 'label', 'type', etc. as values.
 *   and associative arrays with keys 'label', 'type', etc. as values.
 *   This is usually the output of actions_list() or actions_get_all_actions().
 *   This is usually the output of actions_list() or actions_get_all_actions().
 *
 * @return
 * @return
 *   An associative array whose keys are hashes of the input array keys, and
 *   An associative array whose keys are hashes of the input array keys, and
 *   whose corresponding values are associative arrays with components
 *   whose corresponding values are associative arrays with components
@@ -224,7 +226,7 @@ function actions_actions_map($actions) {
}
}


/**
/**
 * Given a hash of an action array key, returns the key (function or ID).
 * Returns an action array key (function or ID), given its hash.
 *
 *
 * Faster than actions_actions_map() when you only need the function name or ID.
 * Faster than actions_actions_map() when you only need the function name or ID.
 *
 *
@@ -232,6 +234,7 @@ function actions_actions_map($actions) {
 *   Hash of a function name or action ID array key. The array key
 *   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
 *   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).
 *   function name) or actions_get_all_actions() (array key is the action ID).
 *
 * @return
 * @return
 *   The corresponding array key, or FALSE if no match is found.
 *   The corresponding array key, or FALSE if no match is found.
 */
 */
@@ -278,7 +281,7 @@ function actions_synchronize($delete_orphans = FALSE) {
    // user adds the action.
    // user adds the action.
    if (!$array['configurable']) {
    if (!$array['configurable']) {
      // If we already have an action ID for this action, no need to assign aid.
      // If we already have an action ID for this action, no need to assign aid.
      if (array_key_exists($callback, $actions_in_db)) {
      if (isset($actions_in_db[$callback])) {
        unset($actions_in_db[$callback]);
        unset($actions_in_db[$callback]);
      }
      }
      else {
      else {
@@ -312,7 +315,7 @@ function actions_synchronize($delete_orphans = FALSE) {
      $link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan');
      $link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan');
      $count = count($actions_in_db);
      $count = count($actions_in_db);
      $orphans = implode(', ', $orphaned);
      $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);
      watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
    }
    }
  }
  }
}
}
@@ -333,6 +336,7 @@ function actions_synchronize($delete_orphans = FALSE) {
 *   to Jim'.
 *   to Jim'.
 * @param $aid
 * @param $aid
 *   The ID of this action. If omitted, a new action is created.
 *   The ID of this action. If omitted, a new action is created.
 *
 * @return
 * @return
 *   The ID of the action.
 *   The ID of the action.
 */
 */
@@ -362,6 +366,7 @@ function actions_save($function, $type, $params, $label, $aid = NULL) {
 *
 *
 * @param $aid
 * @param $aid
 *   The ID of the action to retrieve.
 *   The ID of the action to retrieve.
 *
 * @return
 * @return
 *   The appropriate action row from the database as an object.
 *   The appropriate action row from the database as an object.
 */
 */
@@ -381,4 +386,3 @@ function actions_delete($aid) {
    ->execute();
    ->execute();
  module_invoke_all('actions_delete', $aid);
  module_invoke_all('actions_delete', $aid);
}
}
+242 −141

File changed.

Preview size limit exceeded, changes collapsed.

+13 −12
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: archiver.inc,v 1.5 2010/02/01 07:17:59 webchick Exp $


/**
/**
 * @file
 * @file
@@ -7,12 +6,12 @@
 */
 */


/**
/**
 * Common interface for all Archiver classes.
 * Defines the common interface for all Archiver classes.
 */
 */
interface ArchiverInterface {
interface ArchiverInterface {


  /**
  /**
   * Constructor for a new archiver instance.
   * Constructs a new archiver instance.
   *
   *
   * @param $file_path
   * @param $file_path
   *   The full system path of the archive to manipulate. Only local files
   *   The full system path of the archive to manipulate. Only local files
@@ -22,46 +21,48 @@ interface ArchiverInterface {
  public function __construct($file_path);
  public function __construct($file_path);


  /**
  /**
   * Add the specified file or directory to the archive.
   * Adds the specified file or directory to the archive.
   *
   *
   * @param $file_path
   * @param $file_path
   *   The full system path of the file or directory to add. Only local files
   *   The full system path of the file or directory to add. Only local files
   *   and directories are supported.
   *   and directories are supported.
   *
   * @return ArchiverInterface
   * @return ArchiverInterface
   *   The called object.
   *   The called object.
   */
   */
  public function add($file_path);
  public function add($file_path);


  /**
  /**
   * Remove the specified file from the archive.
   * Removes the specified file from the archive.
   *
   *
   * @param $path
   * @param $path
   *   The file name relative to the root of the archive to remove.
   *   The file name relative to the root of the archive to remove.
   *
   * @return ArchiverInterface
   * @return ArchiverInterface
   *   The called object.
   *   The called object.
   */
   */
  public function remove($path);
  public function remove($path);


  /**
  /**
   * Extract multiple files in the archive to the specified path.
   * Extracts multiple files in the archive to the specified path.
   *
   *
   * @param $path
   * @param $path
   *   A full system path of the directory to which to extract files.
   *   A full system path of the directory to which to extract files.
   * @param $files
   * @param $files
   *   Optionally specify a list of files to be extracted. Files are
   *   Optionally specify a list of files to be extracted. Files are
   *   relative to the root of the archive. If not specified, all files
   *   relative to the root of the archive. If not specified, all files
   *   in the archive will be extracted
   *   in the archive will be extracted.
   *
   * @return ArchiverInterface
   * @return ArchiverInterface
   *   The called object.
   *   The called object.
   */
   */
  public function extract($path, Array $files = array());
  public function extract($path, array $files = array());


  /**
  /**
   * List all files in the archive.
   * Lists all files in the archive.
   *
   *
   * @return
   * @return
   *   An array of file names relative to the root of the archive.
   *   An array of file names relative to the root of the archive.
   */
   */
  public function listContents();
  public function listContents();
}
}
+115 −24
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: authorize.inc,v 1.11 2010/05/14 04:50:18 webchick Exp $


/**
/**
 * @file
 * @file
@@ -7,13 +6,19 @@
 */
 */


/**
/**
 * Build the form for choosing a FileTransfer type and supplying credentials.
 * Form constructor for the file transfer authorization form.
 *
 * Allows the user to choose a FileTransfer type and supply credentials.
 *
 * @see authorize_filetransfer_form_validate()
 * @see authorize_filetransfer_form_submit()
 * @ingroup forms
 */
 */
function authorize_filetransfer_form($form_state) {
function authorize_filetransfer_form($form, &$form_state) {
  global $base_url, $is_https;
  global $base_url, $is_https;
  $form = array();
  $form = array();


  // If possible, we want to post this form securely via https.
  // If possible, we want to post this form securely via HTTPS.
  $form['#https'] = TRUE;
  $form['#https'] = TRUE;


  // CSS we depend on lives in modules/system/maintenance.css, which is loaded
  // CSS we depend on lives in modules/system/maintenance.css, which is loaded
@@ -21,15 +26,18 @@ function authorize_filetransfer_form($form_state) {
  $form['#attached']['js'][] = $base_url . '/misc/authorize.js';
  $form['#attached']['js'][] = $base_url . '/misc/authorize.js';


  // Get all the available ways to transfer files.
  // Get all the available ways to transfer files.
  if (empty($_SESSION['authorize_filetransfer_backends'])) {
  if (empty($_SESSION['authorize_filetransfer_info'])) {
    drupal_set_message(t('Unable to continue, no available methods of file transfer'), 'error');
    drupal_set_message(t('Unable to continue, no available methods of file transfer'), 'error');
    return array();
    return array();
  }
  }
  $available_backends = $_SESSION['authorize_filetransfer_backends'];
  $available_backends = $_SESSION['authorize_filetransfer_info'];
  uasort($available_backends, 'drupal_sort_weight');


  if (!$is_https) {
  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');
    $form['information']['https_warning'] = array(
      '#prefix' => '<div class="messages error">',
      '#markup' => 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')),
      '#suffix' => '</div>',
    );
  }
  }


  // Decide on a default backend.
  // Decide on a default backend.
@@ -78,17 +86,20 @@ function authorize_filetransfer_form($form_state) {
    '#attributes' => array('style' => 'display:none'),
    '#attributes' => array('style' => 'display:none'),
  );
  );


  // Build a hidden fieldset for each one.
  // Build a container for each connection type.
  foreach ($available_backends as $name => $backend) {
  foreach ($available_backends as $name => $backend) {
    $form['connection_settings']['authorize_filetransfer_default']['#options'][$name] = $backend['title'];
    $form['connection_settings']['authorize_filetransfer_default']['#options'][$name] = $backend['title'];
    $form['connection_settings'][$name] = array(
    $form['connection_settings'][$name] = array(
      '#type' => 'fieldset',
      '#type' => 'container',
      '#attributes' => array('class' => array("filetransfer-$name", 'filetransfer')),
      '#attributes' => array('class' => array("filetransfer-$name", 'filetransfer')),
      '#title' => t('@backend connection settings', array('@backend' => $backend['title'])),
    );
    // We can't use #prefix on the container itself since then the header won't
    // be hidden and shown when the containers are being manipulated via JS.
    $form['connection_settings'][$name]['header'] = array(
      '#markup' => '<h4>' . t('@backend connection settings', array('@backend' => $backend['title'])) . '</h4>',
    );
    );


    $current_settings = variable_get('authorize_filetransfer_connection_settings_' . $name, array());
    $form['connection_settings'][$name] += _authorize_filetransfer_connection_settings($name);
    $form['connection_settings'][$name] += system_get_filetransfer_settings_form($name, $current_settings);


    // Start non-JS code.
    // Start non-JS code.
    if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default']) && $form_state['values']['connection_settings']['authorize_filetransfer_default'] == $name) {
    if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default']) && $form_state['values']['connection_settings']['authorize_filetransfer_default'] == $name) {
@@ -113,7 +124,7 @@ function authorize_filetransfer_form($form_state) {
        '#type' => 'submit',
        '#type' => 'submit',
        '#value' => t('Change connection type'),
        '#value' => t('Change connection type'),
        '#weight' => -5,
        '#weight' => -5,
        '#attributes' => array('class' => 'filetransfer-change-connection-type'),
        '#attributes' => array('class' => array('filetransfer-change-connection-type')),
      );
      );
    }
    }
    // End non-JS code.
    // End non-JS code.
@@ -122,11 +133,76 @@ function authorize_filetransfer_form($form_state) {
}
}


/**
/**
 * Validate callback for the filetransfer authorization form.
 * Generates the Form API array for a given connection backend's settings.
 *
 * @param $backend
 *   The name of the backend (e.g. 'ftp', 'ssh', etc).
 *
 * @return
 *   Form API array of connection settings for the given backend.
 *
 * @see hook_filetransfer_backends()
 */
function _authorize_filetransfer_connection_settings($backend) {
  $defaults = variable_get('authorize_filetransfer_connection_settings_' . $backend, array());
  $form = array();

  // Create an instance of the file transfer class to get its settings form.
  $filetransfer = authorize_get_filetransfer($backend);
  if ($filetransfer) {
    $form = $filetransfer->getSettingsForm();
  }
  // Fill in the defaults based on the saved settings, if any.
  _authorize_filetransfer_connection_settings_set_defaults($form, NULL, $defaults);
  return $form;
}

/**
 * Sets the default settings on a file transfer connection form recursively.
 *
 * The default settings for the file transfer connection forms are saved in
 * the database. The settings are stored as a nested array in the case of a
 * settings form that has fieldsets or otherwise uses a nested structure.
 * Therefore, to properly add defaults, we need to walk through all the
 * children form elements and process those defaults recursively.
 *
 * @param $element
 *   Reference to the Form API form element we're operating on.
 * @param $key
 *   The key for our current form element, if any.
 * @param array $defaults
 *   The default settings for the file transfer backend we're operating on.
 */
function _authorize_filetransfer_connection_settings_set_defaults(&$element, $key, array $defaults) {
  // If we're operating on a form element which isn't a fieldset, and we have
  // a default setting saved, stash it in #default_value.
  if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'fieldset') {
    $element['#default_value'] = $defaults[$key];
  }
  // Now, we walk through all the child elements, and recursively invoke
  // ourself on each one. Since the $defaults settings array can be nested
  // (because of #tree, any values inside fieldsets will be nested), if
  // there's a subarray of settings for the form key we're currently
  // processing, pass in that subarray to the recursive call. Otherwise, just
  // pass on the whole $defaults array.
  foreach (element_children($element) as $child_key) {
    _authorize_filetransfer_connection_settings_set_defaults($element[$child_key], $child_key, ((isset($defaults[$key]) && is_array($defaults[$key])) ? $defaults[$key] : $defaults));
  }
}

/**
 * Form validation handler for authorize_filetransfer_form().
 *
 *
 * @see authorize_filetransfer_form()
 * @see authorize_filetransfer_form()
 * @see authorize_filetransfer_submit()
 */
 */
function authorize_filetransfer_form_validate($form, &$form_state) {
function authorize_filetransfer_form_validate($form, &$form_state) {
  // Only validate the form if we have collected all of the user input and are
  // ready to proceed with updating or installing.
  if ($form_state['triggering_element']['#name'] != 'process_updates') {
    return;
  }

  if (isset($form_state['values']['connection_settings'])) {
  if (isset($form_state['values']['connection_settings'])) {
    $backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
    $backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
    $filetransfer = authorize_get_filetransfer($backend, $form_state['values']['connection_settings'][$backend]);
    $filetransfer = authorize_get_filetransfer($backend, $form_state['values']['connection_settings'][$backend]);
@@ -137,19 +213,25 @@ function authorize_filetransfer_form_validate($form, &$form_state) {
      $filetransfer->connect();
      $filetransfer->connect();
    }
    }
    catch (Exception $e) {
    catch (Exception $e) {
      form_set_error('connection_settings', $e->getMessage());
      // The format of this error message is similar to that used on the
      // database connection form in the installer.
      form_set_error('connection_settings', t('Failed to connect to the server. The server reports the following message: !message For more help installing or updating code on your server, see the <a href="@handbook_url">handbook</a>.', array(
        '!message' => '<p class="error">' . $e->getMessage()  . '</p>',
        '@handbook_url' => 'http://drupal.org/documentation/install/modules-themes',
      )));
    }
    }
  }
  }
}
}


/**
/**
 * Submit callback when a file transfer is being authorized.
 * Form submission handler for authorize_filetransfer_form().
 *
 *
 * @see authorize_filetransfer_form()
 * @see authorize_filetransfer_form()
 * @see authorize_filetransfer_validate()
 */
 */
function authorize_filetransfer_form_submit($form, &$form_state) {
function authorize_filetransfer_form_submit($form, &$form_state) {
  global $base_url;
  global $base_url;
  switch ($form_state['clicked_button']['#name']) {
  switch ($form_state['triggering_element']['#name']) {
    case 'process_updates':
    case 'process_updates':


      // Save the connection settings to the DB.
      // Save the connection settings to the DB.
@@ -205,7 +287,7 @@ function authorize_filetransfer_form_submit($form, &$form_state) {
}
}


/**
/**
 * Run the operation specified in $_SESSION['authorize_operation']
 * Runs the operation specified in $_SESSION['authorize_operation'].
 *
 *
 * @param $filetransfer
 * @param $filetransfer
 *   The FileTransfer object to use for running the operation.
 *   The FileTransfer object to use for running the operation.
@@ -215,7 +297,7 @@ function authorize_run_operation($filetransfer) {
  unset($_SESSION['authorize_operation']);
  unset($_SESSION['authorize_operation']);


  if (!empty($operation['page_title'])) {
  if (!empty($operation['page_title'])) {
    drupal_set_title(check_plain($operation['page_title']));
    drupal_set_title($operation['page_title']);
  }
  }


  require_once DRUPAL_ROOT . '/' . $operation['file'];
  require_once DRUPAL_ROOT . '/' . $operation['file'];
@@ -223,21 +305,30 @@ function authorize_run_operation($filetransfer) {
}
}


/**
/**
 * Get a FileTransfer class for a specific transfer method and settings.
 * Gets a FileTransfer class for a specific transfer method and settings.
 *
 *
 * @param $backend
 * @param $backend
 *   The FileTransfer backend to get the class for.
 *   The FileTransfer backend to get the class for.
 * @param $settings
 * @param $settings
 *   Array of settings for the FileTransfer.
 *   Array of settings for the FileTransfer.
 *
 * @return
 * @return
 *   An instantiated FileTransfer object for the requested method and settings,
 *   An instantiated FileTransfer object for the requested method and settings,
 *   or FALSE if there was an error finding or instantiating it.
 *   or FALSE if there was an error finding or instantiating it.
 */
 */
function authorize_get_filetransfer($backend, $settings = array()) {
function authorize_get_filetransfer($backend, $settings = array()) {
  $filetransfer = FALSE;
  $filetransfer = FALSE;
  if (!empty($_SESSION['authorize_filetransfer_backends'][$backend])) {
  if (!empty($_SESSION['authorize_filetransfer_info'][$backend])) {
    $filetransfer = call_user_func_array(array($_SESSION['authorize_filetransfer_backends'][$backend]['class'], 'factory'), array(DRUPAL_ROOT, $settings));
    $backend_info = $_SESSION['authorize_filetransfer_info'][$backend];
    if (!empty($backend_info['file'])) {
      $file = $backend_info['file path'] . '/' . $backend_info['file'];
      require_once $file;
    }
    if (class_exists($backend_info['class'])) {
      // PHP 5.2 doesn't support $class::factory() syntax, so we have to
      // use call_user_func_array() until we can require PHP 5.3.
      $filetransfer = call_user_func_array(array($backend_info['class'], 'factory'), array(DRUPAL_ROOT, $settings));
    }
  }
  }
  return $filetransfer;
  return $filetransfer;
}
}
+35 −18
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: batch.inc,v 1.53 2010/10/04 07:34:26 webchick Exp $



/**
/**
 * @file
 * @file
@@ -22,6 +20,7 @@
 * @param $id
 * @param $id
 *   The ID of the batch to load. When a progressive batch is being processed,
 *   The ID of the batch to load. When a progressive batch is being processed,
 *   the relevant ID is found in $_REQUEST['id'].
 *   the relevant ID is found in $_REQUEST['id'].
 *
 * @return
 * @return
 *   An array representing the batch, or FALSE if no batch was found.
 *   An array representing the batch, or FALSE if no batch was found.
 */
 */
@@ -37,7 +36,7 @@ function batch_load($id) {
}
}


/**
/**
 * State-based dispatcher for the batch processing page.
 * Renders the batch processing page based on the current state of the batch.
 *
 *
 * @see _batch_shutdown()
 * @see _batch_shutdown()
 */
 */
@@ -95,7 +94,7 @@ function _batch_page() {
}
}


/**
/**
 * Initialize the batch processing.
 * Initializes the batch processing.
 *
 *
 * JavaScript-enabled clients are identified by the 'has_js' cookie set in
 * 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
 * drupal.js. If no JavaScript-enabled page has been visited during the current
@@ -111,7 +110,7 @@ function _batch_start() {
}
}


/**
/**
 * Output a batch processing page with JavaScript support.
 * Outputs a batch processing page with JavaScript support.
 *
 *
 * This initializes the batch and error messages. Note that in JavaScript-based
 * This initializes the batch and error messages. Note that in JavaScript-based
 * processing, the batch processing page is displayed only once and updated via
 * processing, the batch processing page is displayed only once and updated via
@@ -139,14 +138,13 @@ function _batch_progress_page_js() {
    ),
    ),
  );
  );
  drupal_add_js($js_setting, 'setting');
  drupal_add_js($js_setting, 'setting');
  drupal_add_js('misc/progress.js', array('cache' => FALSE));
  drupal_add_library('system', 'drupal.batch');
  drupal_add_js('misc/batch.js', array('cache' => FALSE));


  return '<div id="progress"></div>';
  return '<div id="progress"></div>';
}
}


/**
/**
 * Do one execution pass in JavaScript-mode and return progress to the browser.
 * Does one execution pass with JavaScript and returns progress to the browser.
 *
 *
 * @see _batch_progress_page_js()
 * @see _batch_progress_page_js()
 * @see _batch_process()
 * @see _batch_process()
@@ -166,7 +164,7 @@ function _batch_do() {
}
}


/**
/**
 * Output a batch processing page without JavaScript support.
 * Outputs a batch processing page without JavaScript support.
 *
 *
 * @see _batch_process()
 * @see _batch_process()
 */
 */
@@ -230,7 +228,7 @@ function _batch_progress_page_nojs() {
}
}


/**
/**
 * Process sets in a batch.
 * Processes sets in a batch.
 *
 *
 * If the batch was marked for progressive execution (default), this executes as
 * 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
 * many operations in batch sets until an execution time of 1 second has been
@@ -341,6 +339,8 @@ function _batch_process() {
      $progress_message = $old_set['progress_message'];
      $progress_message = $old_set['progress_message'];
    }
    }


    // Total progress is the number of operations that have fully run plus the
    // completion level of the current operation.
    $current    = $total - $remaining + $finished;
    $current    = $total - $remaining + $finished;
    $percentage = _batch_api_percentage($total, $current);
    $percentage = _batch_api_percentage($total, $current);
    $elapsed    = isset($current_set['elapsed']) ? $current_set['elapsed'] : 0;
    $elapsed    = isset($current_set['elapsed']) ? $current_set['elapsed'] : 0;
@@ -370,17 +370,23 @@ function _batch_process() {
}
}


/**
/**
 * Helper function for _batch_process(): returns the formatted percentage.
 * Formats the percent completion for a batch set.
 *
 *
 * @param $total
 * @param $total
 *   The total number of operations.
 *   The total number of operations.
 * @param $current
 * @param $current
 *   The number of the current operation.
 *   The number of the current operation. This may be a floating point number
 *   rather than an integer in the case of a multi-step operation that is not
 *   yet complete; in that case, the fractional part of $current represents the
 *   fraction of the operation that has been completed.
 *
 * @return
 * @return
 *   The properly formatted percentage, as a string. We output percentages
 *   The properly formatted percentage, as a string. We output percentages
 *   using the correct number of decimal places so that we never print "100%"
 *   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
 *   until we are finished, but we also never print more decimal places than
 *   are meaningful.
 *   are meaningful.
 *
 * @see _batch_process()
 */
 */
function _batch_api_percentage($total, $current) {
function _batch_api_percentage($total, $current) {
  if (!$total || $total == $current) {
  if (!$total || $total == $current) {
@@ -392,13 +398,22 @@ function _batch_api_percentage($total, $current) {
    // We add a new digit at 200, 2000, etc. (since, for example, 199/200
    // We add a new digit at 200, 2000, etc. (since, for example, 199/200
    // would round up to 100% if we didn't).
    // would round up to 100% if we didn't).
    $decimal_places = max(0, floor(log10($total / 2.0)) - 1);
    $decimal_places = max(0, floor(log10($total / 2.0)) - 1);
    do {
      // Calculate the percentage to the specified number of decimal places.
      $percentage = sprintf('%01.' . $decimal_places . 'f', round($current / $total * 100, $decimal_places));
      $percentage = sprintf('%01.' . $decimal_places . 'f', round($current / $total * 100, $decimal_places));
      // When $current is an integer, the above calculation will always be
      // correct. However, if $current is a floating point number (in the case
      // of a multi-step batch operation that is not yet complete), $percentage
      // may be erroneously rounded up to 100%. To prevent that, we add one
      // more decimal place and try again.
      $decimal_places++;
    } while ($percentage == '100');
  }
  }
  return $percentage;
  return $percentage;
}
}


/**
/**
 * Return the batch set being currently processed.
 * Returns the batch set being currently processed.
 */
 */
function &_batch_current_set() {
function &_batch_current_set() {
  $batch = &batch_get();
  $batch = &batch_get();
@@ -406,7 +421,7 @@ function &_batch_current_set() {
}
}


/**
/**
 * Retrieve the next set in a batch.
 * Retrieves the next set in a batch.
 *
 *
 * If there is a subsequent set in this batch, assign it as the new set to
 * 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
 * process and execute its form submit handler (if defined), which may add
@@ -430,7 +445,7 @@ function _batch_next_set() {
}
}


/**
/**
 * End the batch processing.
 * Ends the batch processing.
 *
 *
 * Call the 'finished' callback of each batch set to allow custom handling of
 * Call the 'finished' callback of each batch set to allow custom handling of
 * the results and resolve page redirection.
 * the results and resolve page redirection.
@@ -509,7 +524,10 @@ function _batch_finished() {
}
}


/**
/**
 * Shutdown function; store the current batch data for the next request.
 * Shutdown function: Stores the current batch data for the next request.
 *
 * @see _batch_page()
 * @see drupal_register_shutdown_function()
 */
 */
function _batch_shutdown() {
function _batch_shutdown() {
  if ($batch = batch_get()) {
  if ($batch = batch_get()) {
@@ -519,4 +537,3 @@ function _batch_shutdown() {
      ->execute();
      ->execute();
  }
  }
}
}
+25 −13
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: batch.queue.inc,v 1.1 2010/01/08 06:36:34 webchick Exp $



/**
/**
 * @file
 * @file
 * Queue handlers used by the Batch API.
 * Queue handlers used by the Batch API.
 *
 *
 * Those implementations:
 * These implementations:
 * - ensure FIFO ordering,
 * - Ensure FIFO ordering.
 * - let an item be repeatedly claimed until it is actually deleted (no notion
 * - Allow an item to be repeatedly claimed until it is actually deleted (no
 *   of lease time or 'expire' date), to allow multipass operations.
 *   notion of lease time or 'expire' date), to allow multipass operations.
 */
 */


/**
/**
 * Batch queue implementation.
 * Defines a batch queue.
 *
 *
 * Stale items from failed batches are cleaned from the {queue} table on cron
 * Stale items from failed batches are cleaned from the {queue} table on cron
 * using the 'created' date.
 * using the 'created' date.
 */
 */
class BatchQueue extends SystemQueue {
class BatchQueue extends SystemQueue {


  /**
   * Overrides SystemQueue::claimItem().
   *
   * Unlike SystemQueue::claimItem(), this method provides a default lease
   * time of 0 (no expiration) instead of 30. This allows the item to be
   * claimed repeatedly until it is deleted.
   */
  public function claimItem($lease_time = 0) {
  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();
    $item = db_query_range('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, array(':name' => $this->name))->fetchObject();
    if ($item) {
    if ($item) {
      $item->data = unserialize($item->data);
      $item->data = unserialize($item->data);
      return $item;
      return $item;
@@ -30,9 +35,9 @@ class BatchQueue extends SystemQueue {
  }
  }


  /**
  /**
   * Retrieve all remaining items in the queue.
   * Retrieves all remaining items in the queue.
   *
   *
   * This is specific to Batch API and is not part of the DrupalQueueInterface,
   * This is specific to Batch API and is not part of the DrupalQueueInterface.
   */
   */
  public function getAllItems() {
  public function getAllItems() {
    $result = array();
    $result = array();
@@ -45,10 +50,17 @@ class BatchQueue extends SystemQueue {
}
}


/**
/**
 * Batch queue implementation used for non-progressive batches.
 * Defines a batch queue for non-progressive batches.
 */
 */
class BatchMemoryQueue extends MemoryQueue {
class BatchMemoryQueue extends MemoryQueue {


  /**
   * Overrides MemoryQueue::claimItem().
   *
   * Unlike MemoryQueue::claimItem(), this method provides a default lease
   * time of 0 (no expiration) instead of 30. This allows the item to be
   * claimed repeatedly until it is deleted.
   */
  public function claimItem($lease_time = 0) {
  public function claimItem($lease_time = 0) {
    if (!empty($this->queue)) {
    if (!empty($this->queue)) {
      reset($this->queue);
      reset($this->queue);
@@ -58,9 +70,9 @@ class BatchMemoryQueue extends MemoryQueue {
  }
  }


  /**
  /**
   * Retrieve all remaining items in the queue.
   * Retrieves all remaining items in the queue.
   *
   *
   * This is specific to Batch API and is not part of the DrupalQueueInterface,
   * This is specific to Batch API and is not part of the DrupalQueueInterface.
   */
   */
  public function getAllItems() {
  public function getAllItems() {
    $result = array();
    $result = array();
+939 −518

File changed.

Preview size limit exceeded, changes collapsed.

+18 −3
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: cache-install.inc,v 1.9 2010/05/18 18:26:30 dries Exp $


/**
/**
 * @file
 * @file
@@ -7,7 +6,7 @@
 */
 */


/**
/**
 * A stub cache implementation to be used during the installation process.
 * Defines a stub cache implementation to be used during installation.
 *
 *
 * The stub implementation is needed when database access is not yet available.
 * The stub implementation is needed when database access is not yet available.
 * Because Drupal's caching system never requires that cached data be present,
 * Because Drupal's caching system never requires that cached data be present,
@@ -16,22 +15,35 @@
 * normal operations would have a negative impact on performance.
 * normal operations would have a negative impact on performance.
 */
 */
class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface {
class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface {

  /**
   * Overrides DrupalDatabaseCache::get().
   */
  function get($cid) {
  function get($cid) {
    return FALSE;
    return FALSE;
  }
  }


  /**
   * Overrides DrupalDatabaseCache::getMultiple().
   */
  function getMultiple(&$cids) {
  function getMultiple(&$cids) {
    return array();
    return array();
  }
  }


  /**
   * Overrides DrupalDatabaseCache::set().
   */
  function set($cid, $data, $expire = CACHE_PERMANENT) {
  function set($cid, $data, $expire = CACHE_PERMANENT) {
  }
  }


  /**
   * Overrides DrupalDatabaseCache::clear().
   */
  function clear($cid = NULL, $wildcard = FALSE) {
  function clear($cid = NULL, $wildcard = FALSE) {
    // If there is a database cache, attempt to clear it whenever possible. The
    // 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
    // reason for doing this is that the database cache can accumulate data
    // during installation due to any full bootstraps that may occur at the
    // during installation due to any full bootstraps that may occur at the
    // same time (for example, AJAX requests triggered by the installer). If we
    // 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
    // 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
    // cache would become stale; for example, the installer sometimes calls
    // variable_set(), which updates the {variable} table and then clears the
    // variable_set(), which updates the {variable} table and then clears the
@@ -53,6 +65,9 @@ class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterfac
    }
    }
  }
  }


  /**
   * Overrides DrupalDatabaseCache::isEmpty().
   */
  function isEmpty() {
  function isEmpty() {
    return TRUE;
    return TRUE;
  }
  }
+145 −101
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: cache.inc,v 1.49 2010/10/07 17:44:53 dries Exp $


/**
/**
 * Get the cache object for a cache bin.
 * @file
 * Functions and interfaces for cache handling.
 */

/**
 * Gets the cache object for a cache bin.
 *
 *
 * By default, this returns an instance of the DrupalDatabaseCache class.
 * By default, this returns an instance of the DrupalDatabaseCache class.
 * Classes implementing DrupalCacheInterface can register themselves both as a
 * Classes implementing DrupalCacheInterface can register themselves both as a
 * default implementation and for specific bins.
 * default implementation and for specific bins.
 *
 *
 * @see DrupalCacheInterface
 *
 * @param $bin
 * @param $bin
 *   The cache bin for which the cache object should be returned.
 *   The cache bin for which the cache object should be returned.
 * @return DrupalCacheInterface
 * @return DrupalCacheInterface
 *   The cache object associated with the specified bin.
 *   The cache object associated with the specified bin.
 *
 * @see DrupalCacheInterface
 */
 */
function _cache_get_object($bin) {
function _cache_get_object($bin) {
  // We do not use drupal_static() here because we do not want to change the
  // We do not use drupal_static() here because we do not want to change the
@@ -30,7 +34,7 @@ function _cache_get_object($bin) {
}
}


/**
/**
 * Return data from the persistent cache
 * Returns data from the persistent cache.
 *
 *
 * Data may be stored as either plain text or as serialized data. cache_get
 * Data may be stored as either plain text or as serialized data. cache_get
 * will automatically return unserialized objects and arrays.
 * will automatically return unserialized objects and arrays.
@@ -45,19 +49,22 @@ function _cache_get_object($bin) {
 *
 *
 * @return
 * @return
 *   The cache or FALSE on failure.
 *   The cache or FALSE on failure.
 *
 * @see cache_set()
 */
 */
function cache_get($cid, $bin = 'cache') {
function cache_get($cid, $bin = 'cache') {
  return _cache_get_object($bin)->get($cid);
  return _cache_get_object($bin)->get($cid);
}
}


/**
/**
 * Return data from the persistent cache when given an array of cache IDs.
 * Returns data from the persistent cache when given an array of cache IDs.
 *
 *
 * @param $cids
 * @param $cids
 *   An array of cache IDs for the data to retrieve. This is passed by
 *   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.
 *   reference, and will have the IDs successfully returned from cache removed.
 * @param $bin
 * @param $bin
 *   The cache bin where the data is stored.
 *   The cache bin where the data is stored.
 *
 * @return
 * @return
 *   An array of the items successfully returned from cache indexed by cid.
 *   An array of the items successfully returned from cache indexed by cid.
 */
 */
@@ -66,50 +73,22 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
}
}


/**
/**
 * Store data in the persistent cache.
 * Stores data in the persistent cache.
 *
 *
 * The persistent cache is split up into several cache bins. In the default
 * 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
 * cache implementation, each cache bin corresponds to a database table by the
 * same name. Other implementations might want to store several bins in data
 * 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
 * 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
 * cache bins if the entries in them are flushed before their expire time, some
 * might break functionality or are extremely expensive to recalculate. These
 * might break functionality or are extremely expensive to recalculate. The
 * will be marked with a (*). The other bins expired automatically by core.
 * other bins are expired automatically by core. Contributed modules can add
 * Contributed modules can add additional bins and get them expired
 * additional bins and get them expired automatically by implementing
 * automatically by implementing hook_flush_caches().
 * 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:
 * The reasons for having several bins are as follows:
 *
 * - Smaller bins mean smaller database tables and allow for faster selects and
 * - smaller bins mean smaller database tables and allow for faster selects and
 *   inserts.
 *   inserts
 * - We try to put fast changing cache items and rather static ones into
 * - 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
 *   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
 *   lot of writes to disk. The more static bins will also be better cacheable
 *   with MySQL's query cache.
 *   with MySQL's query cache.
@@ -118,13 +97,27 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
 *   The cache ID of the data to store.
 *   The cache ID of the data to store.
 * @param $data
 * @param $data
 *   The data to store in the cache. Complex data types will be automatically
 *   The data to store in the cache. Complex data types will be automatically
 *   serialized before insertion.
 *   serialized before insertion. Strings will be stored as plain text and are
 *   Strings will be stored as plain text and not serialized.
 *   not serialized.
 * @param $bin
 * @param $bin
 *   The cache bin to store the data in. Valid core values are 'cache_block',
 *   The cache bin to store the data in. Valid core values are:
 *   'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form',
 *   - cache: (default) Generic cache storage bin (used for theme registry,
 *   'cache_menu', 'cache_page', 'cache_update' or 'cache' for the default
 *     locale date, list of simpletest tests, etc.).
 *   cache.
 *   - cache_block: Stores the content of various blocks.
 *   - cache_bootstrap: Stores the class registry, the system list of modules,
 *     the list of which modules implement which hooks, and the Drupal variable
 *     list.
 *   - 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. This bin should not be flushed before its expired time.
 *   - 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 node 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.
 * @param $expire
 * @param $expire
 *   One of the following values:
 *   One of the following values:
 *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
 *   - CACHE_PERMANENT: Indicates that the item should never be removed unless
@@ -133,13 +126,16 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
 *     general cache wipe.
 *     general cache wipe.
 *   - A Unix timestamp: Indicates that the item should be kept at least until
 *   - A Unix timestamp: Indicates that the item should be kept at least until
 *     the given time, after which it behaves like CACHE_TEMPORARY.
 *     the given time, after which it behaves like CACHE_TEMPORARY.
 *
 * @see _update_cache_set()
 * @see cache_get()
 */
 */
function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
  return _cache_get_object($bin)->set($cid, $data, $expire);
  return _cache_get_object($bin)->set($cid, $data, $expire);
}
}


/**
/**
 * Expire data from the cache.
 * Expires data from the cache.
 *
 *
 * If called without arguments, expirable entries will be cleared from the
 * If called without arguments, expirable entries will be cleared from the
 * cache_page and cache_block bins.
 * cache_page and cache_block bins.
@@ -147,15 +143,12 @@ function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
 * @param $cid
 * @param $cid
 *   If set, the cache ID to delete. Otherwise, all cache entries that can
 *   If set, the cache ID to delete. Otherwise, all cache entries that can
 *   expire are deleted.
 *   expire are deleted.
 *
 * @param $bin
 * @param $bin
 *   If set, the bin $bin to delete from. Mandatory
 *   If set, the cache bin to delete from. Mandatory argument if $cid is set.
 *   argument if $cid is set.
 *
 * @param $wildcard
 * @param $wildcard
 *   If $wildcard is TRUE, cache IDs starting with $cid are deleted in
 *   If TRUE, cache IDs starting with $cid are deleted in addition to the
 *   addition to the exact cache ID specified by $cid.  If $wildcard is
 *   exact cache ID specified by $cid. If $wildcard is TRUE and $cid is '*',
 *   TRUE and $cid is '*' then the entire bin $bin is emptied.
 *   the entire cache bin is emptied.
 */
 */
function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
  if (!isset($cid) && !isset($bin)) {
  if (!isset($cid) && !isset($bin)) {
@@ -171,13 +164,14 @@ function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
}
}


/**
/**
 * Check if a cache bin is empty.
 * Checks if a cache bin is empty.
 *
 *
 * A cache bin is considered empty if it does not contain any valid data for any
 * A cache bin is considered empty if it does not contain any valid data for any
 * cache ID.
 * cache ID.
 *
 *
 * @param $bin
 * @param $bin
 *   The cache bin to check.
 *   The cache bin to check.
 *
 * @return
 * @return
 *   TRUE if the cache bin specified is empty.
 *   TRUE if the cache bin specified is empty.
 */
 */
@@ -186,7 +180,7 @@ function cache_is_empty($bin) {
}
}


/**
/**
 * Interface for cache implementations.
 * Defines an interface for cache implementations.
 *
 *
 * All cache implementations have to implement this interface.
 * All cache implementations have to implement this interface.
 * DrupalDatabaseCache provides the default implementation, which can be
 * DrupalDatabaseCache provides the default implementation, which can be
@@ -198,7 +192,7 @@ function cache_is_empty($bin) {
 * DrupalCacheInterface was called MyCustomCache, the following line would make
 * DrupalCacheInterface was called MyCustomCache, the following line would make
 * Drupal use it for the 'cache_page' bin:
 * Drupal use it for the 'cache_page' bin:
 * @code
 * @code
 *  variable_set('cache_page', 'MyCustomCache');
 *  variable_set('cache_class_cache_page', 'MyCustomCache');
 * @endcode
 * @endcode
 *
 *
 * Additionally, you can register your cache implementation to be used by
 * Additionally, you can register your cache implementation to be used by
@@ -208,12 +202,23 @@ function cache_is_empty($bin) {
 *  variable_set('cache_default_class', 'MyCustomCache');
 *  variable_set('cache_default_class', 'MyCustomCache');
 * @endcode
 * @endcode
 *
 *
 * To implement a completely custom cache bin, use the same variable format:
 * @code
 *  variable_set('cache_class_custom_bin', 'MyCustomCache');
 * @endcode
 * To access your custom cache bin, specify the name of the bin when storing
 * or retrieving cached data:
 * @code
 *  cache_set($cid, $data, 'custom_bin', $expire);
 *  cache_get($cid, 'custom_bin');
 * @endcode
 *
 * @see _cache_get_object()
 * @see _cache_get_object()
 * @see DrupalDatabaseCache
 * @see DrupalDatabaseCache
 */
 */
interface DrupalCacheInterface {
interface DrupalCacheInterface {
  /**
  /**
   * Constructor.
   * Constructs a new cache interface.
   *
   *
   * @param $bin
   * @param $bin
   *   The cache bin for which the object is created.
   *   The cache bin for which the object is created.
@@ -221,31 +226,34 @@ interface DrupalCacheInterface {
  function __construct($bin);
  function __construct($bin);


  /**
  /**
   * Return data from the persistent cache. Data may be stored as either plain
   * Returns data from the persistent cache.
   * text or as serialized data. cache_get will automatically return
   *
   * unserialized objects and arrays.
   * Data may be stored as either plain text or as serialized data. cache_get()
   * will automatically return unserialized objects and arrays.
   *
   *
   * @param $cid
   * @param $cid
   *   The cache ID of the data to retrieve.
   *   The cache ID of the data to retrieve.
   *
   * @return
   * @return
   *   The cache or FALSE on failure.
   *   The cache or FALSE on failure.
   */
   */
  function get($cid);
  function get($cid);


  /**
  /**
   * Return data from the persistent cache when given an array of cache IDs.
   * Returns data from the persistent cache when given an array of cache IDs.
   *
   *
   * @param $cids
   * @param $cids
   *   An array of cache IDs for the data to retrieve. This is passed by
   *   An array of cache IDs for the data to retrieve. This is passed by
   *   reference, and will have the IDs successfully returned from cache
   *   reference, and will have the IDs successfully returned from cache
   *   removed.
   *   removed.
   *
   * @return
   * @return
   *   An array of the items successfully returned from cache indexed by cid.
   *   An array of the items successfully returned from cache indexed by cid.
   */
   */
   function getMultiple(&$cids);
   function getMultiple(&$cids);


  /**
  /**
   * Store data in the persistent cache.
   * Stores data in the persistent cache.
   *
   *
   * @param $cid
   * @param $cid
   *   The cache ID of the data to store.
   *   The cache ID of the data to store.
@@ -266,8 +274,10 @@ interface DrupalCacheInterface {




  /**
  /**
   * Expire data from the cache. If called without arguments, expirable
   * Expires data from the cache.
   * entries will be cleared from the cache_page and cache_block bins.
   *
   * If called without arguments, expirable entries will be cleared from the
   * cache_page and cache_block bins.
   *
   *
   * @param $cid
   * @param $cid
   *   If set, the cache ID to delete. Otherwise, all cache entries that can
   *   If set, the cache ID to delete. Otherwise, all cache entries that can
@@ -280,7 +290,7 @@ interface DrupalCacheInterface {
  function clear($cid = NULL, $wildcard = FALSE);
  function clear($cid = NULL, $wildcard = FALSE);


  /**
  /**
   * Check if a cache bin is empty.
   * Checks if a cache bin is empty.
   *
   *
   * A cache bin is considered empty if it does not contain any valid data for
   * A cache bin is considered empty if it does not contain any valid data for
   * any cache ID.
   * any cache ID.
@@ -292,7 +302,7 @@ interface DrupalCacheInterface {
}
}


/**
/**
 * Default cache implementation.
 * Defines a default cache implementation.
 *
 *
 * This is Drupal's default cache implementation. It uses the database to store
 * 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.
 * cached data. Each cache bin corresponds to a database table by the same name.
@@ -300,32 +310,38 @@ interface DrupalCacheInterface {
class DrupalDatabaseCache implements DrupalCacheInterface {
class DrupalDatabaseCache implements DrupalCacheInterface {
  protected $bin;
  protected $bin;


  /**
   * Constructs a new DrupalDatabaseCache object.
   */
  function __construct($bin) {
  function __construct($bin) {
    $this->bin = $bin;
    $this->bin = $bin;
  }
  }


  /**
   * Implements DrupalCacheInterface::get().
   */
  function get($cid) {
  function get($cid) {
    try {
    $cids = array($cid);
      // Garbage collection necessary when enforcing a minimum cache lifetime.
    $cache = $this->getMultiple($cids);
      $this->garbageCollection($this->bin);
    return reset($cache);
      $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;
    }
  }
  }


  /**
   * Implements DrupalCacheInterface::getMultiple().
   */
  function getMultiple(&$cids) {
  function getMultiple(&$cids) {
    try {
    try {
      // Garbage collection necessary when enforcing a minimum cache lifetime.
      // Garbage collection necessary when enforcing a minimum cache lifetime.
      $this->garbageCollection($this->bin);
      $this->garbageCollection($this->bin);
      $query = db_select($this->bin);

      $query->fields($this->bin, array('cid', 'data', 'created', 'expire', 'serialized'));
      // When serving cached pages, the overhead of using db_select() was found
      $query->condition($this->bin . '.cid', $cids, 'IN');
      // to add around 30% overhead to the request. Since $this->bin is a
      $result = $query->execute();
      // variable, this means the call to db_query() here uses a concatenated
      // string. This is highly discouraged under any other circumstances, and
      // is used here only due to the performance overhead we would incur
      // otherwise. When serving an uncached page, the overhead of using
      // db_select() is a much smaller proportion of the request.
      $result = db_query('SELECT cid, data, created, expire, serialized FROM {' . db_escape_table($this->bin) . '} WHERE cid IN (:cids)', array(':cids' => $cids));
      $cache = array();
      $cache = array();
      foreach ($result as $item) {
      foreach ($result as $item) {
        $item = $this->prepareItem($item);
        $item = $this->prepareItem($item);
@@ -350,11 +366,31 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
   *   The bin being requested.
   *   The bin being requested.
   */
   */
  protected function garbageCollection() {
  protected function garbageCollection() {
    global $user;
    $cache_lifetime = variable_get('cache_lifetime', 0);


    // Garbage collection necessary when enforcing a minimum cache lifetime.
    // Clean-up the per-user cache expiration session data, so that the session
    // handler can properly clean-up the session data for anonymous users.
    if (isset($_SESSION['cache_expiration'])) {
      $expire = REQUEST_TIME - $cache_lifetime;
      foreach ($_SESSION['cache_expiration'] as $bin => $timestamp) {
        if ($timestamp < $expire) {
          unset($_SESSION['cache_expiration'][$bin]);
        }
      }
      if (!$_SESSION['cache_expiration']) {
        unset($_SESSION['cache_expiration']);
      }
    }

    // Garbage collection of temporary items is only necessary when enforcing
    // a minimum cache lifetime.
    if (!$cache_lifetime) {
      return;
    }
    // When cache lifetime is in force, avoid running garbage collection too
    // often since this will remove temporary cache items indiscriminately.
    $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
    $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
    if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME)) {
    if ($cache_flush && ($cache_flush + $cache_lifetime <= REQUEST_TIME)) {
      // Reset the variable immediately to prevent a meltdown in heavy load situations.
      // Reset the variable immediately to prevent a meltdown in heavy load situations.
      variable_set('cache_flush_' . $this->bin, 0);
      variable_set('cache_flush_' . $this->bin, 0);
      // Time to flush old cache data
      // Time to flush old cache data
@@ -366,13 +402,14 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
  }
  }


  /**
  /**
   * Prepare a cached item.
   * Prepares a cached item.
   *
   *
   * Checks that items are either permanent or did not expire, and unserializes
   * Checks that items are either permanent or did not expire, and unserializes
   * data as appropriate.
   * data as appropriate.
   *
   *
   * @param $cache
   * @param $cache
   *   An item loaded from cache_get() or cache_get_multiple().
   *   An item loaded from cache_get() or cache_get_multiple().
   *
   * @return
   * @return
   *   The item with data unserialized as appropriate or FALSE if there is no
   *   The item with data unserialized as appropriate or FALSE if there is no
   *   valid item to load.
   *   valid item to load.
@@ -383,17 +420,16 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
    if (!isset($cache->data)) {
    if (!isset($cache->data)) {
      return FALSE;
      return FALSE;
    }
    }
    // If enforcing a minimum cache lifetime, validate that the data is
    // If the cached data is temporary and subject to a per-user minimum
    // currently valid for this user before we return it by making sure the cache
    // lifetime, compare the cache entry timestamp with the user session
    // entry was created before the timestamp in the current session's cache
    // cache_expiration timestamp. If the cache entry is too old, ignore it.
    // timer. The cache variable is loaded into the $user object by _drupal_session_read()
    if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && isset($_SESSION['cache_expiration'][$this->bin]) && $_SESSION['cache_expiration'][$this->bin] > $cache->created) {
    // in session.inc. If the data is permanent or we're not enforcing a minimum
      // Ignore cache data that is too old and thus not valid for this user.
    // 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;
      return FALSE;
    }
    }


    // If the data is permanent or not subject to a minimum cache lifetime,
    // unserialize and return the cached data.
    if ($cache->serialized) {
    if ($cache->serialized) {
      $cache->data = unserialize($cache->data);
      $cache->data = unserialize($cache->data);
    }
    }
@@ -401,6 +437,9 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
    return $cache;
    return $cache;
  }
  }


  /**
   * Implements DrupalCacheInterface::set().
   */
  function set($cid, $data, $expire = CACHE_PERMANENT) {
  function set($cid, $data, $expire = CACHE_PERMANENT) {
    $fields = array(
    $fields = array(
      'serialized' => 0,
      'serialized' => 0,
@@ -427,16 +466,18 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
    }
    }
  }
  }


  /**
   * Implements DrupalCacheInterface::clear().
   */
  function clear($cid = NULL, $wildcard = FALSE) {
  function clear($cid = NULL, $wildcard = FALSE) {
    global $user;
    global $user;


    if (empty($cid)) {
    if (empty($cid)) {
      if (variable_get('cache_lifetime', 0)) {
      if (variable_get('cache_lifetime', 0)) {
        // We store the time in the current user's $user->cache variable which
        // We store the time in the current user's session. We then simulate
        // will be saved into the sessions bin by _drupal_session_write(). We then
        // that the cache was flushed for this user by not returning cached
        // simulate that the cache was flushed for this user by not returning
        // data that was cached before the timestamp.
        // cached data that was cached before the timestamp.
        $_SESSION['cache_expiration'][$this->bin] = REQUEST_TIME;
        $user->cache = REQUEST_TIME;


        $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
        $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
        if ($cache_flush == 0) {
        if ($cache_flush == 0) {
@@ -489,6 +530,9 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
    }
    }
  }
  }


  /**
   * Implements DrupalCacheInterface::isEmpty().
   */
  function isEmpty() {
  function isEmpty() {
    $this->garbageCollection();
    $this->garbageCollection();
    $query = db_select($this->bin);
    $query = db_select($this->bin);
+1359 −653

File changed.

Preview size limit exceeded, changes collapsed.

+272 −151

File changed.

Preview size limit exceeded, changes collapsed.

+6 −5
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: log.inc,v 1.8 2010/03/31 15:09:21 dries Exp $


/**
/**
 * @file
 * @file
@@ -129,9 +128,10 @@ class DatabaseLog {
   * Determine the routine that called this query.
   * Determine the routine that called this query.
   *
   *
   * We define "the routine that called this query" as the first entry in
   * We define "the routine that called this query" as the first entry in
   * the call stack that is not inside includes/database. That makes the
   * the call stack that is not inside includes/database and does have a file
   * climbing logic very simple, and handles the variable stack depth caused
   * (which excludes call_user_func_array(), anonymous functions and similar).
   * by the query builders.
   * That makes the climbing logic very simple, and handles the variable stack
   * depth caused by the query builders.
   *
   *
   * @link http://www.php.net/debug_backtrace
   * @link http://www.php.net/debug_backtrace
   * @return
   * @return
@@ -145,7 +145,8 @@ class DatabaseLog {
    $stack = debug_backtrace();
    $stack = debug_backtrace();
    $stack_count = count($stack);
    $stack_count = count($stack);
    for ($i = 0; $i < $stack_count; ++$i) {
    for ($i = 0; $i < $stack_count; ++$i) {
      if (strpos($stack[$i]['file'], 'includes' . DIRECTORY_SEPARATOR . 'database') === FALSE) {
      if (!empty($stack[$i]['file']) && strpos($stack[$i]['file'], 'includes' . DIRECTORY_SEPARATOR . 'database') === FALSE) {
        $stack[$i] += array('args' => array());
        return array(
        return array(
          'file' => $stack[$i]['file'],
          'file' => $stack[$i]['file'],
          'line' => $stack[$i]['line'],
          'line' => $stack[$i]['line'],
+82 −21
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: database.inc,v 1.34 2010/10/03 01:29:41 dries Exp $


/**
/**
 * @file
 * @file
@@ -7,18 +6,18 @@
 */
 */


/**
/**
 * @ingroup database
 * @addtogroup database
 * @{
 * @{
 */
 */


class DatabaseConnection_mysql extends DatabaseConnection {
class DatabaseConnection_mysql extends DatabaseConnection {


  /**
  /**
   * Flag to indicate if we have registered the nextID cleanup function.
   * Flag to indicate if the cleanup function in __destruct() should run.
   *
   *
   * @var boolean
   * @var boolean
   */
   */
  protected $shutdownRegistered = FALSE;
  protected $needsCleanup = FALSE;


  public function __construct(array $connection_options = array()) {
  public function __construct(array $connection_options = array()) {
    // This driver defaults to transaction support, except if explicitly passed FALSE.
    // This driver defaults to transaction support, except if explicitly passed FALSE.
@@ -38,14 +37,18 @@ class DatabaseConnection_mysql extends DatabaseConnection {
      $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . (empty($connection_options['port']) ? 3306 : $connection_options['port']);
      $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . (empty($connection_options['port']) ? 3306 : $connection_options['port']);
    }
    }
    $dsn .= ';dbname=' . $connection_options['database'];
    $dsn .= ';dbname=' . $connection_options['database'];
    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(
    // Allow PDO options to be overridden.
    $connection_options += array(
      'pdo' => array(),
    );
    $connection_options['pdo'] += array(
      // So we don't have to mess around with cursors and unbuffered queries by default.
      // So we don't have to mess around with cursors and unbuffered queries by default.
      PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,
      PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,
      // Because MySQL's prepared statements skip the query cache, because it's dumb.
      // Because MySQL's prepared statements skip the query cache, because it's dumb.
      PDO::ATTR_EMULATE_PREPARES => TRUE,
      PDO::ATTR_EMULATE_PREPARES => TRUE,
      // Force column names to lower case.
    );
      PDO::ATTR_CASE => PDO::CASE_LOWER,

    ));
    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);


    // Force MySQL to use the UTF-8 character set. Also set the collation, if a
    // Force MySQL to use the UTF-8 character set. Also set the collation, if a
    // certain one has been set; otherwise, MySQL defaults to 'utf8_general_ci'
    // certain one has been set; otherwise, MySQL defaults to 'utf8_general_ci'
@@ -57,12 +60,28 @@ class DatabaseConnection_mysql extends DatabaseConnection {
      $this->exec('SET NAMES utf8');
      $this->exec('SET NAMES utf8');
    }
    }


    // Force MySQL's behavior to conform more closely to SQL standards.
    // Set MySQL init_commands if not already defined.  Default Drupal's MySQL
    // This allows Drupal to run almost seamlessly on many different
    // behavior to conform more closely to SQL standards.  This allows Drupal
    // kinds of database systems. These settings force MySQL to behave
    // to run almost seamlessly on many different kinds of database systems.
    // the same as postgresql, or sqlite in regards to syntax interpretation
    // These settings force MySQL to behave the same as postgresql, or sqlite
    // and invalid data handling. See http://drupal.org/node/344575 for further discussion.
    // in regards to syntax interpretation and invalid data handling.  See
    $this->exec("SET sql_mode='ANSI,TRADITIONAL'");
    // http://drupal.org/node/344575 for further discussion. Also, as MySQL 5.5
    // changed the meaning of TRADITIONAL we need to spell out the modes one by
    // one.
    $connection_options += array(
      'init_commands' => array(),
    );
    $connection_options['init_commands'] += array(
      'sql_mode' => "SET sql_mode = 'ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'",
    );
    // Set connection options.
    $this->exec(implode('; ', $connection_options['init_commands']));
  }

  public function __destruct() {
    if ($this->needsCleanup) {
      $this->nextIdDelete();
    }
  }
  }


  public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
  public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
@@ -102,12 +121,7 @@ class DatabaseConnection_mysql extends DatabaseConnection {
      $this->query('INSERT INTO {sequences} (value) VALUES (:value) ON DUPLICATE KEY UPDATE value = value', array(':value' => $existing_id));
      $this->query('INSERT INTO {sequences} (value) VALUES (:value) ON DUPLICATE KEY UPDATE value = value', array(':value' => $existing_id));
      $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', array(), array('return' => Database::RETURN_INSERT_ID));
      $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', array(), array('return' => Database::RETURN_INSERT_ID));
    }
    }
    if (!$this->shutdownRegistered) {
    $this->needsCleanup = TRUE;
      // Use register_shutdown_function() here to keep the database system
      // independent of Drupal.
      register_shutdown_function(array($this, 'nextIdDelete'));
      $shutdownRegistered = TRUE;
    }
    return $new_id;
    return $new_id;
  }
  }


@@ -134,9 +148,56 @@ class DatabaseConnection_mysql extends DatabaseConnection {
    catch (PDOException $e) {
    catch (PDOException $e) {
    }
    }
  }
  }

  /**
   * Overridden to work around issues to MySQL not supporting transactional DDL.
   */
  protected function popCommittableTransactions() {
    // Commit all the committable layers.
    foreach (array_reverse($this->transactionLayers) as $name => $active) {
      // Stop once we found an active transaction.
      if ($active) {
        break;
      }

      // If there are no more layers left then we should commit.
      unset($this->transactionLayers[$name]);
      if (empty($this->transactionLayers)) {
        if (!PDO::commit()) {
          throw new DatabaseTransactionCommitFailedException();
        }
      }
      else {
        // Attempt to release this savepoint in the standard way.
        try {
          $this->query('RELEASE SAVEPOINT ' . $name);
        }
        catch (PDOException $e) {
          // However, in MySQL (InnoDB), savepoints are automatically committed
          // when tables are altered or created (DDL transactions are not
          // supported). This can cause exceptions due to trying to release
          // savepoints which no longer exist.
          //
          // To avoid exceptions when no actual error has occurred, we silently
          // succeed for MySQL error code 1305 ("SAVEPOINT does not exist").
          if ($e->errorInfo[1] == '1305') {
            // If one SAVEPOINT was released automatically, then all were.
            // Therefore, clean the transaction stack.
            $this->transactionLayers = array();
            // We also have to explain to PDO that the transaction stack has
            // been cleaned-up.
            PDO::commit();
          }
          else {
            throw $e;
          }
        }
      }
    }
  }
}
}




/**
/**
 * @} End of "ingroup database".
 * @} End of "addtogroup database".
 */
 */
+8 −3
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: install.inc,v 1.4 2010/07/30 01:59:14 dries Exp $


/**
/**
 * @file
 * @file
@@ -10,7 +9,6 @@
 * Specifies installation tasks for MySQL and equivalent databases.
 * Specifies installation tasks for MySQL and equivalent databases.
 */
 */
class DatabaseTasks_mysql extends DatabaseTasks {
class DatabaseTasks_mysql extends DatabaseTasks {

  /**
  /**
   * The PDO driver name for MySQL and equivalent databases.
   * The PDO driver name for MySQL and equivalent databases.
   *
   *
@@ -22,7 +20,14 @@ class DatabaseTasks_mysql extends DatabaseTasks {
   * Returns a human-readable name string for MySQL and equivalent databases.
   * Returns a human-readable name string for MySQL and equivalent databases.
   */
   */
  public function name() {
  public function name() {
    return 'MySQL, MariaDB, or equivalent';
    return st('MySQL, MariaDB, or equivalent');
  }

  /**
   * Returns the minimum version for MySQL.
   */
  public function minimumVersion() {
    return '5.0.15';
  }
  }
}
}
+6 −7
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: query.inc,v 1.18 2010/06/26 01:40:05 dries Exp $


/**
/**
 * @ingroup database
 * @addtogroup database
 * @{
 * @{
 */
 */


@@ -43,8 +42,8 @@ class InsertQuery_mysql extends InsertQuery {
  }
  }


  public function __toString() {
  public function __toString() {
    // Create a comments string to prepend to the query.
    // Create a sanitized comment string to prepend to the query.
    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
    $comments = $this->connection->makeComment($this->comments);


    // Default fields are always placed first for consistency.
    // Default fields are always placed first for consistency.
    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
@@ -93,8 +92,8 @@ class TruncateQuery_mysql extends TruncateQuery {
    // not transactional, and result in an implicit COMMIT. When we are in a
    // not transactional, and result in an implicit COMMIT. When we are in a
    // transaction, fallback to the slower, but transactional, DELETE.
    // transaction, fallback to the slower, but transactional, DELETE.
    if ($this->connection->inTransaction()) {
    if ($this->connection->inTransaction()) {
      // Create a comments string to prepend to the query.
      // Create a comment string to prepend to the query.
      $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
      $comments = $this->connection->makeComment($this->comments);
      return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
      return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
    }
    }
    else {
    else {
@@ -104,5 +103,5 @@ class TruncateQuery_mysql extends TruncateQuery {
}
}


/**
/**
 * @} End of "ingroup database".
 * @} End of "addtogroup database".
 */
 */
+11 −7

File changed.

Preview size limit exceeded, changes collapsed.

+38 −11

File changed.

Preview size limit exceeded, changes collapsed.

+65 −3

File changed.

Preview size limit exceeded, changes collapsed.

+2 −95

File changed.

Preview size limit exceeded, changes collapsed.

+74 −13

File changed.

Preview size limit exceeded, changes collapsed.

+108 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −4

File changed.

Preview size limit exceeded, changes collapsed.

+588 −100

File changed.

Preview size limit exceeded, changes collapsed.

+42 −6

File changed.

Preview size limit exceeded, changes collapsed.

+162 −89

File changed.

Preview size limit exceeded, changes collapsed.

+87 −11

File changed.

Preview size limit exceeded, changes collapsed.

+38 −2

File changed.

Preview size limit exceeded, changes collapsed.

+11 −43

File changed.

Preview size limit exceeded, changes collapsed.

+81 −29

File changed.

Preview size limit exceeded, changes collapsed.

+27 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −3

File changed.

Preview size limit exceeded, changes collapsed.

+300 −32

File changed.

Preview size limit exceeded, changes collapsed.

+20 −28

File changed.

Preview size limit exceeded, changes collapsed.

+244 −142

File changed.

Preview size limit exceeded, changes collapsed.

+3 −2

File changed.

Preview size limit exceeded, changes collapsed.

+87 −7

File changed.

Preview size limit exceeded, changes collapsed.

+14 −4

File changed.

Preview size limit exceeded, changes collapsed.

+2 −3

File changed.

Preview size limit exceeded, changes collapsed.

+15 −5

File changed.

Preview size limit exceeded, changes collapsed.

+747 −345

File changed.

Preview size limit exceeded, changes collapsed.

+8 −10

File changed.

Preview size limit exceeded, changes collapsed.

+78 −47

File changed.

Preview size limit exceeded, changes collapsed.

+190 −172

File changed.

Preview size limit exceeded, changes collapsed.

+350 −81

File changed.

Preview size limit exceeded, changes collapsed.

+3 −3

File changed.

Preview size limit exceeded, changes collapsed.

+102 −0

File added.

Preview size limit exceeded, changes collapsed.

+220 −46

File changed.

Preview size limit exceeded, changes collapsed.

+470 −142

File changed.

Preview size limit exceeded, changes collapsed.

+31 −7

File changed.

Preview size limit exceeded, changes collapsed.

+73 −38

File changed.

Preview size limit exceeded, changes collapsed.

+513 −248

File changed.

Preview size limit exceeded, changes collapsed.

+174 −65

File changed.

Preview size limit exceeded, changes collapsed.

+22 −9

File changed.

Preview size limit exceeded, changes collapsed.

+29 −9

File changed.

Preview size limit exceeded, changes collapsed.

+80 −37

File changed.

Preview size limit exceeded, changes collapsed.

+21 −18

File changed.

Preview size limit exceeded, changes collapsed.

+91 −41

File changed.

Preview size limit exceeded, changes collapsed.

+29 −15

File changed.

Preview size limit exceeded, changes collapsed.

+33 −65

File changed.

Preview size limit exceeded, changes collapsed.

+543 −217

File changed.

Preview size limit exceeded, changes collapsed.

+11 −13

File changed.

Preview size limit exceeded, changes collapsed.

+60 −39

File changed.

Preview size limit exceeded, changes collapsed.

+0 −1
Original line number Original line Diff line number Diff line
<?php
<?php
// $Id: unicode.entities.inc,v 1.2 2009/04/26 15:14:55 dries Exp $


/**
/**
 * @file
 * @file