承接 inteve/utils 相关项目开发

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

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

inteve/utils

最新稳定版本:v0.3.4

Composer 安装命令:

composer require inteve/utils

包简介

Utility classes for web development

README 文档

README

Build Status Downloads this Month Latest Stable Version License

Utility classes for web development

Donate

Installation

Download a latest package or use Composer:

composer require inteve/utils

Inteve\Utils requires PHP 8.0 or later.

Usage

DateTimeFactory

$dateTimeFactory = new Inteve\Utils\DateTimeFactory;
$now = $dateTimeFactory->create();

Imagick

use Inteve\Utils\ImagickHelper;
$imagick = ImagickHelper::openImage('file.jpg');
ImagickHelper::resize($imagick, $width, $height, $flags); // same parameters as for Image::resize()
ImagickHelper::saveImage($imagick, 'thumb.jpg');

// and much more!

PaginatorHelper

$paginator = new Nette\Utils\Paginator;
$steps = Inteve\Utils\PaginatorHelper::calculateSteps($paginator);

XmlDocument

$xml = new Inteve\Utils\XmlDocument([
	'standalone' => 'yes',
]);
$root = $xml->create('urlset');

$item = $root->create('url');
$item->create('loc')->setText('http://example.com/');

echo $xml->toString();

Prints:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<urlset>
	<url>
		<loc>http://example.com/</loc>
	</url>
</urlset>

XmlQuery

Wrapper of SimpleXml.

$query = Inteve\Utils\XmlQuery::fromString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<urlset>
	<url>
		<loc>http://example.com/</loc>
	</url>
	<url>
		<loc>http://example.com/path</loc>
	</url>
</urlset>');

$urls = [];

foreach ($query->children('url') as $url) {
	$urls[] = $url->child('loc')->text();
}

var_dump($urls);

Prints:

http://example.com/
http://example.com/path

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/

统计信息

  • 总下载量: 7.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-04-12