Download the PHP package swoft-components/sitemap-pusher without Composer
On this page you can find all versions of the php package swoft-components/sitemap-pusher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download swoft-components/sitemap-pusher
More information about swoft-components/sitemap-pusher
Files in swoft-components/sitemap-pusher
Package sitemap-pusher
Short Description SitemapPusher 是一个专门为 Swoft2 开发者设计的网站地图组件,旨在简化向各大站长平台提交网站链接的过程。通过自定义数据源生成sitemap,自动化的链接提交,帮助站长加速搜索引擎对新发布或更新内容的收录速度。
License Apache-2.0
Informations about the package sitemap-pusher
SitemapPusher
概述
SitemapPusher 是一个专门为 Swoft2 开发者设计的网站地图组件,旨在简化向各大站长平台提交网站链接的过程。通过自定义数据源生成sitemap,自动化的链接提交,帮助站长加速搜索引擎对新发布或更新内容的收录速度。
版本说明
当前最新版本:v1.0.6-beta
稳定版:v1.0.2(此版本不支持命令行工具)
功能特色
-
自定义数组数据源(
CustomDataSource::class)用户可以直接通过配置数组内容,写入sitemap。
-
用户自定义数据源(
@DataSource)使用 @DataSource 注解绑定到相应的自定义数据源类,数据源类必须实现
DataSourceInterface::class默认数据源,不在通过属性注入的方式加载自定义的数据,通过设置 filepath 指定文件数据源路径. 数据源文件示例如下: -
分页执行,降低执行过程中的内存占用率
通过配置参数
$pageSize,数据源均支持分页执行,以便分批次写入sitemap 文件,降低内存的占用率。 -
大数据量网站地图生成,进度提示,预计完成时间提示
生成网站地图参数可以配置参数
logPerNum,每写入$logPerNum条数据,会触发一个事件,默认事件会打印当前网站地图执行的进度,和预计完成时间。同时支持用户自定义事件处理。 -
自定义事件处理函数
-
sitemap 生成前事件
-
进度报告事件
-
异常处理事件
-
sitemap 生成后事件
用户可以根据需求自定义相应的事件处理函数。
-
-
百度地图主动推送
当前版本支持百度地图的主动推送功能,可以通过 swoft 事件触发机制,快速集成到系统中。
-
百度地图主动推送命令支持(新功能) 首先需要再 bean 定义中配置好 site 和 token
-
命令行工具
提供
php swoft sitemap:generate -d=/tmp -name=sitemap.txt -n 50 -p 100命令行工具,手动生成网站地图。- --dir, -d 指定网站地图的生成路径,默认值为当前目录
./ - --name, -name 指定网站地图的名称,默认值为
sitemap.xml - --num, -n 指定分页大小,对大量数据生成地图的网站,数据要分批进行写入,默认值为
50 - --progress, -p 指定每隔多少条记录写入,日志显示当前的执行进度,和预计完成时间,默认值为
200 - --type, -t 指定生成的网站地图类型,默认值为
xml,可选值为txt和xml
- --dir, -d 指定网站地图的生成路径,默认值为当前目录
快速开始
网站地图生成
网站地图生成示例代码:
设置自定义数据源,支持设置数据获取的优先级(决定获取数据源的顺序,priority 值越大优先级越高)。
手动生成
All versions of sitemap-pusher with dependencies
swoft/framework Version ~2.0.0
swoft-components/stdlib Version ^v1.0.0
ext-curl Version *
ext-json Version *