phpMeccano is the open-source module-structured PHP framework. Framework phpMeccano gives API of many abilities. Plug-in system allows to extend capacity and to add new features.

Alexei Muzarov f7da58c456 Merge branch 'develop' 4 years ago
core 85fb0b5c17 Added new function to get database link simplier. 4 years ago
csslibs 388db15b65 New constant [MECCANO_CSS_DIR] to define path to the css libs. Installation package specification was updated to version 0.3. Core plugin [plugins.php] and web installer were updated to support package version 0.3. 6 years ago
documents 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 8 years ago
install 39c3ae602e Changed encoding to support emoji. 4 years ago
jslibs d817c13c7a System paths have been changed to prevent appearance of the bug on RedHat OpenShift. 8 years ago
phplibs d817c13c7a System paths have been changed to prevent appearance of the bug on RedHat OpenShift. 8 years ago
servpages 7fc74bb104 Stub-page displays secondary message only if maintenance mode is expired. Default value of the secondary message is changed. Other minor changes. 5 years ago
shfiles 8bef4698c9 New system constant [MECCANO_SHARED_FILES] and system directory have been added. MySQL query has been updated. 8 years ago
tmp 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 8 years ago
uninstall 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 8 years ago
unpacked 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 8 years ago
CHANGELOG.md 10f214a0eb Updated CHANGELOG files. 4 years ago
CHANGELOG_RU.md 10f214a0eb Updated CHANGELOG files. 4 years ago
LICENSE 5c64f4a715 Readme and license have been added. Some minor changes. 8 years ago
README.md 5842a4a29e Minor change. 4 years ago
README_RU.md 7b0f0936eb Updated README files. 4 years ago
conf.php b1fb92bd2b Minor changes. 4 years ago
index.html 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 8 years ago

README.md

phpMeccano - a framework for development of web services

phpMeccano is an open-source module-structured PHP framework. Framework phpMeccano gives APIs with the following abilities:

  • creation and management of the user groups;
  • authentication of the users, including 2FA;
  • control of access to functions through the group policy;
  • creation of the multilingual interface;
  • copying, moving and removing of the local files and folders;
  • logging of the events;
  • creation and sharing of the messages and files between contacts of the user like in simple social network;
  • creation of the topics to discuss and to comment them;
  • management of the web service's maintenance mode.

Plug-in system allows to extend capabilities and to add new features. Current framework version is the third alpha version.

Requirements

phpMeccano requires web server (Apache, NGINX or lighttpd) with installed and configured PHP and MySQL/MariaDB.
phpMeccano was tested with the following environments:

  • Debian 10
  • Apache 2.4.38
  • PHP 7.3.9
  • MariaDB 10.3.17

===================================

  • CentOS Linux 7
  • Apache 2.4.6
  • PHP 5.4.16
  • MariaDB 5.5.64

===================================

  • Ubuntu 18.04
  • Apache 2.4.29
  • PHP 7.2.19
  • MySQL 5.7.27

===================================

  • Ubuntu 18.04
  • nginx/1.14.0
  • PHP 7.2.19
  • MySQL 8.0.17

===================================

  • Ubuntu 18.04
  • lighttpd/1.4.45
  • PHP 7.2.19
  • MySQL 8.0.17

To run web installer you should use the recent versions of Firefox or Pale Moon; any WebKit/Blink based browser (Chromium, Google Chrome, Yandex Browser, Opera, Safari etc.); or Microsoft Edge. Web installer has been tested with desktop, iOS and Android versions of browsers.

Installation

Make sure that framework components are placed into the web-accessible directory. Then edit file conf.php and set the database parameters:

  • MECCANO_DBSTORAGE_ENGINE - database storage engine. Available values are "MyISAM" and "InnoDB";
  • MECCANO_DBANAME - name of the database administrator;
  • MECCANO_DBAPASS - password of the database administrator;
  • MECCANO_DBHOST - database host;
  • MECCANO_DBPORT - database port;
  • MECCANO_DBNAME - name of the database;
  • MECCANO_TPREF - prefix of the database tables.

Also you may edit system paths at your opinion. Make sure that web server has read/write access to files and directories.

By editing value of MECCANO_DEF_LANG you can set default language. Initially available values are "en-US" (English) and "ru-RU" (Russian).

Refer to the documentation to get more info.

Save changes.

Now open web browser and go to address http://hostname/install/ to run web installer.

API Reference

Please, follow the wiki to get the API reference. There are available English and Russian versions.

Bitbucket
GitHub

Code example

Write the following code to pass an authentication:

#!php

<?php

header('Content-Type: text/html; charset=utf-8');

require_once 'conf.php';
\core\loadPHP('auth');

$db = \core\dbLink();
$auth = new \core\Auth($db);

$auth_code = $auth->userLogin("your_username", "your_password");
if (is_string($auth_code)) {
    if ($auth->login2FA($auth_code)) {
        echo "You have passed two-factor authentication";
    }
    else {
        echo $auth->errExp();
    }
}
elseif ($auth_code) {
    echo "You have passed single-factor authentication";
}
else {
    echo $auth->errExp();
}

License

GNU General Public License, version 2, or (at your option) any later version.