PHPackages                             simpleserv/webfiles-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. simpleserv/webfiles-framework

Abandoned → [webfiles-framework/framework](/?search=webfiles-framework%2Fframework)Library[Framework](/categories/framework)

simpleserv/webfiles-framework
=============================

v0.2.0(9y ago)21.3k1[12 issues](https://github.com/sebastianmonzel/webfiles-framework-php/issues)[3 PRs](https://github.com/sebastianmonzel/webfiles-framework-php/pulls)GPL-2PHPPHP &gt;=5.3.0CI passing

Since Mar 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/sebastianmonzel/webfiles-framework-php)[ Packagist](https://packagist.org/packages/simpleserv/webfiles-framework)[ RSS](/packages/simpleserv-webfiles-framework/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (24)Used By (0)

webfiles-framework-php
----------------------

[](#webfiles-framework-php)

[![Join the chat at https://gitter.im/sebastianmonzel/webfiles-framework-php](https://camo.githubusercontent.com/816f43382ad68131286dbb9689fea9cea759a68b8dc4cbe03b875e068e5782ee/68747470733a2f2f6261646765732e6769747465722e696d2f73656261737469616e6d6f6e7a656c2f77656266696c65732d6672616d65776f726b2d7068702e737667)](https://gitter.im/sebastianmonzel/webfiles-framework-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Build status](https://camo.githubusercontent.com/5a31a50be10cb7cd03f413d9c245d9389efd24264b220e1ccbaa01ab2190eb9b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73656261737469616e6d6f6e7a656c2f77656266696c65732d6672616d65776f726b2d7068702f646576656c6f702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sebastianmonzel/webfiles-framework-php)[![Code Climate](https://camo.githubusercontent.com/83af4bad20529bc73dedd7ba4ad3a70d10cd6f233f6137b7e862a10f8d8f51ff/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73656261737469616e6d6f6e7a656c2f77656266696c65732d6672616d65776f726b2d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/sebastianmonzel/webfiles-framework-php)[![Test Coverage](https://camo.githubusercontent.com/3208522f13ab1b98ea81567c4373976e34f2235d7d3f27b59ff3074aac651a8b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73656261737469616e6d6f6e7a656c2f77656266696c65732d6672616d65776f726b2d7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/sebastianmonzel/webfiles-framework-php/coverage)

Api-Documentation:
Documentation:  ([github-repo](https://github.com/sebastianmonzel/webfiles-framework-php-doc))
Packagist:

Access and describe data in a generalized way. Interact with remote data.
developer &amp; contact: Sebastian Monzel ()

### What is webfiles framework for?

[](#what-is-webfiles-framework-for)

The purpose of webfiles framework is to provide a lightweight libary to interoperate with data on a standarized way: the webfiles.

The webfiles framework generalizes data access to database system, to file system and accessing data on the remote site. Through an webfile definition and the standarized api you can access the different systems in the same way.

### First Steps

[](#first-steps)

- add webfiles-framework as dependency `webfiles-framework/framework` to your `composer.json`
- define your datastucture as webfile definition
- save and read data in database or filesystem via the datastore api

### Sample use cases

[](#sample-use-cases)

- [Define your first webfile definition](#define-your-first-webfile-definition)
- [Store a webfile in a datastore](#store-a-webfile-in-a-datastore) - database tables will be created on the fly according to the webfiles defintion.
- [Read from DirectoryDatastore](#read-from-directorydatastore)
- [Read from DatabaseDatastore (actually mysql only)](#read-from-databasedatastore-actually-mysql-only)
- [Transfer data from one datastore to another](#transfer-data-from-one-datastore-to-another)
- [Read from RemoteDatastore](#read-from-remotedatastore) - a remote datastore is a datastore which lives on an other server in the web

#### Define your first webfile definition

[](#define-your-first-webfile-definition)

```
use webfilesframework\core\datasystem\file\format\MWebfile;

class Contact extends MWebfile
{

    private $m_sFirstname; // attributes has to be in the given scheme - all attributes with "m_" as prefix gets persisted - "s" defines the type of the attribute (string)
    private $m_sLastname;
    private $m_sCity;

    public function setFirstname($m_sFirstname)
    {
        $this->m_sFirstname = $m_sFirstname;
    }

    public function getFirstname()
    {
        return $this->m_sFirstname;
    }

    public function setLastname($m_sLastname)
    {
        $this->m_sLastname = $m_sLastname;
    }

    public function getFirstname()
    {
        return $this->m_sFirstname;
    }

    public function setCity($m_sCity)
    {
        $this->m_sCity = $m_sCity;
    }

    public function getCity($m_sCity)
    {
        $this->m_sCity = $m_sCity;
    }

}
```

#### Store a webfile in a datastore:

[](#store-a-webfile-in-a-datastore)

via directory:

```
