Zemit CMS Core

Fund package maintenance!
jturbide

0.4.0 2024-03-16 06:38 UTC

README

Zemit CI Build Status Scrutinizer Code Quality Code Intelligence Status Code Coverage

Latest Stable Version Latest Unstable Version License

Daily Downloads Monthly Downloads Total Downloads

Zemit Core is an open source headless CMS built on top of Phalcon, an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption

Contents

Getting Started

Zemit is using the Phalcon Framework. You can use composer in order to add Zemit core to an existing project. If you want to create a new project from scratch, we invite you to visit the Zemit App repository for more informations.

composer require zemit-cms/core

If you want to play around directly with the core, you can create a new project from itself and follow the configuration below.

composer create-project zemit-cms/core <your_project_name>

Configuration

Add the database config, note that we use dotenv to load the .env config. Simply add .env file to the root of your project.

# Database
DATABASE_HOST=<your_db_host>
DATABASE_DBNAME=<your_db_schema>
DATABASE_USERNAME=<your_db_username>
DATABASE_PASSWORD=<your_password>

Initialize Database

We are using phalcon cli to run & generate database migration.

./vendor/bin/phalcon migration run --config=./src/Config/Migration.php --directory=./ --migrations=./src/Migrations/ --no-auto-increment --force --verbose --log-in-db

Serve Application

To use Web MVC modules of Zemit Core locally, you can use PHP's built-in web server, note that this web server is designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server.

php -S 0.0.0.0:8000 /public/index.php

You should now be able to access Zemit Core Frontend module from http://localhost:8000

This web server runs only one single-threaded process, so PHP applications will stall if a request is blocked. For more information about the CLI SAPI built-in web server, refer to the official documentation: https://www.php.net/manual/en/features.commandline.webserver.php

Full-featured Web Server

If you want to expose the application to the public world wide web, you can use apache or nginx to serve this purpose securely. You will need a Web server service to point to the /public/ folder of your new project. Here is virtual host example using apache 2.4 + php-fpm 7.4 from remi repository on Centos Stream.

<VirtualHost *:80>
    ServerName core.zemit.com
    ServerAlias www.core.zemit.com
    DocumentRoot /mnt/hgfs/dev/zemit/core/public/
    
    <Directory /mnt/hgfs/dev/zemit/core/public/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    
    <FilesMatch \.(php|phar)$>
        SetHandler "proxy:unix:/var/opt/remi/php74/run/php-fpm/www.sock|fcgi://localhost"
    </FilesMatch>
</VirtualHost>

<VirtualHost *:443>
    ServerName core.zemit.com
    ServerAlias www.core.zemit.com
    DocumentRoot /mnt/hgfs/dev/zemit/core/public/
    
    <Directory /mnt/hgfs/dev/zemit/core/public/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    
    <FilesMatch \.(php|phar)$>
        SetHandler "proxy:unix:/var/opt/remi/php74/run/php-fpm/www.sock|fcgi://localhost"
    </FilesMatch>
    
    SetEnv HTTPS on
    SetEnv HTTP_X_FORWARDED_PROTO https
</VirtualHost>

Requirements

Zemit Core requires multiple PHP extensions including PhalconPHP. Please use composer to make sure that you meet the requirements.

Languages & compatibilities

External Links

Contributing

See CONTRIBUTING.md for details.

License

Zemit is open source software licensed under the BSD 3-Clause License.

Copyright © 2017-present, Zemit Team.

See the LICENSE.txt file for more.