code: public static function stripRootDir($path)
  	{
  		$rootDir = System::getContainer()->getParameter('kernel.project_dir');
  		$length = \strlen($rootDir);
  
  		if (strncmp($path, $rootDir, $length) !== 0 || \strlen($path) <= $length || ($path[$length] !== '/' && $path[$length] !== '\\'))
  		{
  			throw new \InvalidArgumentException(sprintf('Path "%s" is not inside the Contao root dir "%s"', $path, $rootDir));
  		}
  
  		return (string) substr($path, $length + 1);
  	}
docs: Strip the Contao root dir from the given absolute path
  
  @param string $path
  
  @return string
  
  @throws \InvalidArgumentException