Commandr / Resource-fs

These FAQs briefly summarise key points on using Composr's command-line environment "Commandr" and its virtual filesystem.

For more information, check out these tutorials:
Question What is Commandr?
Answer Commandr is a command-line interface designed for experienced system administrators who prefer using a command line over a GUI. It supplements the Composr Admin Zone, allowing you to execute commands in the form of:
  • PHP code (prefix :)
  • SQL database queries (prefix @) (queries must be executed one at a time; semi-colon separation is not supported)
  • Shell commands (prefix #)
  • Commandr-code scripts (store in the Composr filesystem's bin directory, and just type the name of the script)
  • Commandr-code commands (no prefixes)

You can access Commandr via the Admin Zone > Tools > Commandr or using the Commandr button in the footer.
Question What is the Composr Repository?
Answer The Composr repository is a user-friendly representation of Composr's data, which is typically stored in a database and on the filesystem. It presents the data in an easily accessible format using the JSON standard and can be accessed as a folder on your computer via WebDAV.
Question What are the benefits of using the Composr Repository?
Answer The repository offers several benefits:
  • Opacity: Provides a clear view of Composr's content and resource data.
  • Tactility: Allows easy manipulation of data through drag-and-drop operations.
  • Data transfer: Simplifies transferring data between sites.
  • Desktop application integration: Enables using text editors and file-search tools for tasks like mass search and replace.
  • Configuration management: Tracks changes to options and facilitates transfer between sites.
  • Backups: Allows backing up portions of the repository.
  • Revision control: Supports built-in and advanced revision control.
  • Filesystem for Commandr: Acts as a file system for the Commandr command line.
  • Resource API: Offers an abstract resource API for programmers.
  • API for external apps: Provides an API for mobile apps and other external applications.
Question How is the Composr Repository structured?
Answer The repository is structured as a filesystem with various meta-filesystems mounted under a root directory. These meta-filesystems include:
  • bin: Stores Commandr scripts.
  • database: Provides access to the raw database.
  • etc: Allows access to Composr configuration options.
  • home or filedump: Provides access to the File/Media Library.
    • home contains the files in a special JSON format with metadata
    • filedump contains the raw files
  • members: Lists registered members with their settings and user groups.
  • raw or root: Provides access to the Composr installation directory.
    • raw contains the raw files without overrides, and modifying any file modifies them directly without automatic override handling
    • root contains the files with applicable overrides applied automatically, and Composr will automatically handle overrides and utilizing _custom directories when these files are modified
  • var: Contains structured website resources and content.
Question How can I access the Composr Repository?
Answer You can access the repository using WebDAV (non-bundled addon), which allows you to view it as a folder on your computer. Composr uses the SabreDAV PHP library for WebDAV functionality. However, please be aware that SabreDAV is deprecated and may not function correctly on newer PHP versions.
Question What are the limitations of the Composr Repository?
Answer While powerful, the repository has limitations:
  • Automatic syndication is not performed for content added via the repository.
  • Multi-language content translations are not retained.
  • Transferring complex data schemas between staging sites may have limitations.
  • Merging separate websites into one is not supported through the repository. You should use Composr's import tool instead.
Question What precautions should I take when using the Composr Repository?
Answer Exercise caution when working with the repository:
  • Avoid using it as the sole backup method; rely on regular database backups.
  • Work primarily under the "var" meta-filesystem and copy specific folders/files rather than the entire repository.
  • Do not use tools like "rsync" or Git on the whole repository without careful consideration.
Question Can I use Comcode / resource IDs directly when working with the repository?
Answer Using Comcode / resource IDs directly is not recommended as they may not match between different sites. Use GUIDs instead, which Composr automatically substitutes for IDs before parsing Comcode. You can use Commandr commands like find_guid_via_id to find the GUID for specific resources.