Projet

Général

Profil

Révision a192dc0b

Ajouté par Assos Assos il y a environ 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/feeds/includes/FeedsConfigurable.inc
15 15
 * Base class for configurable classes. Captures configuration handling, form
16 16
 * handling and distinguishes between in-memory configuration and persistent
17 17
 * configuration.
18
 *
19
 * Due to the magic method __get(), protected properties from this class and
20
 * from classes that extend this class will be publicly readable (but not
21
 * writeable).
18 22
 */
19 23
abstract class FeedsConfigurable {
20 24

  
......
55 59
    if (!strlen($id)) {
56 60
      throw new InvalidArgumentException(t('Empty configuration identifier.'));
57 61
    }
58
    static $instances = array();
62

  
63
    $instances = &drupal_static(__METHOD__, array());
64

  
59 65
    if (!isset($instances[$class][$id])) {
60 66
      $instances[$class][$id] = new $class($id);
61 67
    }
......
137 143
  }
138 144

  
139 145
  /**
140
   * Override magic method __get(). Make sure that $this->config goes through
141
   * getConfig().
146
   * Overrides magic method __get().
147
   *
148
   * - Makes sure that external reads of FeedsConfigurable::config go through
149
   *   ::getConfig();
150
   * - Makes private and protected properties from this class and protected
151
   *   properties from child classes publicly readable.
152
   * - Prevents warnings when accessing non-existent properties.
142 153
   */
143 154
  public function __get($name) {
144 155
    if ($name == 'config') {

Formats disponibles : Unified diff