Examining the sample code

The PHP sample can conceptually be split into the parts Core, Application, Model-View-Controller (MVC), and Application Assets.

The Core part contains the main sample code, which handles the communication with the Switch Server.

Core component Description
lib/butterfly.v2.0.wsdl The service WSDL file.  This contains the URL to the endpoint, http://127.0.0.1:51008 by default
lib/SwitchClientService.v2.0.php The client classes, based on the WSDL
lib/soap-patterns/* XML patterns for SOAP DIME requests

The Application part contains the sample PHP application, which uses the Core part for all Switch-related communication.

Application component Description
index.php The main entry point for the application
app/controllers/* Application controller classes
app/views/* The view classes for the controllers
app/views/header.php The header template for the sample
app/views/footer.php The footer template for the sample

The MVC component is a simple implementation of the Model-View-Controller pattern.

MVC component Description
lib/mvc/* A simple implementation of the MVC pattern to run the sample

The Application assets are assets used by the application, as well as a folder to cache binary data received from the Switch Server.

Application asset component Description
public/images/* Standard images and icons for the application
public/javascripts/* Application javascripts
public/stylesheets/* Application styles
public/thumbnails/* In this folder, thumbnails will be stored. This folder is created automatically if it does not exist; the PHP user should have write access here.