inteve/utils 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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/

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固