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 f54835a5a7 Merge branch 'mcontrol' into develop 2 سال پیش
core 7a40b2f77c New method [getGroupName] to get name of the group by identifier. 5 سال پیش
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. 7 سال پیش
documents 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 10 سال پیش
install 12a6d40aa5 Ability to install mcontrol was disabled because the development of the plug-in was freezed. 2 سال پیش
jslibs d817c13c7a System paths have been changed to prevent appearance of the bug on RedHat OpenShift. 10 سال پیش
phplibs d817c13c7a System paths have been changed to prevent appearance of the bug on RedHat OpenShift. 10 سال پیش
servpages 7fc74bb104 Stub-page displays secondary message only if maintenance mode is expired. Default value of the secondary message is changed. Other minor changes. 6 سال پیش
shfiles 8bef4698c9 New system constant [MECCANO_SHARED_FILES] and system directory have been added. MySQL query has been updated. 9 سال پیش
tmp 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 10 سال پیش
uninstall 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 10 سال پیش
unpacked 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 10 سال پیش
CHANGELOG.md 10f214a0eb Updated CHANGELOG files. 5 سال پیش
CHANGELOG_RU.md 10f214a0eb Updated CHANGELOG files. 5 سال پیش
LICENSE 5c64f4a715 Readme and license have been added. Some minor changes. 10 سال پیش
README.md 5842a4a29e Minor change. 5 سال پیش
README_RU.md 7b0f0936eb Updated README files. 5 سال پیش
conf.php b1fb92bd2b Minor changes. 5 سال پیش
index.html 76b0de9e73 Contact information has been updated. License agreement has been added into some files. 10 سال پیش

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.