承接 fayyaztech/sitemap-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fayyaztech/sitemap-generator

Composer 安装命令:

composer require fayyaztech/sitemap-generator

包简介

The PHP Sitemap Generator is a versatile and easy-to-use tool that empowers developers to effortlessly create sitemaps for their websites. With support for various sitemap formats, including XML, ROR, HTML, and URLLIST, this library simplifies the process of generating essential files to enhance sea

README 文档

README

Description:

The PHP Sitemap Generator is a versatile and easy-to-use tool that empowers developers to effortlessly create sitemaps for their websites. With support for various sitemap formats, including XML, ROR, HTML, and URLLIST, this library simplifies the process of generating essential files to enhance search engine optimization (SEO) and ensure efficient indexing of web content.

Key Features:

  • XML Sitemaps: Generate standard XML sitemaps to facilitate search engine discovery of your website's URLs.
  • ROR Sitemaps: Create ROR (Resources of a Resource) XML files, providing additional metadata about your content.
  • HTML Sitemaps: Generate HTML sitemaps for human-readable navigation, enhancing user experience and site accessibility.
  • URL List: Produce URLLIST files, a plain-text list of URLs, suitable for various applications and indexing purposes.

Requirements:

  • PHP 7.4 or higher
  • Composer for dependency management
  • Write permissions for the output directory

Usage:

Installation:

composer require fayyaztech/sitemap-generator

Constructor Parameters:

The SitemapGenerator class constructor accepts four optional parameters:

  1. $changeFrequency (string): Specifies how frequently the content at the URLs is likely to change. Default is ChangeFrequency::DAILY. Available options are:

    • ChangeFrequency::DAILY
    • ChangeFrequency::WEEKLY
    • ChangeFrequency::MONTHLY
    • ChangeFrequency::YEARLY
  2. $domain (string): The domain for which the sitemap is being generated. If not provided, it defaults to the current domain (or localhost if unavailable).

Example Usage:

use Fayyaztech\SitemapGenerator\SitemapGenerator;

// Instantiate the generator with default parameters
$sitemapGenerator = new SitemapGenerator();

// Instantiate the generator with custom parameters
$sitemapGenerator = new SitemapGenerator(
    ChangeFrequency::WEEKLY,
    'https://example.com'
);

// Generate and save XML sitemap
$sitemapGenerator->saveToSitemap('/path/to/output'); // Saves an XML sitemap to the specified directory

// Generate and save ROR sitemap
$sitemapGenerator->saveToRor('/path/to/output'); // Saves a ROR sitemap (RSS format) to the specified directory

// Generate and save HTML sitemap
$sitemapGenerator->saveToHtmlSitemap('/path/to/output'); // Saves a human-readable HTML sitemap to the specified directory

// Generate and save URL list
$sitemapGenerator->saveToUrlList('/path/to/output'); // Saves a plain-text list of URLs to the specified directory

Method Details:

  1. saveToSitemap(string $filePath = '.')
    Generates an XML sitemap and saves it to the specified directory. The sitemap includes:

    • URLs collected from the domain.
    • Last modified date (default: current date).
    • Change frequency (e.g., daily, weekly).
    • Priority (default: 0.8).
  2. saveToRor(string $filePath = '.')
    Generates a ROR (RSS-based) sitemap and saves it to the specified directory. The ROR sitemap includes:

    • URLs collected from the domain.
    • Metadata such as title and description extracted from the URLs.
  3. saveToHtmlSitemap(string $filePath = '.')
    Generates a human-readable HTML sitemap and saves it to the specified directory. The HTML sitemap includes:

    • A list of URLs with clickable links.
    • The total number of pages.
    • The last updated date.
  4. saveToUrlList(string $filePath = '.')
    Generates a plain-text file containing a list of URLs and saves it to the specified directory. Each URL is listed on a new line.

License:

This project is released under the MIT License, offering flexibility and ease of use for developers while requiring proper attribution.

Contributing:

Contributions and feedback are welcome! To contribute:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and ensure the code adheres to the project's coding standards.
  4. Write tests for your changes, if applicable.
  5. Submit a pull request with a clear description of your changes.

For major changes, please open an issue first to discuss your ideas.

Links:

Begin enhancing your website's discoverability and SEO with the PHP Sitemap Generator today!

Author:

fayyaztech/sitemap-generator 适用场景与选型建议

fayyaztech/sitemap-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 fayyaztech/sitemap-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 fayyaztech/sitemap-generator 我们能提供哪些服务?
定制开发 / 二次开发

基于 fayyaztech/sitemap-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 56
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-04