定制 fabiopaiva/file-storage 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fabiopaiva/file-storage

Composer 安装命令:

composer require fabiopaiva/file-storage

包简介

DoctrineORM Entity to store files ZF2

README 文档

README

Install

Composer

php composer.phar require "fabiopaiva/file-storage": "dev-master"

GIT

cd vendor
git clone https://github.com/fabiopaiva/FileStorage

Enable Module

application.config.php
<?php
    return array(
        'modules' => array(
        'DoctrineModule',
        'DoctrineORMModule',
        'FileStorage', 
        'Application',
),
...
?>

Create table in database

vendor/bin/doctrine-module orm:schema-tool:update --dump-sql
# copy the generated sql and execute in your database for productions environment
# or force to execute into your database directly
vendor/bin/doctrine-module orm:schema-tool:update --force

Create a writable folder

mkdir public/fileStorage
chmod 777 public/fileStorage

You can set another folder in your form construction

Protect this folder

It's seriously recommended to protect this folder. If you are using Apache, create a file into this folder called .htaccess with the content:

php_flag engine off
Options -indexes

Usage

In your entity:

/**
 * @ORM\ManyToOne(targetEntity="\FileStorage\Entity\Document", cascade={"persist", "remove"})
 * @var \FileStorage\Entity\Document
 */
protected $myFile;

Helpers

use the route file-storage to manage files

<?php echo $this->url('file-storage');?>

use the method downloadLink to get the filepath

<?php echo $document->getDownloadLink();?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固