Virtual File System Reference

Directory Structure

The Virtual File System is used to store all of the files from your site. It is currently accessible from a WebDAV server hosted by Emergence on every site. This is currently facilitated through PHP but will be moved to NodeJS in the future.

The WebDAV interface is accessible for all Emergence websites at http://yoursite.com/develop.

Logging in for the first time may take a couple seconds but once you are in you should see a couple folders already in your site. These folders create a structure for you to publish your site's assets to the Virtual Directory Structure.

WEBDav Directory Structure

    _parent

    This folder allows you to browse and open files from the _parent site that your site inherits it's current code and assets from.

    When you login for the first time or visit the site for the first time the load might take some time because Emergence is downloading the files necessary from the parent site.

    You may open anything in the _parent site however when you hit save the file will be placed in the same directory structure but on your site instead of the parent.

    The same file in your site takes precedence over that file in the _parent folder.

    html-templates

    All the templates for your site should be stored here.

    php-classes

    Your PHP classes go here. Emergence already comes with an extensive list of classes. Classes should be named 'className.class.php'.

    php-config

    If a class with name 'className.class.php' loads then a PHP file with name 'className.config.php' will automatically execute immediately after the class loads.

    site-root

    This is where files will actually load depending on the URL used to access the website's file. It emulates a regular htdocs directory that most people are used to.

    It is optional to use .php for PHP files in this directory. Any PHP file in this folder can be accessed with the first slash after the domain name without the extension. For example to access hello.php you would use sitedomain.com/hello.

    You may use this folder to store static files such as JavaScript, CSS Stylesheets, and graphics assets.

Setting up a Parent Site

You'll need to edit the records in two tables to configure your site to begin pulling code from a parent site.

_e_hosts

HostnameSiteID
yoursite.example.com 1
skeleton.mics.me 2

First we need to define all the hostnames an Emergence site is aware of. One of them should be itself while the other one is the hostname of the site you want to make your parent.

_e_sites

ID Type Title PrimaryHostnameID ParentID AccessKey
1 Local NULL1 2 NULL
2 Remote NULL2 NULLm6Q136L0mDsWmShJ

Now we define the sites that the framework is aware of. One is the local site and the other is a remote site with an AccessKey. Feel free to use this configuration for inheriting from skeleton.mics.me.

Coding with the VFS