Skip to content

Commit

Permalink
添加备注信息,并且添加文件助手类
Browse files Browse the repository at this point in the history
  • Loading branch information
黑猫 committed May 15, 2017
1 parent 08005a4 commit 9ebded8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# php-helper

*php-helper是一个工具包*

安装方式

composer require d1studio/php-helper
13 changes: 13 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace d1studio\php_helper;

class File{
/**
* 向文件追加一行的方法,需要锁定文件并且追加内容
* @param $file_name string 文件名
* @param $line string 追加数据
*/
public static function appendLine($file_name,$line){
file_put_contents($file_name, $line, FILE_APPEND | LOCK_EX);
}
}

0 comments on commit 9ebded8

Please sign in to comment.