original_string: public function create_store_from_config($name, array $details, cache_definition $definition) {
          if (!array_key_exists($name, $this->stores)) {
              // Properties: name, plugin, configuration, class.
              $class = $details['class'];
              if (!$class::are_requirements_met()) {
                  return false;
              }
              $store = new $class($details['name'], $details['configuration']);
              $this->stores[$name] = $store;
          }
          /* @var cache_store $store */
          $store = $this->stores[$name];
          // We check are_requirements_met although we expect is_ready is going to check as well.
          if (!$store::are_requirements_met() || !$store->is_ready() || !$store->is_supported_mode($definition->get_mode())) {
              return false;
          }
          // We always create a clone of the original store.
          // If we were to clone a store that had already been initialised with a definition then
          // we'd run into a myriad of issues.
          // We use a method of the store to create a clone rather than just creating it ourselves
          // so that if any store out there doesn't handle cloning they can override this method in
          // order to address the issues.
          $store = $this->stores[$name]->create_clone($details);
          $store->initialise($definition);
          $definitionid = $definition->get_id();
          if (!isset($this->definitionstores[$definitionid])) {
              $this->definitionstores[$definitionid] = array();
          }
          $this->definitionstores[$definitionid][] = $store;
          return $store;
      }
code: public function create_store_from_config($name, array $details, cache_definition $definition) {
          if (!array_key_exists($name, $this->stores)) {
              // Properties: name, plugin, configuration, class.
              $class = $details['class'];
              if (!$class::are_requirements_met()) {
                  return false;
              }
              $store = new $class($details['name'], $details['configuration']);
              $this->stores[$name] = $store;
          }
          /* @var cache_store $store */
          $store = $this->stores[$name];
          // We check are_requirements_met although we expect is_ready is going to check as well.
          if (!$store::are_requirements_met() || !$store->is_ready() || !$store->is_supported_mode($definition->get_mode())) {
              return false;
          }
          // We always create a clone of the original store.
          // If we were to clone a store that had already been initialised with a definition then
          // we'd run into a myriad of issues.
          // We use a method of the store to create a clone rather than just creating it ourselves
          // so that if any store out there doesn't handle cloning they can override this method in
          // order to address the issues.
          $store = $this->stores[$name]->create_clone($details);
          $store->initialise($definition);
          $definitionid = $definition->get_id();
          if (!isset($this->definitionstores[$definitionid])) {
              $this->definitionstores[$definitionid] = array();
          }
          $this->definitionstores[$definitionid][] = $store;
          return $store;
      }
code_tokens: public function create_store_from_config ( $ name , array $ details , cache_definition $ definition ) { if ( ! array_key_exists ( $ name , $ this -> stores ) ) { // Properties: name, plugin, configuration, class. $ class = $ details [ 'class' ] ; if ( ! $ class :: are_requirements_met ( ) ) { return false ; } $ store = new $ class ( $ details [ 'name' ] , $ details [ 'configuration' ] ) ; $ this -> stores [ $ name ] = $ store ; } /* @var cache_store $store */ $ store = $ this -> stores [ $ name ] ; // We check are_requirements_met although we expect is_ready is going to check as well. if ( ! $ store :: are_requirements_met ( ) || ! $ store -> is_ready ( ) || ! $ store -> is_supported_mode ( $ definition -> get_mode ( ) ) ) { return false ; } // We always create a clone of the original store. // If we were to clone a store that had already been initialised with a definition then // we'd run into a myriad of issues. // We use a method of the store to create a clone rather than just creating it ourselves // so that if any store out there doesn't handle cloning they can override this method in // order to address the issues. $ store = $ this -> stores [ $ name ] -> create_clone ( $ details ) ; $ store -> initialise ( $ definition ) ; $ definitionid = $ definition -> get_id ( ) ; if ( ! isset ( $ this -> definitionstores [ $ definitionid ] ) ) { $ this -> definitionstores [ $ definitionid ] = array ( ) ; } $ this -> definitionstores [ $ definitionid ] [ ] = $ store ; return $ store ; }
docstring: Creates a store instance given its name and configuration.
  
  If the store has already been instantiated then the original object will be returned. (reused)
  
  @param string $name The name of the store (must be unique remember)
  @param array $details
  @param cache_definition $definition The definition to instantiate it for.
  @return boolean|cache_store
docstring_tokens: Creates a store instance given its name and configuration .