novia713/maginot

Maginot 是一个用于管理 PHP 文件中行号的 PHP 工具类

安装: 27

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 3

分支: 0

开放问题: 0

类型:项目

dev-master 2016-12-06 17:37 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:20:03 UTC


README

Maginot 是一个用于管理 PHP 文件中行号的 PHP 工具类

安装

composer require novia713/maginot

使用方法

实例化 Maginot

use Novia713\Maginot\Maginot;

$maginot = new Maginot();

然后您可以进行以下操作

📍 将一行注释到文件中

警告:这将注释掉所有出现的位置

$maginot->commentLine("this is an example line. can be whatever", $myFile);

📍 取消注释文件中的一行 [提供实际的行,包括注释符号]

警告:这将取消注释所有出现的位置

$maginot->unCommentLine("this is an example line. can be whatever", $myFile));

📍 设置文件的第一行

$maginot->setFirstLine("this is an example line. can be whatever", $myFile));

📍 设置文件的最后一行

$maginot->setLastLine("this is an example line. can be whatever",  $myFile);

📍 获取文件的第一行

$maginot->getFirstLine( $myFile);

📍 获取文件的最后一行

$maginot->getLastLine( $myFile);

📍 获取文件的第 n 行

$maginot->getNLine( $myFile, 2);

📍 获取文件中指定行的行号

$maginot->getLineNumber("this is an example line. can be whatever", $myFile);