How idreamsoft/icms works
Main Components
a. Web Frontend:
• The public and template directories (e.g., “public”, “template”, “template/blog”, and “template/iCMS”) serve as the view layer to present content to end users.
b. Backend Modules:
• The “app” directory contains many modules such as:
– Admin Control Panel (admincp)
– Article, Comment, Content, Category, Member, Node, File, etc.
• Each of these modules handles a specific business domain.
c. Core Framework and Libraries:
• The iPHP framework (in directories like “iPHP”, “core”, and “iPHP/core”) acts as the foundation and provides helper libraries, core routing, caching, database abstraction, templating, and security.
• “vendor”, “iPHP/library”, and third-party libraries (such as jQuery plugins, UEditor, ZeroClipboard, and more) are part of the ecosystem.
d. Data and Caching:
• The “config” directory holds configuration files such as database settings (in config/iCMS/database.php), secret keys, and other definitions.
• The system supports MySQL as the primary persistent datastore.
• Caching classes and files reside under “app/cache” and optional caching libraries (Memcached/Redis) are available.
e. External Integrations:
• There are integrations for API endpoints (under app/api), file storage (“app/files”), plugin system (under app/plugin), and even support for external services (WeChat, CDN, etc.).
Relationships and Interactions
– The Clients (web browsers, mobile apps, etc.) send HTTP requests (via public/index.php or public/api.php) to the web server.
– Requests hit the Public layer which, using routing (found in iPHP/core/Route.php and app/func/iCMS/route.php), directs them to the appropriate module (article, comment, user, etc.).
– The modules then interact with the core libraries (iPHP core, iCMS functions, and helper classes).
– All modules connect with the database (configured in “config/iCMS/database.php”) via a common database abstraction layer (in iPHP/core/DB.php and the database modules).
– Optionally, caching is used to improve performance.
– The Admin Control Panel (admincp) and User Control Panel (usercp) are distinct modules with their own views and assets.
– The plugin and extension mechanisms allow additional functionalities to integrate deeply with the system.
– The template system (in “template”) pulls data from backend modules using the core templating system in iPHP/core/template.
Architectural Patterns and Design Principles
– The system is organized in a modular, multi-layered architecture. Although not a strict MVC, it separates business logic (in “app” modules and core libraries) from presentation (the “template” and “public” directories).
– There is a clear decoupling where each module (e.g., article, comment, user) encapsulates its specific functions and views.
– Dependency on core libraries and centralized configuration ensures consistency across modules.
– The plugin system provides extensibility, letting third-party integrations hook into various system events.
Technologies and Frameworks
– PHP (version 5.6 or above) is the primary language.
– MySQL is used for persistent storage (with configurations under “config/iCMS/database.php”).
– JavaScript libraries (e.g., jQuery, art-template, UEditor) and CSS assets from “assets” and “template/blog/assets”.
– Third-party libraries for caching (Redis/Memcache) and external file storage are available.
– The system uses its own lightweight framework (iPHP) which supplies core functionalities such as routing, database abstraction, caching, templating, and security.
Specific Elements
• “Web Clients” (Browsers, Mobile)
• “Routing & Core Framework” (iPHP core libraries and routing engine)
• “Database” (MySQL, with a link to configuration)
• “Caching Layer” (optional, showing Redis/Memcache integration)
• “Template and View Engine” (template/iCMS, template/blog)
• Between Clients → Public entry → Routing → Modules → Database/Caching.
• Between modules and core libraries.
Additional Advice
– You might use layering (from presentation to application to infrastructure) to keep the conceptual flow clear.