Directory Structure

Overview of the key directories and their purpose, focusing on where developers will typically interact with the system.

Root Directory (/)

This is the main installation directory where UNA resides. Key files and entry points are located here:

  • index.php: The main frontend entry point for most user-facing pages.
  • .htaccess: (Apache only) Contains rewrite rules and security configurations. Nginx requires equivalent configuration.
  • composer.json / composer.lock: Define PHP dependencies managed by Composer.
  • studio/: Entry point for the administration interface.
  • Other specific entry points like searchKeyword.php, member.php, etc.

Core System Directories

These directories contain the heart of the UNA platform and are essential for its operation.

/inc/

The core engine of UNA. It contains essential configuration loaders, bootstrapping files, core system classes, and fundamental functions.

  • Key Files: header.inc.php (initializes system), footer.inc.php (page footer, cleanup), profiles.inc.php (loads user profiles), params.inc.php (loads system parameters).
  • Core Classes: Contains base classes like BxDol.php, BxDolDb.php, BxDolModule.php, BxDolTemplate.php, etc.
  • Developer Note: You will frequently interact with classes defined here, but you should almost never modify files directly within /inc/. Extend core functionality through modules and hooks instead.

/studio/

Contains the code, templates, and assets specifically for the UNA Studio (the administration backend). While developers use Studio extensively, direct modification of files within /studio/ is generally discouraged unless contributing to the Studio module itself. Modules register their interfaces within Studio via their configuration.

Primary Development Directories

These are the directories where most custom development and customization work takes place.

/modules/

The most important directory for developers. It contains all installed modules (apps), which provide the vast majority of UNA's features.

  • Structure: Modules are organized by vendor and module name: /modules/[VendorName]/[ModuleName]/. For example: /modules/boonex/posts/.
  • Content: Each module directory typically contains subdirectories for its code, templates, data, and installation logic.
  • Developer Note: This is where you will create new modules or potentially customize existing ones (though customization is often better handled via template overrides or hooks).

Inside a Module (/modules/[VendorName]/[ModuleName]/)

A typical module directory contains:

  • classes/: PHP classes for the module (e.g., Module.php, Db.php, Template.php, Config.php, Form.php). Follows PSR-4 namespacing.
  • data/: Data files, including:
    • langs/: Language files (e.g., en.xml) for Polyglot translation keys.
    • template/: Default database templates (e.g., email templates).
    • install.sql, uninstall.sql: (Optional) SQL scripts executed during install/uninstall.
  • template/: Module-specific frontend templates (.html), default CSS (.css), and JavaScript (.js) files used if not overridden by the site's active template.
  • js/: Module-specific JavaScript files/classes (often referenced from template/).
  • css/: Module-specific CSS files (often referenced from template/).
  • install/: Installation-related files:
    • config.php: Module installation configuration (dependencies, permissions, settings definitions, etc.).
    • installer.php: The PHP class (Bx[Vendor][Module]Installer) handling installation/uninstallation logic.
    • sql/: (Optional) Directory for SQL dump files used during installation.
  • config.php: The main module configuration file defining its properties, routes, dependencies, CNF constants, etc.

/template/

Contains the available site templates (themes), such as artificer, lucid, etc. Only one template is active at a time for the frontend.

  • Structure: Each template resides in its own subdirectory: /template/[TemplateName]/.
  • Content: Contains base layout files (base.html, header.html, footer.html), CSS, JavaScript, images, and importantly, overrides for module templates.
  • Developer Note: Frontend customization heavily involves working within this directory, either by creating a new template or modifying/overriding an existing one.

Inside a Template (/template/[TemplateName]/)

A typical template directory contains:

  • css/: Template-specific CSS files, including compiled stylesheets (e.g., from Tailwind or SASS).
  • js/: Template-specific JavaScript files.
  • images/: Template images.
  • layouts/: Predefined page layout structures.
  • modules/: Crucial for customization. This directory mirrors the structure of /modules/ and allows overriding module-specific template files (.html, .css, .js). For example, placing a file at /template/my_template/modules/boonex/posts/template/entry.html overrides the default /modules/boonex/posts/template/entry.html.
  • config.php: Template configuration file.
  • *.html: Base template files (e.g., base.html, cover.html).

Supporting Directories

These directories contain dependencies, temporary files, and other supporting assets.

/plugins/

Contains third-party PHP libraries and dependencies, primarily managed via Composer. Packages installed with Composer reside here.

  • Developer Note: You generally don't modify files here directly. Manage dependencies through composer.json and run composer install or composer update.

/plugins_public/

Contains publicly accessible assets (like JavaScript libraries, CSS files, fonts) that are linked from packages installed in /plugins/. UNA often sets up symbolic links from /plugins/ to /plugins_public/ for web accessibility.

  • Developer Note: Similar to /plugins/, this is usually managed indirectly via Composer dependencies.

/cache/

Stores temporary system cache files generated by UNA to improve performance. This includes compiled templates (not HTML output), database cache entries, object cache data, etc. These files are generally not human-readable and are managed by the system.

  • Developer Note: You frequently need to clear this cache (via Studio > Developer > Cache) during development, especially after database structure changes or modifying code related to cached objects (forms, menus, etc.).

/cache_public/

Stores publicly accessible cached files, primarily compiled and minified CSS ("Mixes") and JavaScript files generated by the template engine.

  • Developer Note: Clear this cache (via Studio > Developer > Cache) when modifying CSS or JS files that are part of the template's build process. Consider disabling CSS/JS caching in Studio settings during active development.

/logs/

Contains system log files, including PHP error logs (if configured), database query logs (if enabled), specific module logs, and general system events logged via BxDolErrorHandler.

  • Developer Note: This directory is essential for debugging. Check log files regularly when troubleshooting issues.

/periodic/

Contains scripts intended to be run periodically via cron jobs or scheduled tasks (e.g., sending newsletters, cleanup tasks, notifications). The cron.php file is the typical entry point.

/tmp/

Used for temporary file storage during operations like file uploads, image processing, or temporary data generation before final storage or output.

Installation & Upgrade Directories

These directories are primarily used during specific lifecycle events.

/install/

Contains the files and scripts required for the initial installation process of UNA CMS. Usually not needed after installation is complete.

/upgrade/

Contains scripts and files related to the UNA upgrade process. Files are typically placed here automatically when an upgrade is available and initiated via Studio.

On This Page