original_string: protected static function get_possible_locks_for_stores($plugindir, $plugin) {
          global $CFG; // Needed for includes.
          $supportsnativelocking = false;
          if (file_exists($plugindir.'/lib.php')) {
              require_once($plugindir.'/lib.php');
              $pluginclass = 'cachestore_'.$plugin;
              if (class_exists($pluginclass)) {
                  $supportsnativelocking = array_key_exists('cache_is_lockable', class_implements($pluginclass));
              }
          }
  
          if (!$supportsnativelocking) {
              $config = cache_config::instance();
              $locks = array();
              foreach ($config->get_locks() as $lock => $conf) {
                  if (!empty($conf['default'])) {
                      $name = get_string($lock, 'cache');
                  } else {
                      $name = $lock;
                  }
                  $locks[$lock] = $name;
              }
          } else {
              $locks = false;
          }
  
          return $locks;
      }
code: protected static function get_possible_locks_for_stores($plugindir, $plugin) {
          global $CFG; // Needed for includes.
          $supportsnativelocking = false;
          if (file_exists($plugindir.'/lib.php')) {
              require_once($plugindir.'/lib.php');
              $pluginclass = 'cachestore_'.$plugin;
              if (class_exists($pluginclass)) {
                  $supportsnativelocking = array_key_exists('cache_is_lockable', class_implements($pluginclass));
              }
          }
  
          if (!$supportsnativelocking) {
              $config = cache_config::instance();
              $locks = array();
              foreach ($config->get_locks() as $lock => $conf) {
                  if (!empty($conf['default'])) {
                      $name = get_string($lock, 'cache');
                  } else {
                      $name = $lock;
                  }
                  $locks[$lock] = $name;
              }
          } else {
              $locks = false;
          }
  
          return $locks;
      }
code_tokens: protected static function get_possible_locks_for_stores ( $ plugindir , $ plugin ) { global $ CFG ; // Needed for includes. $ supportsnativelocking = false ; if ( file_exists ( $ plugindir . '/lib.php' ) ) { require_once ( $ plugindir . '/lib.php' ) ; $ pluginclass = 'cachestore_' . $ plugin ; if ( class_exists ( $ pluginclass ) ) { $ supportsnativelocking = array_key_exists ( 'cache_is_lockable' , class_implements ( $ pluginclass ) ) ; } } if ( ! $ supportsnativelocking ) { $ config = cache_config :: instance ( ) ; $ locks = array ( ) ; foreach ( $ config -> get_locks ( ) as $ lock => $ conf ) { if ( ! empty ( $ conf [ 'default' ] ) ) { $ name = get_string ( $ lock , 'cache' ) ; } else { $ name = $ lock ; } $ locks [ $ lock ] = $ name ; } } else { $ locks = false ; } return $ locks ; }
docstring: Returns an array of suitable lock instances for use with this plugin, or false if the plugin handles locking itself.
  
  @param string $plugindir
  @param string $plugin
  @return array|false
docstring_tokens: Returns an array of suitable lock instances for use with this plugin or false if the plugin handles locking itself .