Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentTorregrosa committed Dec 20, 2015
2 parents 805c40e + fcb4984 commit 5da483b
Show file tree
Hide file tree
Showing 605 changed files with 30,259 additions and 24,770 deletions.
23 changes: 0 additions & 23 deletions patches/2460643_incompatble_with_views_cache_2.patch

This file was deleted.

48 changes: 21 additions & 27 deletions scripts/l10n-packaging-fr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,46 @@ echo $result
# Dossier de travail
RESULT=$(currentscriptpath)
DIR="$RESULT/.."
#DRUSH="drush"
DRUSH="/usr/local/bin/drush"

#############
# Version 7
# Version 8
#############
# Telechargement Drupal
/usr/local/bin/drush dl drupal-7 -q --drupal-project-rename=drupal7 --destination=$DIR
$DRUSH dl drupal-8 -q --drupal-project-rename=drupal8 --destination=$DIR

# Detection de version
VERSION=`/usr/local/bin/drush core-status drupal-version --format=list -r $DIR/drupal7`

# Recuperation + copie de la trad de la version
wget http://ftp.drupal.org/files/translations/7.x/drupal/drupal-$VERSION.fr.po --output-document=$DIR/drupal-$VERSION.fr.po --quiet
cp $DIR/drupal-$VERSION.fr.po $DIR/drupal7/profiles/minimal/translations/
cp $DIR/drupal-$VERSION.fr.po $DIR/drupal7/profiles/standard/translations/
rm $DIR/drupal-$VERSION.fr.po
mv $DIR/drupal7 $DIR/drupal-$VERSION

# Tarball
tar cpzf $DIR/scripts/drupal-7.latest.tar.gz --directory $DIR drupal-$VERSION
rm -r $DIR/drupal-$VERSION
VERSION=`cat $DIR/drupal8/core/lib/Drupal.php | grep "const VERSION = " | tail -n 1`
stringlen=$(( ${#VERSION} - 19 - 2 ))
VERSION=${VERSION:19:$stringlen}

# Stockage du numéro de version dans une variable pour affichage sur le site.
/usr/local/bin/drush -r $DIR/www7 vset drupalfr_current_version -q --yes --exact --format="string" "$VERSION"
$DRUSH -r $DIR/www7 vset drupalfr_current_version -q --yes --exact --format="string" "$VERSION"

#############
# Version 6
#############
rm -rf $DIR/drupal8

##############
## Version 7
##############
# Telechargement Drupal
/usr/local/bin/drush dl drupal-6 -q --drupal-project-rename=drupal6 --destination=$DIR
$DRUSH dl drupal-7 -q --drupal-project-rename=drupal7 --destination=$DIR

# Detection de version
VERSION=`/usr/local/bin/drush core-status drupal-version --format=list -r $DIR/drupal6`
VERSION=`$DRUSH core-status drupal-version --format=list -r $DIR/drupal7`

# Recuperation + copie de la trad de la version
wget http://ftp.drupal.org/files/translations/6.x/drupal/drupal-$VERSION.fr.po --output-document=$DIR/drupal-$VERSION.fr.po --quiet
mkdir $DIR/drupal6/profiles/default/translations
cp $DIR/drupal-$VERSION.fr.po $DIR/drupal6/profiles/default/translations/fr.po
wget http://ftp.drupal.org/files/translations/7.x/drupal/drupal-$VERSION.fr.po --output-document=$DIR/drupal-$VERSION.fr.po --quiet
cp $DIR/drupal-$VERSION.fr.po $DIR/drupal7/profiles/minimal/translations/
cp $DIR/drupal-$VERSION.fr.po $DIR/drupal7/profiles/standard/translations/
rm $DIR/drupal-$VERSION.fr.po
mv $DIR/drupal6 $DIR/drupal-$VERSION
mv $DIR/drupal7 $DIR/drupal-$VERSION

# Tarball
tar cpzf $DIR/scripts/drupal-6.latest.tar.gz --directory $DIR drupal-$VERSION
tar cpzf $DIR/scripts/drupal-7.latest.tar.gz --directory $DIR drupal-$VERSION
rm -r $DIR/drupal-$VERSION

# Stockage du numéro de version dans une variable pour affichage sur le site.
/usr/local/bin/drush -r $DIR/www7 vset drupalfr_previous_version -q --yes --exact --format="string" "$VERSION"
$DRUSH -r $DIR/www7 vset drupalfr_previous_version -q --yes --exact --format="string" "$VERSION"

exit

6 changes: 6 additions & 0 deletions www7/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,9 @@ DirectoryIndex index.php index.html index.htm
</FilesMatch>
</IfModule>
</IfModule>

# Add headers to all responses.
<IfModule mod_headers.c>
# Disable content sniffing, since it's an attack vector.
Header always set X-Content-Type-Options nosniff
</IfModule>
4 changes: 2 additions & 2 deletions www7/includes/batch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ function _batch_finished() {
if (isset($batch_set['file']) && is_file($batch_set['file'])) {
include_once DRUPAL_ROOT . '/' . $batch_set['file'];
}
if (function_exists($batch_set['finished'])) {
if (is_callable($batch_set['finished'])) {
$queue = _batch_queue($batch_set);
$operations = $queue->getAllItems();
$batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
call_user_func($batch_set['finished'], $batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000));
}
}
}
Expand Down
35 changes: 30 additions & 5 deletions www7/includes/bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* The current system version.
*/
define('VERSION', '7.39');
define('VERSION', '7.41');

/**
* Core API compatibility.
Expand Down Expand Up @@ -1055,7 +1055,7 @@ function drupal_page_get_cache($check_only = FALSE) {
* Determines the cacheability of the current page.
*
* @param $allow_caching
* Set to FALSE if you want to prevent this page to get cached.
* Set to FALSE if you want to prevent this page from being cached.
*
* @return
* TRUE if the current page can be cached, FALSE otherwise.
Expand Down Expand Up @@ -1262,6 +1262,10 @@ function drupal_page_header() {
$default_headers = array(
'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT',
'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0',
// Prevent browsers from sniffing a response and picking a MIME type
// different from the declared content-type, since that can lead to
// XSS and other vulnerabilities.
'X-Content-Type-Options' => 'nosniff',
);
drupal_send_headers($default_headers);
}
Expand Down Expand Up @@ -1776,7 +1780,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
* @see theme_status_messages()
*/
function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
if ($message) {
if ($message || $message === '0' || $message === 0) {
if (!isset($_SESSION['messages'][$type])) {
$_SESSION['messages'][$type] = array();
}
Expand Down Expand Up @@ -2464,6 +2468,9 @@ function _drupal_bootstrap_database() {
// the install or upgrade process.
spl_autoload_register('drupal_autoload_class');
spl_autoload_register('drupal_autoload_interface');
if (version_compare(PHP_VERSION, '5.4') >= 0) {
spl_autoload_register('drupal_autoload_trait');
}
}

/**
Expand Down Expand Up @@ -2952,7 +2959,9 @@ function ip_address() {
* Gets the schema definition of a table, or the whole database schema.
*
* The returned schema will include any modifications made by any
* module that implements hook_schema_alter().
* module that implements hook_schema_alter(). To get the schema without
* modifications, use drupal_get_schema_unprocessed().
*
*
* @param $table
* The name of the table. If not given, the schema of all tables is returned.
Expand Down Expand Up @@ -3107,6 +3116,22 @@ function drupal_autoload_class($class) {
return _registry_check_code('class', $class);
}

/**
* Confirms that a trait is available.
*
* This function is rarely called directly. Instead, it is registered as an
* spl_autoload() handler, and PHP calls it for us when necessary.
*
* @param string $trait
* The name of the trait to check or load.
*
* @return bool
* TRUE if the trait is currently available, FALSE otherwise.
*/
function drupal_autoload_trait($trait) {
return _registry_check_code('trait', $trait);
}

/**
* Checks for a resource in the registry.
*
Expand All @@ -3125,7 +3150,7 @@ function drupal_autoload_class($class) {
function _registry_check_code($type, $name = NULL) {
static $lookup_cache, $cache_update_needed;

if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name) || $type == 'trait' && trait_exists($name)) {
return TRUE;
}

Expand Down
1 change: 1 addition & 0 deletions www7/includes/cache.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* @param $bin
* The cache bin for which the cache object should be returned.
*
* @return DrupalCacheInterface
* The cache object associated with the specified bin.
*
Expand Down
69 changes: 52 additions & 17 deletions www7/includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,12 @@ function drupal_http_request($url, array $options = array()) {

switch ($code) {
case 200: // OK
case 201: // Created
case 202: // Accepted
case 203: // Non-Authoritative Information
case 204: // No Content
case 205: // Reset Content
case 206: // Partial Content
case 304: // Not modified
break;
case 301: // Moved permanently
Expand Down Expand Up @@ -2812,11 +2818,11 @@ function drupal_map_assoc($array, $function = NULL) {
* into script execution a call such as set_time_limit(20) is made, the
* script will run for a total of 45 seconds before timing out.
*
* It also means that it is possible to decrease the total time limit if
* the sum of the new time limit and the current time spent running the
* script is inferior to the original time limit. It is inherent to the way
* set_time_limit() works, it should rather be called with an appropriate
* value every time you need to allocate a certain amount of time
* If the current time limit is not unlimited it is possible to decrease the
* total time limit if the sum of the new time limit and the current time spent
* running the script is inferior to the original time limit. It is inherent to
* the way set_time_limit() works, it should rather be called with an
* appropriate value every time you need to allocate a certain amount of time
* to execute a task than only once at the beginning of the script.
*
* Before calling set_time_limit(), we check if this function is available
Expand All @@ -2833,7 +2839,11 @@ function drupal_map_assoc($array, $function = NULL) {
*/
function drupal_set_time_limit($time_limit) {
if (function_exists('set_time_limit')) {
@set_time_limit($time_limit);
$current = ini_get('max_execution_time');
// Do not set time limit if it is currently unlimited.
if ($current != 0) {
@set_time_limit($time_limit);
}
}
}

Expand Down Expand Up @@ -5212,6 +5222,11 @@ function _drupal_bootstrap_full() {
fix_gpc_magic();
// Load all enabled modules
module_load_all();
// Reset drupal_alter() and module_implements() static caches as these
// include implementations for vital modules only when called early on
// in the bootstrap.
drupal_static_reset('drupal_alter');
drupal_static_reset('module_implements');
// Make sure all stream wrappers are registered.
file_get_stream_wrappers();
// Ensure mt_rand is reseeded, to prevent random values from one page load
Expand Down Expand Up @@ -5308,8 +5323,8 @@ function drupal_page_set_cache() {
*
* Do not call this function from a test. Use $this->cronRun() instead.
*
* @return
* TRUE if cron ran successfully.
* @return bool
* TRUE if cron ran successfully and FALSE if cron is already running.
*/
function drupal_cron_run() {
// Allow execution to continue even if the request gets canceled.
Expand Down Expand Up @@ -5371,12 +5386,12 @@ function drupal_cron_run() {
// Do not run if queue wants to skip.
continue;
}
$function = $info['worker callback'];
$callback = $info['worker callback'];
$end = time() + (isset($info['time']) ? $info['time'] : 15);
$queue = DrupalQueue::get($queue_name);
while (time() < $end && ($item = $queue->claimItem())) {
try {
$function($item->data);
call_user_func($callback, $item->data);
$queue->deleteItem($item);
}
catch (Exception $e) {
Expand Down Expand Up @@ -7083,7 +7098,8 @@ function drupal_uninstall_schema($module) {
* specification of a schema, as it was defined in a module's
* hook_schema(). No additional default values will be set,
* hook_schema_alter() is not invoked and these unprocessed
* definitions won't be cached.
* definitions won't be cached. To retrieve the schema after
* hook_schema_alter() has been invoked use drupal_get_schema().
*
* This function can be used to retrieve a schema specification in
* hook_schema(), so it allows you to derive your tables from existing
Expand Down Expand Up @@ -7156,6 +7172,7 @@ function _drupal_schema_initialize(&$schema, $module, $remove_descriptions = TRU
*/
function drupal_schema_field_types($table) {
$table_schema = drupal_get_schema($table);
$field_types = array();
foreach ($table_schema['fields'] as $field_name => $field_info) {
$field_types[$field_name] = isset($field_info['type']) ? $field_info['type'] : NULL;
}
Expand Down Expand Up @@ -7363,7 +7380,16 @@ function drupal_write_record($table, &$record, $primary_keys = array()) {
* Information stored in a module .info file:
* - name: The real name of the module for display purposes.
* - description: A brief description of the module.
* - dependencies: An array of shortnames of other modules this module requires.
* - dependencies: An array of dependency strings. Each is in the form
* 'project:module (versions)'; with the following meanings:
* - project: (optional) Project shortname, recommended to ensure uniqueness,
* if the module is part of a project hosted on drupal.org. If omitted,
* also omit the : that follows. The project name is currently ignored by
* Drupal core but is used for automated testing.
* - module: (required) Module shortname within the project.
* - (versions): Optional version information, consisting of one or more
* comma-separated operator/value pairs or simply version numbers, which
* can contain "x" as a wildcard. Examples: (>=7.22, <7.28), (7.x-3.x).
* - package: The name of the package of modules this module belongs to.
*
* See forum.info for an example of a module .info file.
Expand Down Expand Up @@ -7443,7 +7469,6 @@ function drupal_parse_info_file($filename) {
*/
function drupal_parse_info_format($data) {
$info = array();
$constants = get_defined_constants();

if (preg_match_all('
@^\s* # Start at the beginning of a line, ignoring leading whitespace
Expand Down Expand Up @@ -7483,8 +7508,8 @@ function drupal_parse_info_format($data) {
}

// Handle PHP constants.
if (isset($constants[$value])) {
$value = $constants[$value];
if (preg_match('/^\w+$/i', $value) && defined($value)) {
$value = constant($value);
}

// Insert actual value.
Expand Down Expand Up @@ -7648,7 +7673,12 @@ function debug($data, $label = NULL, $print_r = FALSE) {
* Parses a dependency for comparison by drupal_check_incompatibility().
*
* @param $dependency
* A dependency string, for example 'foo (>=7.x-4.5-beta5, 3.x)'.
* A dependency string, which specifies a module dependency, and optionally
* the project it comes from and versions that are supported. Supported
* formats include:
* - 'module'
* - 'project:module'
* - 'project:module (>=version, version)'
*
* @return
* An associative array with three keys:
Expand All @@ -7663,6 +7693,12 @@ function debug($data, $label = NULL, $print_r = FALSE) {
* @see drupal_check_incompatibility()
*/
function drupal_parse_dependency($dependency) {
$value = array();
// Split out the optional project name.
if (strpos($dependency, ':')) {
list($project_name, $dependency) = explode(':', $dependency);
$value['project'] = $project_name;
}
// We use named subpatterns and support every op that version_compare
// supports. Also, op is optional and defaults to equals.
$p_op = '(?P<operation>!=|==|=|<|<=|>|>=|<>)?';
Expand All @@ -7671,7 +7707,6 @@ function drupal_parse_dependency($dependency) {
$p_major = '(?P<major>\d+)';
// By setting the minor version to x, branches can be matched.
$p_minor = '(?P<minor>(?:\d+|x)(?:-[A-Za-z]+\d+)?)';
$value = array();
$parts = explode('(', $dependency, 2);
$value['name'] = trim($parts[0]);
if (isset($parts[1])) {
Expand Down
2 changes: 1 addition & 1 deletion www7/includes/database/database.inc
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ abstract class DatabaseConnection extends PDO {
* @return DatabaseStatementInterface
* This method will return one of: the executed statement, the number of
* rows affected by the query (not the number matched), or the generated
* insert IT of the last query, depending on the value of
* insert ID of the last query, depending on the value of
* $options['return']. Typically that value will be set by default or a
* query builder and should not be set by a user. If there is an error,
* this method will return NULL and may throw an exception if
Expand Down
Loading

0 comments on commit 5da483b

Please sign in to comment.