diff --git a/application/module/users/interfaces/users.php b/application/module/users/interfaces/users.php deleted file mode 100644 index ab40652..0000000 --- a/application/module/users/interfaces/users.php +++ /dev/null @@ -1,16 +0,0 @@ -=8.1.0", + "php": ">=8.2.0", "smarty/smarty": "^3.1", - "phpmailer/phpmailer": "^6.1", + "phpmailer/phpmailer": "^6.9.1", "dasprid/enum": "^1.0.3", - "bacon/bacon-qr-code": ">=1.0.3", "mevdschee/php-crud-api": "^2.14", "symfony/psr-http-message-bridge": "^2.1", - "laminas/laminas-diactoros": "^2.24" + "laminas/laminas-diactoros": "^2.24", + "guzzlehttp/guzzle": "^7.8.1", + "brick/date-time": "^0.4.1", + "ext-memcached": "*", + "ext-gd": "*", + "ext-pdo": "*", + "openai-php/client": "^v0.8.4", + "elasticsearch/elasticsearch": "7.17.0", + "ext-curl": "*", + "picqer/php-barcode-generator": "^2.4", + "bacon/bacon-qr-code": "^2.0", + "enjin/php-blockchain-tools": "^1.15" } -} \ No newline at end of file +} diff --git a/core/a/module.php b/core/a/module.php new file mode 100644 index 0000000..3d1ddf7 --- /dev/null +++ b/core/a/module.php @@ -0,0 +1,21 @@ +$name = $value; + } + } catch (\Exception $e) { + error_log("Exception in _set method: " . $e->getMessage()); + } catch (\Error $e) { + error_log("Error in _set method: " . $e->getMessage()); + } + } + /** + * @desc will return the value of the requested property + * @param string $name + * @return mixed + */ + protected function _get(string $name): mixed + { + try { + $_class_properties = get_class_vars(__CLASS__); + if (array_key_exists($name, $_class_properties)) + { + return $this->$name; + } + } catch (\Exception $e) { + error_log("Exception in _get method: " . $e->getMessage()); + } catch (\Error $e) { + error_log("Error in _get method: " . $e->getMessage()); + } + } +} \ No newline at end of file diff --git a/core/c/pdo.php b/core/c/pdo.php index ce02b20..511c764 100755 --- a/core/c/pdo.php +++ b/core/c/pdo.php @@ -9,7 +9,7 @@ * @category - [PLEASE SPECIFIY] * @license - BSD License */ -final class Pdo extends Mysql implements IPdo +final class pdo extends Mysql implements IPdo { private static $section = false; @@ -55,11 +55,11 @@ protected static function loadTableNames(): array /** - * @param string $string - * - * @return array - */ - public static function query( $string = self::PLACE_NO_QUERY ) + * @param string $string + * + * @return array|bool + */ + public static function query( $string = self::PLACE_NO_QUERY ): array|bool { if(!strstr($string, IOdbc::PLACE_SQL_UPDATE)) @@ -84,14 +84,14 @@ public static function query( $string = self::PLACE_NO_QUERY ) else { $query = parent::getInstance( self::getSettingsSection() )->getConn(); - $query->exec($string); + return $query->exec($string); } } /** * @return array */ - private static function convertFetchToAssociative( array $result ): array + private static function convertFetchToAssociative( array $result ): array { $resultset = []; if(array_key_exists(0, $result)) @@ -168,10 +168,10 @@ public static function selectDatasetByFieldAndValue($tablename = self::PLACE_TAB * @param string $where_value */ public static function updateColumnByFieldWhere( $tablename = self::PLACE_TABLE_NAME, - $column_name = IMysql::PLACE_COLUMN_NAME, - $parameter_name = IMysql::PLACE_SEARCH_TERM, - $field_name = IMysql::PLACE_FIELD_NAME, - $where_value = IMysql::PLACE_WHERE_VALUE ) + $column_name = IMysql::PLACE_COLUMN_NAME, + $parameter_name = IMysql::PLACE_SEARCH_TERM, + $field_name = IMysql::PLACE_FIELD_NAME, + $where_value = IMysql::PLACE_WHERE_VALUE ) { $statement = parent::getInstance( self::getSettingsSection() )->getConn(); $query = "UPDATE " . $tablename . " SET " . $column_name . " = :" . $column_name . " WHERE " . $field_name . " = :". $field_name; @@ -250,12 +250,12 @@ public static function updateRowById(string $tableName, array $columnNames, arra * @param bool $id * @return array */ - public static function fetchRowInArrayById($tablename = self::PLACE_TABLE_NAME, $id = self::NO_ID ) - { + public static function fetchRowInArrayById($tablename = self::PLACE_TABLE_NAME, $id = self::NO_ID ) + { $result = array(); - $statement = parent::getInstance( self::getSettingsSection() )->getConn(); - $describe = $statement->query('DESC ' . $tablename); - $describe->execute(); + $statement = parent::getInstance( self::getSettingsSection() )->getConn(); + $describe = $statement->query('DESC ' . $tablename); + $describe->execute(); $tableInformation = $describe->fetchAll( \PDO::FETCH_ASSOC ); foreach ( $tableInformation as $entry ) { @@ -360,9 +360,9 @@ public static function fetchRowsInArrayByWhere($tablename = IMysql::PLACE_TABLE_ * @return int|string */ public static function getLastInsertedID() - { - return parent::getInstance( self::getSettingsSection() )->getConn()->lastInsertId(); - } + { + return parent::getInstance( self::getSettingsSection() )->getConn()->lastInsertId(); + } /** * @param string $tablename @@ -407,7 +407,7 @@ public static function fetchTableAsArray( $tablename = self::PLACE_TABLE_NAME, $ * @param bool $encrypted * @return bool */ - public static function insertArrayIntoTable( $tablename = IMysql::PLACE_TABLE_NAME, $array_name = IMysql::PLACE_ARRAY_NAME, $encrypted = IMysql::PLACE_DES_ENCRYPT ): bool + public static function insertArrayIntoTable( $tablename = IMysql::PLACE_TABLE_NAME, $array_name = IMysql::PLACE_ARRAY_NAME, $encrypted = IMysql::PLACE_DES_ENCRYPT ): bool { $statement = parent::getInstance( self::getSettingsSection() )->getConn(); diff --git a/core/c/typecheckbox.php b/core/c/typecheckbox.php index 5efbde8..64084a0 100755 --- a/core/c/typecheckbox.php +++ b/core/c/typecheckbox.php @@ -33,7 +33,7 @@ public function loadElement( $attributes ) */ private function _setElement( ) { - $this->_element = '' . ' VALUE
' . "\n"; + $this->_element = '' . ' VALUE' . "\n"; } diff --git a/core/framework.php b/core/framework.php index 930799f..367e63d 100644 --- a/core/framework.php +++ b/core/framework.php @@ -20,29 +20,29 @@ require_once __DIR__ . '/c/config.php'; require_once __DIR__ . '/c/registry.php'; require_once __DIR__ . '/c/router.php'; -require_once __DIR__ . '/i/engine.php'; +require_once __DIR__ . '/i/IEngine.php'; require_once __DIR__ . '/c/engine.php'; require_once __DIR__ . '/l/autoload.php'; /** * @desc Database connectivity */ -require_once __DIR__ . '/i/mysql.php'; +require_once __DIR__ . '/i/IMysql.php'; require_once __DIR__ . '/c/mysql.php'; -require_once __DIR__ . '/i/pdo.php'; +require_once __DIR__ . '/i/IPdo.php'; require_once __DIR__ . '/c/pdo.php'; /** * @desc Database ODBC support */ -require_once __DIR__ . '/i/odbc.php'; +require_once __DIR__ . '/i/IOdbc.php'; require_once __DIR__ . '/c/odbc.php'; -require_once __DIR__ . '/i/postgres.php'; +require_once __DIR__ . '/i/IPostgres.php'; require_once __DIR__ . '/c/postgres.php'; -require_once __DIR__ . '/i/psql.php'; +require_once __DIR__ . '/i/IPsql.php'; require_once __DIR__ . '/c/psql.php'; -require_once __DIR__ . '/i/postgresql.php'; +require_once __DIR__ . '/i/IPostgresql.php'; require_once __DIR__ . '/c/postgresql.php'; -require_once __DIR__ . '/i/db.php'; -require_once __DIR__ . '/i/pageination.php'; +require_once __DIR__ . '/i/IDb.php'; +require_once __DIR__ . '/i/IPageination.php'; require_once __DIR__ . '/a/mysql.db.php'; require_once __DIR__ . '/a/postgres.db.php'; require_once __DIR__ . '/a/postgresql.db.php'; @@ -53,7 +53,7 @@ /** * @desc MVC functionality */ -require_once __DIR__ . '/i/form.php'; +require_once __DIR__ . '/i/IForm.php'; require_once __DIR__ . '/f/form.php'; require_once __DIR__ . '/t/form.php'; require_once __DIR__ . '/c/formattributes.php'; @@ -85,16 +85,22 @@ require_once __DIR__ . '/c/typeclosediv.php'; require_once __DIR__ . '/c/typeopenany.php'; require_once __DIR__ . '/c/typecloseany.php'; -require_once __DIR__ . '/i/view.php'; +require_once __DIR__ . '/i/IView.php'; require_once __DIR__ . '/c/view.php'; -require_once __DIR__ . '/i/controller.php'; +require_once __DIR__ . '/i/IController.php'; require_once __DIR__ . '/c/controller.php'; require_once __DIR__ . '/a/controller.php'; require_once __DIR__ . '/c/jsonnavigation.php'; +/** + * @desc MMVC functionality + */ +require_once __DIR__ . '/i/IModule.php'; +require_once __DIR__ . '/a/module.php'; +require_once __DIR__ . '/c/module.php'; /** * @desc currently unfinished */ -require_once __DIR__ . '/i/auth.php'; +require_once __DIR__ . '/i/IAuth.php'; require_once __DIR__ . '/c/auth.php'; /** * @desc main application starters diff --git a/core/i/auth.php b/core/i/IAuth.php similarity index 100% rename from core/i/auth.php rename to core/i/IAuth.php diff --git a/core/i/controller.php b/core/i/IController.php similarity index 100% rename from core/i/controller.php rename to core/i/IController.php diff --git a/core/i/db.php b/core/i/IDb.php similarity index 100% rename from core/i/db.php rename to core/i/IDb.php diff --git a/core/i/engine.php b/core/i/IEngine.php similarity index 100% rename from core/i/engine.php rename to core/i/IEngine.php diff --git a/core/i/form.php b/core/i/IForm.php similarity index 100% rename from core/i/form.php rename to core/i/IForm.php diff --git a/core/i/IModule.php b/core/i/IModule.php new file mode 100644 index 0000000..3389a91 --- /dev/null +++ b/core/i/IModule.php @@ -0,0 +1,15 @@ +