MiMiMi framework & CMS is a lightweight software package for easy website development. The package includes the latest version of the "MiMiMi" framework and several variations of the CMS based on it. The package distributed under license GPL 2.0. You are free to download and use this software for personal or commercial purposes.
Why is it developed?
Once upon a time I had experience with different packages for creating websites. There were freeware or commercial systems, visual site constructors or integrated development environments, frameworks or CMSes, popular or unknown platforms, complex or simplified engines.
Each package represents a good solution for a certain range of tasks. But those packages had a common flaw - is tangible complexity of their source code. Moreover, they were created over 10 years ago. This means that their source code is ancient.
I asked myself, "Is it possible to develop a framework to be as small, simple, and pretty as a little kitten?" I found this idea interesting to implement. And the working name of my framework was chosen consonant with the triple feline "Meow", written with the triple phoneme "Mi".
Then I wrote a draft framework during January 2022 and posted this first version on the Internet. Next, I will develop new versions of the MiMiMi framework and publish them for free access on this website.
How to install?
To get started, you need to download the latest version of the framework using the button Download at the top of this page. The downloaded file is a ZIP archive containing 3 components: the MiMiMi Core, the MiMiMi CMS, the MiMiMi Installer. You must unzip this archive into the website's root folder and open the home page in a browser. You will see the welcome window of the MiMiMi Installer.
It will allow you to go through the installation process and select the desired framework configuration. Installation consists of 3 steps: choosing the installation directory, configuring database access, choosing which modules to install. As a result, you will install the MiMiMi framework & CMS on the website.
What is the MiMiMi Core?
.htaccess - it is a configuration of the Apache web server to forward incoming requests to the starting point of your website.
The forwarding logic is defined by the following rules:
Details
Rule 1. Block requests for the unsafe files. For example, any dumps like *.sql, any backups like *.bak, any server scripts like *.cgi, and so on.
Rule 2. Disable URIs ended with index.php and redirect them to the same URI without this ending.
Rule 3. Disable URIs with the trailing slash and redirect them to the same URI without the slash.
Rule 4. Skip requests for non-script files located in the root media folder.
Rule 5. Skip requests for theme files located in any subdirectory (css, or fonts, or images, or js) of the root themes folder.
Rule 6. Skip requests for the root *.ico, or *.txt, or *.xml file.
Rule 7. Send other requests to the starting point of your website.
In addition, some content negotiation options are disabled in this file. For example:
The MultiViews option is disabled, otherwise the server will look for the nearest matching directory for the unrecognized URI.
The Indexes option is disabled, otherwise the server will declassify the list of files in any directory that does not contain a standard index file.
favicon.ico - it is a favorite icon of your website.
index.php - it is the starting point of your website. The file just loads the default application (Core) or its modified version (CMS or Installer) and launches that application.
This file also contains the following constants:
Details
MIMIMI_CORE_VERSION - the official version of the framework
MIMIMI_CORE_FOLDER - where the framework (Core) is located
MIMIMI_MODULES_FOLDER - where is its modules
MIMIMI_CMS_FOLDER - where is its modified version (CMS)
MIMIMI_INSTALL_FOLDER - where is its modified version (Installer)
This file also defines the following global variables:
$cms - the application's object to access it from the theme PHP scripts
mimimi.core / Config.php - it is a list of configuration constants.
The file contains the following constants to configure the database access:
Details
MIMIMI_DATABASE_DRIVER - it is one of these values:
The file also contains these constants for selected theme:
MIMIMI_CORE_THEME
MIMIMI_CMS_THEME
MIMIMI_INSTALL_THEME
The file also contains these constants to inform your masters about website's events.
To inform by email (these constants are strings with comma-separated list of emails):
MIMIMI_EMAILS_FOR_WEBMASTER
MIMIMI_EMAILS_FOR_CONTENT_MASTER
MIMIMI_EMAILS_FOR_TRAFFIC_MASTER
MIMIMI_EMAILS_FOR_SECURITY_MASTER
To inform by SMS (these constants are strings with comma-separated list of telephones):
MIMIMI_PHONES_FOR_WEBMASTER
MIMIMI_PHONES_FOR_CONTENT_MASTER
MIMIMI_PHONES_FOR_TRAFFIC_MASTER
MIMIMI_PHONES_FOR_SECURITY_MASTER
To inform by Telegram chat (these constants are strings with comma-separated list of @identifiers):
MIMIMI_TELEGRAMS_FOR_WEBMASTER
MIMIMI_TELEGRAMS_FOR_CONTENT_MASTER
MIMIMI_TELEGRAMS_FOR_TRAFFIC_MASTER
MIMIMI_TELEGRAMS_FOR_SECURITY_MASTER
mimimi.core / Routines.php - it is a miniature library of helper routines to bootstrap your application to the starting point of the website.
The file contains these routines:
Details
mimimiCheck()
to check for the existence of main constants
mimimiCreate($name[, $cms[, $testing]])
to load a named module as the same property of the CMS object
mimimiInclude($filename[, $fromCore[, $once]])
to load a required PHP file
mimimiDump($filename[, $fromCore])
to output a required TEXTUAL (style.css, script.js, and so on) file
mimimiModule($filename[, $fromCore])
to load a required TEMPLATE (header.php, footer.php, and so on) file
mimimiInform($subject, $message, $to[, $details])
to inform your masters by email
mimimiCookie($param[, $def])
to retrieve a named COOKIE's parameter
mimimiEnvironment($param[, $def])
to retrieve a named ENV's parameter
mimimiFiles($param[, $def])
to retrieve a named FILES's parameter
mimimiGet($param[, $def])
to retrieve a named GET's parameter
mimimiPost($param[, $def])
to retrieve a named POST's parameter
mimimiRequest($param[, $def])
to retrieve a named REQUEST's parameter
mimimiServer($param[, $def])
to retrieve a named SERVER's parameter
mimimiSession($param[, $def])
to retrieve a named SESSION's parameter
mimimiStop($message[, $code])
to stop execution and send a message to the user's browser with such HTTP status code
mimimiSite([$toDisplay])
to display or retrieve the domain's absolute URI
mimimiRoot([$toDisplay])
to display or retrieve the relative path's offset to the Core's folder
mimimiUri([$toDisplay])
to display or retrieve the page's relative URI
mimimiFolders($dir[, $except])
to retrieve a list of folders in specific directory
The file also contains these constants:
MIMIMI_CLASS_PREFIX
mimimi.core / Module.php - it is the basis for other system modules of the application.
Details
This file introduces the MimimiModule class.
And the file defines some public methods for this class:
__construct([$owner]) - to create an instance of the class
run([$params]) - to perform some actions required for a basic start of the module
Also, the file defines some protected properties:
$cms - to access the application from the module
mimimi.core / ModuleWithTable.php - it is the basis for system DB modules that use the database table.
Details
This file introduces the MimimiModuleWithTable class.
And the file defines some protected methods for this class:
createTable() - to create the module's table
deleteTable() - to remove the module's table
clearTable() - to empty the module's table completely
addRecord($params) - to append a record to the module's table
updateRecord($id, $params) - to update the table's record by its identifier
deleteRecord($ids) - to delete the table's records by their identifiers
Also, the file defines some protected properties:
$table - to name a module's table
$tableFields - to list the table's columns
$tableKeys - to list the table's indexes
$tableOptions - to list the table's options
mimimi.core / Application.php - it is a class for the default application. This file is the simplest controller (in MVC terminology) and it contains a minimum of methods for working with your application.
Details
This file introduces the MimimiApplication class.
And the file defines some public methods for this class:
__get($property) - to load related module when this application's property is touched
Also, the file overrides these methods:
run([$params]) - to send a response to the user browser
mimimi.core /Themes /default / home.php - it is a template for the home page.
mimimi.core /Themes /default / helper.php - it is a library containing some routines to be used in files of this template.
mimimi.core /Themes /default / css / style.css - it is a CSS style for the home page.
mimimi.core /Themes /default / images / icons.svg - it is a SVG icons for the home page.
mimimi.core /Themes /default / js / script.js - it is a JavaScript logic for the home page.
What does the Core's homepage look like?
It depends on the design and layout of the default theme present in the framework. It is reasonable to assume that as new versions of the framework are released, some changes will be made to this theme. Of course, the changes will be related to the functionality of the new version. Therefore, to see the actual look of the home page, you should launch the actual version of the MiMiMi framework on your local machine.
If you are unable to launch the framework now, I will use a screenshot of the homepage from a previous version of the framework as a quick example.
The theme shown above has minimal functionality. Only one page has been implemented. The technique of generating markup by including independent PHP files (they are like HTML blocks) was not used. In addition, the theme implements an asynchronous handler for the "GDPR notice" box. The following logic is programmed into this handler:
If the user visits the website for the first time, the "GDPR notice" box is shown to him.
If the user has clicked the "Disable analysis" button, an implicit request with action=disable parameter is sent to the website to remember the user's choice in the user's session using setSession routine and then hide the "GDPR notice" box.
The next time the user visits the website, a request using getSession routine will be made to the user's session to determine their previous choice regarding "GDPR notice" display.
In addition to the hidden state, the box has 3 additional states (visible, pending, error), which are shown below.
You might be wondering how complex the program code is in this framework. I hasten to please that the code is incredibly simple. I tried to write it as easy as possible. And the result, in my opinion, is very impressive.
The user's request goes to the index.php file and leaves the website as a response from the home.php file. These input and output places are shown as blue dots in the following image.
The index.php file launches the Core's application. It is the Application.php file. This place is marked with a green dot, and a green bar indicates a public method run, which is like a router. Currently, this router always causes the home.php template to be rendered regardless of the input URI.
The template implements some logic, for which it loads the simplest routines located in the helper.php file. This place is marked with a purple dot, and the names of loaded routines are marked with a purple bar.