Download the PHP package cmouleyre/lunacms without Composer
On this page you can find all versions of the php package cmouleyre/lunacms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmouleyre/lunacms
More information about cmouleyre/lunacms
Files in cmouleyre/lunacms
Package lunacms
Short Description LunaCMS is a lightweight and high-performance content management system.
License MIT
Homepage https://github.com/MrManchot/lunacms
Informations about the package lunacms
LunaCMS - README
Overview
LunaCMS is a lightweight and extensible PHP library for building content management system (CMS) websites. It leverages modern PHP components such as Twig for templating, Doctrine DBAL for database interactions, PHPMailer for email handling, and Redis for optional caching. LunaCMS is designed to help developers create modular, maintainable, and flexible small to medium-scale websites quickly and efficiently.
Features
- MVC Architecture: Implements the Model-View-Controller pattern for clear separation of logic, presentation, and data.
- Twig Templating: Offers a powerful and flexible templating engine for building dynamic web pages.
- Site Structure Generation: Automates the creation of the site structure using the
SiteGenerator
command-line tool. - Database Management: Uses Doctrine DBAL for handling database connections and queries.
- Email Integration: Built-in support for sending emails using PHPMailer.
- Routing System: A simplified routing system for handling HTTP requests and mapping them to controllers.
- Redis Integration: Optional support for Redis caching to enhance performance.
- Asset Management: Uses Gulp to compile SCSS and JavaScript assets for efficient delivery.
Requirements
- PHP: 7.4 or higher
- Composer: For managing PHP dependencies
- Node.js and npm: For Gulp and asset management
- PHP Extensions:
- PDO (with MySQL support)
- cURL
- PHPMailer
- (Optional) Redis PHP extension if using Redis caching
Installation
Prerequisites
- PHP 7.4 or higher
- Composer
- Node.js and npm
- Gulp CLI: Install globally using:
Steps
-
Clone the Repository
-
Navigate to the Project Directory
-
Install PHP Dependencies
-
Install Node.js Dependencies
-
Generate the Site Structure Use the CLI script to generate the necessary directories and files.
-
Configure the Project Edit the
config/config.json
file with your project-specific settings. - Build Assets
Usage
Generating a New Site Structure
Use the command-line tool to create a new site structure. This will generate all the necessary directories and configuration files:
Configuration
LunaCMS uses a configuration file located at config/config.json
. This file contains:
- Database Settings: Configure the database connection (host, user, password, etc.).
- Mail Server Settings: For PHPMailer integration.
- Site Information: Such as the base URL and site name.
- Debug Settings: Enable or disable debug mode.
Controllers
LunaCMS follows an MVC architecture, using controllers to handle requests. Create new controllers by extending the Controller
class:
Redis Caching
LunaCMS supports Redis caching if the Redis PHP extension is installed. Example usage:
-
Set a value in Redis:
- Get a value from Redis:
If Redis is not available, these methods will fail silently.
Sending Emails
You can send emails with PHPMailer using LunaCMS's built-in functionality:
Make sure to configure the email settings in the config/config.json
file.
Routing
Routing in LunaCMS is handled by the Routing
class. Define your routes in config/routes.php
:
This allows you to map URLs to specific controllers easily.
Project Structure
Key Directories and Files
- assets/: Contains JavaScript and SCSS source files.
- cache/twig/: Stores cached Twig templates. Ensure this directory is writable.
- config/: Configuration files.
- config.json: Main configuration file.
- routes.php: Defines the application routes.
- public/: The web root directory.
- index.php: The application entry point.
- css/, js/, img/: Compiled assets.
- src/Controllers/: Controller classes.
- PageController.php: Example controller.
- templates/: Contains Twig templates.
- includes/base.twig: Base template for reusability.
- index.twig: Example page template.
- vendor/: Composer dependencies.
- gulpfile.js: Gulp configuration for asset compilation.
License
LunaCMS is open source and licensed under the MIT License. You are free to use, modify, and distribute it in accordance with the license terms.
Contributing
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request with your changes.
Feel free to reach out if you need more guidance or if anything is unclear.
All versions of lunacms with dependencies
twig/twig Version ^3.0
symfony/console Version ^6.0
doctrine/dbal Version ^3.0
phpmailer/phpmailer Version ^6.0