承接 blacksenator/fritzdbf 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

blacksenator/fritzdbf

最新稳定版本:v1.4

Composer 安装命令:

composer require blacksenator/fritzdbf

包简介

A simple generator for dbase files using PHP

README 文档

README

The class provides functions to manipulate the address database FRITZ!Adr from AVM. FRITZ!Adr is an address and phonebook for the more or less legacy programs FRITZ!Fon, FRITZ!Data and FRITZ!Com. But still in use for FRITZ!fax (fax4box).

alt text

Sample image of record editing window in FRITZ!Adr (Copyright© by AVM)

The database is a dBASE III file, the default name is 'FritzAdr.dbf'.

There are three reasons for using this class:

  1. because of the difficulty of implementing the outdated extension for dBase (PECL) for current PHP releases and platforms.
  2. due to the fact that for the purposes that only just one file with a defined structure has to be written (no reading or manipulating data in records or whatever else is conceivable)
  3. lastly, because it allows to write the data to memory instead of a local stored file. So it is possible to create the file via ftp directly in the target directory.

The DB analysis of a few FritzAdr.dbf files has surprisingly shown two variants with 19 e.g. 21 fields. Ultimately the 21er version works for me (default).

Features

  • Does create a dBase file in memory instead of writing it directly to a file (unlike the outdated PECL version)
  • limited functionality: there is only one changing function: addRecord() beside of getDatabase() to receive the generated database! If you think more features are needed, fork this repo and feel free to contribute!

Requirements

Installation

You can install it through Composer:

"require": {
    "blacksenator/fritzdbf": "dev-master#1.0"
},

or

git clone https://github.com/blacksenator/fritzdbf.git

Usage

setting a new instance with the number of fields:

$fritzDbf = new fritzdbf(19);    // number of fields

appending a record:

$fritzDbf->addRecord(['NAME' => 'John', 'VORNAME' => 'Doe']);

receiving the data:

$fileData = $fritzDbf->getDatabase());

Samples

use blacksenator\fritzdbf\fritzdbf;

$newData = ['BEZCHNG' => 'Maria Mustermann',   // Feld 1
            'FIRMA'   => 'Bundesdruckerei',
            'NAME'    => 'Mustermann',
            'VORNAME' => 'Erika',
            'TELEFON' => '03025980'
    ];

$fritzDbf = new fritzdbf();         // using default value 21
$fritzDbf->addRecord($newData);
file_put_contents('FritzAdr.dbf', $fritzDbf->getDatabase());

or directly via ftp (the reason why I coded this)

use blacksenator\fritzdbf\fritzdbf;

$newData = ['BEZCHNG' => 'Max Mustermann',   // Feld 1
            'FIRMA'   => 'Bundesdruckerei',
            'NAME'    => 'Mustermann',
            'VORNAME' => 'Max',
            'TELEFON' => '03025980'
    ];

$ftp_conn = ftp_connect($ftpserver);
ftp_login($ftp_conn, $user, $password);
ftp_chdir($ftp_conn, $destination);
$memstream = fopen('php://memory', 'r+');

$fritzDbf = new fritzdbf();
$fritzDbf->addRecord($newData);

$memstream = $fritzDbf->getDatabase();
rewind($memstream);
ftp_fput($ftp_conn, 'FritzAdr.dbf',  $memstream, FTP_BINARY);

License

This script is released under MIT license.

Authors

Copyright© 2019 - 2021 Volker Püschel

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固