Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:entwickler:changes_to_functions_and_methods [2018/02/19 00:52] – [Admidio version 3.3] ximex | en:entwickler:changes_to_functions_and_methods [2022/04/15 20:11] (current) – fasse | ||
---|---|---|---|
Line 3: | Line 3: | ||
With this page we want to help plugin developers to stay compatible with the changes that were made in the Admidio core and that could affect plugins. During the development of Admidio we try to not change our existing methods and functions but sometimes it's necessary and could break your working plugin. Here you will find a list of methods and functions that we changed in a specific Admidio version with a notice how you could fix this in your plugin if you have used that method or function. | With this page we want to help plugin developers to stay compatible with the changes that were made in the Admidio core and that could affect plugins. During the development of Admidio we try to not change our existing methods and functions but sometimes it's necessary and could break your working plugin. Here you will find a list of methods and functions that we changed in a specific Admidio version with a notice how you could fix this in your plugin if you have used that method or function. | ||
- | ===== Admidio version | + | ===== Admidio version |
- | === New database class === | + | |
- | Within Admidio 3.1 we changed the database class. This was necessary because PHP7 knocks at the door and in this PHP version our used database functions were no longer supported. So we have rewritten the whole class and now use the PHP class [[https:// | + | |
- | Some methods must be removed because they are no longer necessary or there is another (better) way to find a solution. Please check if you use some of them and find a way to replace them with the new methods. | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | |||
- | Some methods are marked as deprecated. You can still use them but should switch to the new methods if there is time. Within our class documentation you will find hints how to implement the new methods: | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | * $gDb-> | ||
- | |||
- | === New syntax in language files === | ||
- | Within this version we use a new format for our translation files. Before it was an Admidio specific xml format. Now its the [[https:// | ||
- | |||
- | === Changes to DatetimeExtended class === | ||
- | Since our requirements for PHP are changed to 5.3 we could use a lot of methods of the PHP class [[https:// | ||
- | There are only 4 methods left: | ||
- | * isValid() | ||
- | * getAge() | ||
- | * getWeekdays($weekday = 0) | ||
- | * getDateFormatForDatepicker($format = ' | ||
- | If you have used other methods please change your script to use the official DateTime methods. | ||
- | |||
- | === Other changes === | ||
- | The functions **admFuncGetFilenameExtension** and **admFuncGetFilenameWithoutExtension** are marked as deprecated and will be removed in future versions. | ||
- | |||
- | ===== Admidio version 3.2 ===== | ||
=== Changes/ | === Changes/ | ||
- | Every usage of a deprecated function/ | + | == Class == |
+ | * **Menu** renamed | ||
+ | == Class methods == | ||
+ | * **HtmlPage-> | ||
+ | * **Email-> | ||
+ | * **Email-> | ||
- | Class **TableUsers** has been marked as deprecated. You should use the existing class **Users**. All methods of **TableUsers** have been moved to **Users**. The class **TableUsers** will be removed in future versions. | + | ===== Admidio version 4.1 ===== |
- | Method | + | === Call Admidio scripts with the UUID for user or role === |
+ | To prevend CSRF attacks as described in [[https:// | ||
+ | $user-> | ||
- | The functions | + | === Call Admidio scripts with the UUID for user or role === |
+ | The following methods are removed:\\ | ||
+ | **Session:: | ||
+ | **Session:: | ||
+ | **Session:: | ||
+ | New methods that could be used instead of them:\\ | ||
+ | **Session:: | ||
+ | **Session:: | ||
- | The config property **$g_root_path** is deprecated and replaced with new constant **ADMIDIO_URL**. There are some more new helpful constants defined: | ||
- | * BASIC STUFF | ||
- | * **ADMIDIO_HOMEPAGE**: | ||
- | * **HTTPS**: true, false | ||
- | * **PORT**: 80, 443, ... | ||
- | * **HOST**: ' | ||
- | * **DOMAIN**: ' | ||
- | * **ADMIDIO_SUBFOLDER**: | ||
- | * URLS | ||
- | * **SERVER_URL**: | ||
- | * **ADMIDIO_URL**: | ||
- | * **FILE_URL**: | ||
- | * **CURRENT_URL**: | ||
- | * PATHS | ||
- | * **WWW_PATH**: | ||
- | * **ADMIDIO_PATH**: | ||
- | * **CURRENT_PATH**: | ||
- | * FOLDERS | ||
- | * **FOLDER_DATA**: | ||
- | * **FOLDER_CLASSES**: | ||
- | * **FOLDER_LIBS_SERVER**: | ||
- | * **FOLDER_LIBS_CLIENT**: | ||
- | * **FOLDER_LANGUAGES**: | ||
- | * **FOLDER_THEMES**: | ||
- | * **FOLDER_MODULES**: | ||
- | * **FOLDER_PLUGINS**: | ||
===== Admidio version 3.3 ===== | ===== Admidio version 3.3 ===== | ||
Line 122: | Line 76: | ||
* **TableFile-> | * **TableFile-> | ||
* **TableFolder-> | * **TableFolder-> | ||
+ | * **TableRoles-> | ||
* **User-> | * **User-> | ||
== Class method params == | == Class method params == | ||
Line 134: | Line 89: | ||
* **admFuncGetBytesFromSize()**: | * **admFuncGetBytesFromSize()**: | ||
* **admReadTemplateFile()**: | * **admReadTemplateFile()**: | ||
+ | |||
+ | ===== Admidio version 3.2 ===== | ||
+ | === Changes/ | ||
+ | Every usage of a deprecated function/ | ||
+ | |||
+ | Class **TableUsers** has been marked as deprecated. You should use the existing class **Users**. All methods of **TableUsers** have been moved to **Users**. The class **TableUsers** will be removed in future versions. | ||
+ | |||
+ | Method **isWebmaster()** of the class **User** is marked as deprecated and will be removed in future versions. Use method **isAdministrator()** instead. | ||
+ | |||
+ | The functions **admFuncGetFilenameExtension** and **admFuncGetFilenameWithoutExtension** were marked as deprecated in version 3.1 and are now removed in this version. | ||
+ | |||
+ | The config property **$g_root_path** is deprecated and replaced with new constant **ADMIDIO_URL**. There are some more new helpful constants defined: | ||
+ | * BASIC STUFF | ||
+ | * **ADMIDIO_HOMEPAGE**: | ||
+ | * **HTTPS**: true, false | ||
+ | * **PORT**: 80, 443, ... | ||
+ | * **HOST**: ' | ||
+ | * **DOMAIN**: ' | ||
+ | * **ADMIDIO_SUBFOLDER**: | ||
+ | * URLS | ||
+ | * **SERVER_URL**: | ||
+ | * **ADMIDIO_URL**: | ||
+ | * **FILE_URL**: | ||
+ | * **CURRENT_URL**: | ||
+ | * PATHS | ||
+ | * **WWW_PATH**: | ||
+ | * **ADMIDIO_PATH**: | ||
+ | * **CURRENT_PATH**: | ||
+ | * FOLDERS | ||
+ | * **FOLDER_DATA**: | ||
+ | * **FOLDER_CLASSES**: | ||
+ | * **FOLDER_LIBS_SERVER**: | ||
+ | * **FOLDER_LIBS_CLIENT**: | ||
+ | * **FOLDER_LANGUAGES**: | ||
+ | * **FOLDER_THEMES**: | ||
+ | * **FOLDER_MODULES**: | ||
+ | * **FOLDER_PLUGINS**: | ||
+ | |||
+ | |||
+ | ===== Admidio version 3.1 ===== | ||
+ | === New database class === | ||
+ | Within Admidio 3.1 we changed the database class. This was necessary because PHP7 knocks at the door and in this PHP version our used database functions were no longer supported. So we have rewritten the whole class and now use the PHP class [[https:// | ||
+ | |||
+ | Some methods must be removed because they are no longer necessary or there is another (better) way to find a solution. Please check if you use some of them and find a way to replace them with the new methods. | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | |||
+ | Some methods are marked as deprecated. You can still use them but should switch to the new methods if there is time. Within our class documentation you will find hints how to implement the new methods: | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | * $gDb-> | ||
+ | |||
+ | === New syntax in language files === | ||
+ | Within this version we use a new format for our translation files. Before it was an Admidio specific xml format. Now its the [[https:// | ||
+ | |||
+ | === Changes to DatetimeExtended class === | ||
+ | Since our requirements for PHP are changed to 5.3 we could use a lot of methods of the PHP class [[https:// | ||
+ | There are only 4 methods left: | ||
+ | * isValid() | ||
+ | * getAge() | ||
+ | * getWeekdays($weekday = 0) | ||
+ | * getDateFormatForDatepicker($format = ' | ||
+ | If you have used other methods please change your script to use the official DateTime methods. | ||
+ | |||
+ | === Other changes === | ||
+ | The functions **admFuncGetFilenameExtension** and **admFuncGetFilenameWithoutExtension** are marked as deprecated and will be removed in future versions. | ||
+ | |||
+ |