plinker/files 问题修复 & 功能扩展

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

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plinker/files

Composer 安装命令:

composer require plinker/files

包简介

A files component which allows you to read and write files

README 文档

README

A files component which allows you to read and write files.

Install

Require this package with composer using the following command:

$ composer require plinker/files

Client

Creating a client instance is done as follows:

<?php
require 'vendor/autoload.php';

/**
 * Initialize plinker client.
 *
 * @param string $server - URL to server listener.
 * @param string $config - server secret, and/or a additional component data
 */
$client = new \Plinker\Core\Client(
    'http://example.com/server.php',
    [
        'secret' => 'a secret password'
    ]
);

// or using global function
$client = plinker_client('http://example.com/server.php', 'a secret password');

Methods

Once setup, you call the class though its namespace to its method.

List

List files and folders.

Parameter Type Description Default
dir string Base path to list files and folders from ./
extended bool Return extended fileinfo false
depth int Iterator depth 10

Call

$result = $client->files->list('./', false, 10);

Response

Array
(
    [/] => Array
        (
            [0] => Array
                (
                    [name] => server.php
                    [type] => file
                    [size] => 706
                )

            [1] => Array
                (
                    [name] => .plinker
                    [type] => folder
                    [size] => 4096
                )

            [3] => Array
                (
                    [name] => user_classes
                    [type] => folder
                    [size] => 4096
                )

            [5] => Array
                (
                    [name] => demo.php
                    [type] => file
                    [size] => 1628
                )

        )

    [/.plinker] => Array
        (
            [2] => Array
                (
                    [name] => crontab.journal
                    [type] => file
                    [size] => 45
                )

        )

    [/user_classes] => Array
        (
            [4] => Array
                (
                    [name] => demo.php
                    [type] => file
                    [size] => 345
                )

        )

)

Response (with extended true)

Array
(
    [/] => Array
        (
            [0] => Array
                (
                    [name] => server.php
                    [type] => file
                    [size] => 706
                    [info] => Array
                        (
                            [last_access] => 1525369379
                            [change_time] => 1525368118
                            [modified_time] => 1517173011
                            [basename] => server.php
                            [extension] => php
                            [filename] => server.php
                            [group] => 33
                            [owner] => 33
                            [inode] => 3894233
                            [path] => .
                            [pathname] => ./server.php
                            [size] => 706
                            [type] => file
                            [isDir] => 
                            [isExecutable] => 
                            [isFile] => 1
                            [isLink] => 
                            [readable] => 1
                            [writable] => 1
                        )

                )
    // snip..

Create File

Create/Put a file, if file already exists, it will be overwritten.

Parameter Description Default
path File path
contents Contents of the file
flags File operations flags 0

Call

$result = $client->files->put('./path/to/file.txt', 'the file contents');

Response

number of bytes written to file

Get File

Get a file.

Parameter Description Default
path File path

Call

$result = $client->files->get('./path/to/file.txt');

Response

the file contents

Delete File

Delete a file.

Parameter Description Default
path File path

Call

$result = $client->files->delete('./path/to/file.txt');

Response


Testing

There are no tests setup for this component.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact me via https://cherone.co.uk instead of using the issue tracker.

Credits

Development Encouragement

If you use this project and make money from it or want to show your appreciation, please feel free to make a donation https://www.paypal.me/lcherone, thanks.

Sponsors

Get your company or name listed throughout the documentation and on each github repository, contact me at https://cherone.co.uk for further details.

License

The MIT License (MIT). Please see License File for more information.

See the organisations page for additional components.

plinker/files 适用场景与选型建议

plinker/files 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 01 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 plinker/files 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 plinker/files 我们能提供哪些服务?
定制开发 / 二次开发

基于 plinker/files 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-25