pangodream/php-lsd

本地设置导演(用于PHP)

dev-master 2018-11-05 17:52 UTC

This package is auto-updated.

Last update: 2024-09-06 10:00:05 UTC


README

PHP本地设置导演(读取和写入设置)

安装

composer require pangodream/php-lsd

使用示例

执行示例两次,以查看在调用put()方法时Option_B如何更改为新值。

<?php

require_once __DIR__.'/../vendor/autoload.php';

use Lsd\Lsd;

Lsd::load(__DIR__.'/../.lsd');

echo Lsd::get('RouterAddress');
echo "\n";
Lsd::put('RouterAddress', '192.168.0.1');
Lsd::save();

echo Lsd::getLastReadTime();
echo "\n";
echo Lsd::getLastWriteTime();
echo "\n";

示例.lsd文件

#This is an example of a .lsd file
#You should place the options you need in this file and rename it
#or create a new one

#Network Options
RouterAddress=10.0.0.1

OptionB=ValueB #Here is the explanation of OptionB value
OptionC=ValueC

OptionD=This option has a longer value

#And the next one has no value assigned
OptionE=