Skip to content

Releases: gpslab/sitemap

Release 2.0.1

14 May 11:30
aecd491
Compare
Choose a tag to compare

Changelog (since 2.0.0...2.0.1)

Release 2.0.0

02 Mar 16:08
ddc67fb
Compare
Choose a tag to compare

Changelog (since 1.1.4...2.0.0)

Upgrade from 1.1 to 2.0

  • The SilentSitemapBuilder was removed.

  • The SymfonySitemapBuilder was removed.

  • The CompressFileStream was removed.

  • The RenderBzip2FileStream was removed.

  • The Stream not extends Countable interface.

  • The UrlBuilder not extends Countable interface and not require getName method.

  • The UrlBuilderCollection changed to MultiUrlBuilder.

  • 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 in RenderGzipFileStream can be only integer.

  • Move CHANGE_FREQ_* constants from URL class to new ChangeFrequency class.

  • Mark STATE_* constants in StreamState class as private.

  • The Url::getLoc() was renamed to Url::getLocation() method.

  • The Url::getLastMod() was renamed to Url::getLastModify() method.

  • The Url::getChangeFreq() was renamed to Url::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 in RenderIndexFileStream::__construct() was removed.

  • The $web_path argument in PlainTextSitemapIndexRender::__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. Use WritingStream instead.

    Before:

    $stream = new RenderGzipFileStream($render, $filename, $compression_level);

    After:

    $stream = new WritingStream($render, new GzipTempFileWriter($compression_level), $filename);
  • The RenderFileStream was removed. Use WritingStream instead.

    Before:

    $stream = new RenderFileStream($render, $filename);

    After:

    $stream = new WritingStream($render, new TempFileWriter(), $filename);
  • The FileStream was removed.

  • The RenderIndexFileStream was removed. Use WritingSplitIndexStream 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. Use Limiter::LINKS_LIMIT instead.

  • The Stream::BYTE_LIMIT constants was removed. Use Limiter::BYTE_LIMIT instead.

  • The return value of Url::getLocation() was changed to a Location object.

  • The return value of Url::getChangeFrequency() was changed to a ChangeFrequency 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 and float as $priority in URL 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);

Release 1.1.4

24 Feb 11:05
1c699cc
Compare
Choose a tag to compare

Changelog (since 1.1.3...1.1.4)

Release 1.1.3

23 Jun 08:15
5290673
Compare
Choose a tag to compare

Changelog (since 1.1.2...1.1.3)

Release 1.1.2

16 Oct 13:07
896c08b
Compare
Choose a tag to compare

Changelog (since 1.1.1...1.1.2)

Release 1.1.1

08 Aug 13:16
573b646
Compare
Choose a tag to compare

Changelog (since 1.1.0...1.1.1)

Release 1.1.0

14 Jun 16:20
74095d0
Compare
Choose a tag to compare

Changelog (since v1.0.4...v1.1.0)

Release 1.0.4

01 Mar 21:13
76dd0df
Compare
Choose a tag to compare

Changelog (since v1.0.3...v1.0.4)

Release 1.0.3

08 Feb 10:12
447befc
Compare
Choose a tag to compare

Changelog (since v1.0.2...v1.0.3)

Release 1.0.2

08 Dec 11:03
e0427a2
Compare
Choose a tag to compare

Changelog (since v1.0.1...v1.0.2)