定制 eclipxe/xmlresourceretriever 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

eclipxe/xmlresourceretriever

最新稳定版本:v2.0.3

Composer 安装命令:

composer require eclipxe/xmlresourceretriever

包简介

XSD and XLST resource downloader for local storage

关键字:

README 文档

README

Source Code Packagist PHP Version Support Latest Version Software License Build Status Scrutinizer Coverage Status Total Downloads

XSD and XLST resource downloader for local storage

The purpose of this library is to download recursively XML resources from the internet to a local storage for further usage. At this moment it only allows Schemas (XSL) and Transformations (XSLT) but is easely extensible implementing the RetrieverInterface interface or extending the AbstractXmlRetriever class.

For every downloaded file it will override its dependences to a relative location, in this way, every dependence should be available to work offline.

You can use the local object PhpDownloader that simply uses copy function to get and store a file from internet. You can also use your own implementation of the DownloaderInterface according to your needs. If you built a configurable and useful downloader class feel free to contribute it to this project.

Installation

Use composer, so please run

composer require eclipxe/xmlresourceretriever

Basic usage

<?php
declare(strict_types=1);
/*
 * This will download the file into
 * /project/cache/www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_3/cadenaoriginal_3_3.xslt
 * and all its includes and imports (currently 27 files)
 */
use Eclipxe\XmlResourceRetriever\XsltRetriever;
$xslt = new XsltRetriever('/project/cache');
$local = $xslt->retrieve('http://www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_3/cadenaoriginal_3_3.xslt');
echo $local; /* /project/cache/www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_3/cadenaoriginal_3_3.xslt */

Retriever more information

These methods apply to XslRetriever and XsltRetriever

  • retrieve($url) Download recursively an url and store it into the retriever base path, it changes the child elements that contains references to other files.
  • download($url) Download an url and store it into the retriever base path. It does not validate the file for xml errors. It does not download dependences.
  • buildPath($url) Return the location of were a file should be stored according to the base path.
  • setDownloader($downloader) Change the default PhpDownloader to a custom implementation.

XsdRetriever search for namespace http://www.w3.org/2001/XMLSchema elements import and include.

XsltRetriever search for namespace http://www.w3.org/1999/XSL/Transform elements import and include.

PHP Support

This library is compatible with the latest PHP supported version and above. Please, try to use the full potential of the language.

Contributing

Contributions are welcome! Please read CONTRIBUTING for details and don't forget to take a look the TODO and CHANGELOG files.

Copyright and License

The Eclipxe\XmlResourceRetriever library is copyright © Carlos C Soto and licensed for use under the MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 123.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固