Return the source information.

@param string $source Not the reference, just the source.
@return string|null
164059
public function get_file_source_info($source) {
        global $USER;
        list($type, $fileid, $filename) = $this->split_part($source);
        return 'Box ('. fullname($USER) . '): ' . $filename;
    }
548134
protected function findDataSource($source)
    {
        foreach ($this->dataSources as $dataSource) {
            if ($dataSource->supports($source)) {
                return $dataSource;
            }
        }

        throw new \RuntimeException('Unknown source type');
    }
737296
protected function &getSource($src)
	{
		if (!isset($this->sources[$src]))
		{
			if (is_readable($src))
			{
				$this->sources[$src] = self::splitLines(file_get_contents($src));
			}
			else
			{
				$this->sources[$src] = null;
			}
		}

		return $this->sources[$src];
	}
1243975
public function paths(Source $source = null) {
		if ($source) {
			$this->applyStrategy($source);
		}
		return $this->_paths;
	}
1133168
public function convertToString($source)
    {
        if (is_object($source)) {
            if ($source instanceof NamedInterface) {
                return $source->getName();
            } elseif (method_exists($source, '__toString')) {
                return (string) $source;
            } else {
                return get_class($source);
            }
        } elseif (is_scalar($source) || is_null($source)) {
            return (string) $source;
        } else {
            return gettype($source);
        }
    }
158471
public function getSourceChildPropertiesToBeConverted($source) {
		if (is_string($source)) {
			$source = [
				'payload' => [
					'__identity' => $source,
				]
			];
		} elseif (isset($source['__identity'])) {
			$source['payload'] = [
				'__identity' => $source['__identity'],
			];
			unset($source['__identity']);
		} elseif (!isset($source['payload'])) {
			$source['payload'] = [];
		}
		$source = parent::getSourceChildPropertiesToBeConverted($source);
		return $source;
	}
892560
protected static function editorLink($source)
    {
        if (is_string($source) === true) {
            $file = $source;
            $line = null;
        } else {
            $file = $source[0];
            $line = $source[1];
        }

        return Helpers::editorLink($file, $line);
    }
1021477
protected function getRequestParams(&$source, $key = null, $default = null)
    {
        // If $key is NULL, it means that the whole $source is requested
        if (!isset($key) || $key == null) {
            $key = array_keys($source);
        }

        if (is_array($key)) {
            $output = [];
            foreach ($key as $k) {
                $output[$k] = $this->getRequestParams($source, $k);
            }

            return $output;
        }

        if (isset($source[$key])) {
            $value = $source[$key];
        } else {
            return $default;
        }

        return $value;
    }
420541
public function get_file_reference($source) {
        if ($source && $this->has_moodle_files()) {
            $params = @json_decode(base64_decode($source), true);
            if (!is_array($params) || empty($params['contextid'])) {
                throw new repository_exception('invalidparams', 'repository');
            }
            $params = array(
                'component' => empty($params['component']) ? ''   : clean_param($params['component'], PARAM_COMPONENT),
                'filearea'  => empty($params['filearea'])  ? ''   : clean_param($params['filearea'], PARAM_AREA),
                'itemid'    => empty($params['itemid'])    ? 0    : clean_param($params['itemid'], PARAM_INT),
                'filename'  => empty($params['filename'])  ? null : clean_param($params['filename'], PARAM_FILE),
                'filepath'  => empty($params['filepath'])  ? null : clean_param($params['filepath'], PARAM_PATH),
                'contextid' => clean_param($params['contextid'], PARAM_INT)
            );
            // Check if context exists.
            if (!context::instance_by_id($params['contextid'], IGNORE_MISSING)) {
                throw new repository_exception('invalidparams', 'repository');
            }
            return file_storage::pack_reference($params);
        }
        return $source;
    }
1220837
public function getPaths($source)
    {
        $source = $this->cleanSource($source);
        list(, $paths) = $this->parse($source);

        return $paths;
    }
110261
public function source($source = null)
    {
        $model = $this->noInitModel;
        if (!is_string($model->sourceAttribute)) {
            return $this;
        }
        if (!is_string($source)) {
            $modelClass = $this->modelClass;
            $source = $modelClass::$sourceSelf;
        }
        return $this->andWhere([$model->sourceAttribute => $source]);
    }
990893
public function getSource($key)
    {
        $unit = $this->searchForId($key);

        $source = $this->getXPathFirstItem('xliff:source', $unit);
        if ($source && $source->firstChild) {
            return $source->firstChild->nodeValue;
        }

        return null;
    }
755922
public function get($source)
    {
        list(, $paths, $path) = $this->parse($source);
        return $this->find($paths, $path);
    }
1134820
public static function get_google_locale($source) {
		$locale = self::parse_source_path('raw.locale', $source);
		if(!$locale) {
			return self::get_smart_locale();
		}
		return str_replace('-', '_', $locale);
	}
1087674
public function read($source) {
		$source = $this->escapePath($source);
		// since returned stream is closed by the caller we need to create a new instance
		// since we can't re-use the same file descriptor over multiple calls
		$connection = $this->getConnection();

		$connection->write('get ' . $source . ' ' . $this->system->getFD(5));
		$connection->write('exit');
		$fh = $connection->getFileOutputStream();
		stream_context_set_option($fh, 'file', 'connection', $connection);
		return $fh;
	}
334201
public function getHeaders( $source, $continue = true )
  {
    if ( false !== ( $separator_pos = strpos( $source, "\r\n\r\n" ) ) )
    {
      if ( $continue && false !== strpos( $source, 'HTTP/1.1 100 Continue' ) )
      {
        $source = trim( substr( $source, $separator_pos + 4 ) );
        $source = $this->getHeaders( $source, false );
      }
      else
      {
        $source = trim( substr( $source, 0, $separator_pos ) );
      }

      return $source;
    }

    return '';
  }
291398
public function get_file_reference($source) {
        // Internally we store serialized value but user input is json-encoded for security reasons.
        $ref = json_decode(base64_decode($source));
        $filename  = clean_param($ref->filename, PARAM_FILE);
        $url = clean_param($ref->url, PARAM_URL);
        return base64_encode(serialize((object)array('url' => $url, 'filename' => $filename)));
    }