perf/source

2.0.0 2020-08-03 20:35 UTC

This package is auto-updated.

Last update: 2024-08-29 04:13:37 UTC


README

源代码包允许抽象数据源。

安装与要求

源代码不依赖于其他库。

使用 Composer 安装它

{
	"require":
	{
		"perf/source"  : "~1.0"
	}
}

使用方法

本地文件源

<?php

$path = '/foo/bar/settings.ini';

$source = \perf\Source\LocalFileSource::create($path);

function print_content(\perf\Source\Source $source)
{
	echo $source->getContent();
}

字符串源

<?php

$string = 'foo = bar';

$source = \perf\Source\StringSource::create($string);

function print_content(\perf\Source\Source $source)
{
	echo $source->getContent();
}