-
The
SilentSitemapBuilder
was removed. -
The
SymfonySitemapBuilder
was removed. -
The
CompressFileStream
was removed. -
The
RenderBzip2FileStream
was removed. -
The
Stream
not extendsCountable
interface. -
The
UrlBuilder
not extendsCountable
interface and not requiregetName
method. -
The
UrlBuilderCollection
changed toMultiUrlBuilder
. -
The
CompressionLevelException
changed to final. -
The
FileAccessException
changed to final. -
The
LinksOverflowException
changed to final. -
The
OverflowException
changed to abstract. -
The
SizeOverflowException
changed to final. -
The
StreamStateException
changed to final. -
The
$compression_level
inRenderGzipFileStream
can be only integer. -
Move
CHANGE_FREQ_*
constants fromURL
class to newChangeFrequency
class. -
Mark
STATE_*
constants inStreamState
class as private. -
The
Url::getLoc()
was renamed toUrl::getLocation()
method. -
The
Url::getLastMod()
was renamed toUrl::getLastModify()
method. -
The
Url::getChangeFreq()
was renamed toUrl::getChangeFrequency()
method. -
The arguments of
PlainTextSitemapRender::sitemap()
was changed.Before:
$render = PlainTextSitemapRender::sitemap(string $path, ?\DateTimeInterface $last_modify = null)
After:
$render = PlainTextSitemapRender::sitemap(Sitemap $sitemap)
-
The
$host
argument inRenderIndexFileStream::__construct()
was removed. -
The
$web_path
argument inPlainTextSitemapIndexRender::__construct()
was removed.Before:
$web_path = 'https://example.com/'; $index_render = new PlainTextSitemapIndexRender(); $index_stream = new RenderFileStream($index_render, $stream, $web_path, $filename_index);
After:
$index_render = new PlainTextSitemapIndexRender(); $index_stream = new RenderFileStream($index_render, $stream, $filename_index);
-
The
CallbackStream
was removed. -
The
RenderGzipFileStream
was removed. UseWritingStream
instead.Before:
$stream = new RenderGzipFileStream($render, $filename, $compression_level);
After:
$stream = new WritingStream($render, new GzipTempFileWriter($compression_level), $filename);
-
The
RenderFileStream
was removed. UseWritingStream
instead.Before:
$stream = new RenderFileStream($render, $filename);
After:
$stream = new WritingStream($render, new TempFileWriter(), $filename);
-
The
FileStream
was removed. -
The
RenderIndexFileStream
was removed. UseWritingSplitIndexStream
instead.Before:
$web_path = 'https://example.com'; $filename_index = __DIR__.'/sitemap.xml'; $filename_part = sys_get_temp_dir().'/sitemap.xml'; $render = new PlainTextSitemapRender(); $stream = new RenderFileStream($render, $filename_part) $index_render = new PlainTextSitemapIndexRender(); $index_stream = new RenderIndexFileStream($index_render, $stream, $web_path, $filename_index);
After:
$index_filename = __DIR__.'/sitemap.xml'; $part_filename = __DIR__.'/sitemap%d.xml'; $part_web_path = 'https://example.com/sitemap%d.xml'; $index_render = new PlainTextSitemapIndexRender(); $index_writer = new TempFileWriter(); $part_render = new PlainTextSitemapRender(); $part_writer = new TempFileWriter(); $stream = new WritingSplitIndexStream( $index_render, $part_render, $index_writer, $part_writer, $index_filename, $part_filename, $part_web_path );
-
The
CompressionLevelException
was removed. -
The
FileAccessException
was removed. -
The
Stream::LINKS_LIMIT
constants was removed. UseLimiter::LINKS_LIMIT
instead. -
The
Stream::BYTE_LIMIT
constants was removed. UseLimiter::BYTE_LIMIT
instead. -
The return value of
Url::getLocation()
was changed to aLocation
object. -
The return value of
Url::getChangeFrequency()
was changed to aChangeFrequency
object. -
The
Url
changed to final. -
The
Url::__construct
require objects as arguments.Before:
$url = new Url('/contacts.html', new \DateTimeImmutable('-1 month'), ChangeFrequency::MONTHLY, '0.7');
After:
$url = Url::create('https://example.com/contacts.html', new \DateTimeImmutable('-1 month'), ChangeFrequency::MONTHLY, '0.7');
Or
$url = new Url( new Location('https://example.com/contacts.html'), new \DateTimeImmutable('-1 month'), ChangeFrequency::monthly(), Priority::create(7) );
-
The
SmartUrl
was removed.Before:
$url = new SmartUrl('/article/123');
After:
$url = Url::createSmart('https://example.com/article/123');
-
Use absolute URL in
Url
class.Before:
$url = Url::create('/contacts.html');
After:
$url = Url::create('https://example.com/contacts.html');
-
Allow use
int
andfloat
as$priority
inURL
class.Before:
$url = Url::create('/contacts.html', new \DateTimeImmutable('-1 month'), ChangeFrequency::MONTHLY, '0.7');
After:
$url = Url::create('https://example.com/contacts.html', new \DateTimeImmutable('-1 month'), ChangeFrequency::monthly(), 7); $url = Url::create('https://example.com/contacts.html', new \DateTimeImmutable('-1 month'), ChangeFrequency::monthly(), .7);