Commit Graph

853 Commits

Author SHA1 Message Date
frytimo 5ed20f1c2f
Fix plugin class name mismatch in auto loader (#7350)
* Fix plugin class name mismatch in auto loader
When matching the file name of the plugins in the authentication plugin folder they do not match. This causes auto loader not to find and load the class.

* Update auto_loader.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
2025-04-01 09:07:26 -06:00
frytimo 5c1be1a318
Update clear cache method for settings object (#7348)
* update clear cache method for settings object

* re-use the database object from settings object
2025-03-31 10:04:33 -06:00
FusionPBX 0b9fd924a9
Add not empty check on the domains session 2025-03-29 13:20:38 -06:00
frytimo 00c6befb70
Add missing file path when cache miss in auto_loader (#7339) 2025-03-27 13:33:36 -06:00
frytimo b5af974d34
Add backslash to the trim command (#7338) 2025-03-26 14:56:55 -06:00
frytimo c165afc53e
Fix trim command on interface name (#7336) 2025-03-26 13:11:37 -06:00
frytimo 6d356194ba
Ensure apcu_cache_info function is available before calling (#7323) 2025-03-17 14:58:36 -06:00
frytimo 1572c76963
Use regex in autoloader instead of include (#7322) 2025-03-17 10:01:11 -06:00
frytimo ad1ba95566
Fix undefined constant error when flushing cache (#7321) 2025-03-17 10:00:25 -06:00
frytimo 0a42d8f198
Add caching to the auto_loader for interfaces (#7320)
* update auto loader to load and cache interfaces

* use new method to update the auto loader cache

* use new interface

* use new interface to trigger a cache flush

* update the console upgrade menu

* update the missing implements syntax

* add the clear_cache to the flush cache button
2025-03-15 09:13:36 -06:00
frytimo 77d2b3099a
Create get methods for domain_uuid and user_uuid (#7144)
* create get methods for domain_uuid and user_uuid
2025-03-13 14:32:51 -06:00
FusionPBX 6c6814b29e
Remove syntax that breaks older PHP
Removed :static to support PHP 7.4
2025-03-12 23:39:24 -06:00
FusionPBX 31a88e3a15
Update auto_loader.php 2025-03-12 14:48:33 -06:00
frytimo 08001488f4
Allow namespace in auto loader (#7307)
* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove class_exists wrapper for class definitions

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove include statement of class file

* remove closing tag

* remove invalid method params

* remove closing tag

* remove closing tag

* Update auto_loader to load each class file in the project
Update the auto_loader class to use an include statement on each file in the project to load the class within the file. This will allow mismatched names within the file to be loaded and mapped according to the declaration instead of the filename. The class is then checked against the parsed classes from the PHP engine so that namespaces are available and mapped to the file they were declared in. An update was also made to the search algorithm used to find a file that was not already loaded by collapsing the array to have only valid matches to increase performance on a cache miss. Logging within the auto_loader has been moved to a function.
Multiple files were modified to allow the include statement. When the class has the `if(class_exists())` statement, the auto_loader is called to check for the class. This caused an infinite loop scenario so all wrappers have been removed. The auto_loader will now break the loop by directly modifying the internal classes array instead of trying to restart with the 'reload_classes' method.

- APCu is used to cache classes so any loading of the classes is done only once. To clear the APCu cache, restart php-fpm or call the auto_loader::clear_cache() function.
- Cache file is used when APCu is not available. To clear the cache remove it from the tmp folder or call the auto_loader::clear_cache() function.
- All classes must no longer have a class_exists wrapper to benefit from the performance boost.
- Classes should not be directly included when the auto_loader is used.

* remove include statement of class file

* Update destinations.php
2025-03-12 13:55:47 -06:00
frytimo d529021b3f
Use boolean setting as true boolean (#7284)
* use boolean setting as true boolean

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.

* Update settings class to use the php filter_var function for boolean
Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested.
I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.
2025-03-04 11:25:47 -07:00
fusionate 7b3b3aa5f9
Menu: New option to set icon colors. 2025-03-03 14:08:05 -07:00
FusionPBX a15488a708
Update the condition for validate certificate for a boolean value 2025-03-02 10:45:31 -07:00
frytimo f8e1e81546
fix wrong logical check (#7282)
Forgot to remove the '!' (not) operator from the cache check when re-organizing the update cache function
2025-02-27 21:09:31 -07:00
frytimo d919a3cc1b
Add the apcu caching ability for performance (#7276)
* add the apcu caching ability for performance
When the PHP extension APCu is loaded, the settings class and the auto_loader will cache their results across requests in RAM. For more information about the APCu extension visit the PHP page: https://www.php.net/apcu

* use global instead of default terminology
2025-02-25 17:21:41 -07:00
frytimo fd34a000a6
Add old search method for auto loading classes (#7261)
Adding this commit to ensure backwards compatibility and a fail-safe mechanism for loading a class
2025-02-20 11:24:39 -07:00
frytimo 5e6ec475df
update auto_loader cache file when updating (#7255) 2025-02-15 10:44:46 -07:00
frytimo dc0f146485
fix php warning in menu class (#7256)
initialize variable before use
2025-02-15 10:43:03 -07:00
FusionPBX c4aa9e9b02
Update the cache after loading classes array 2025-02-13 15:05:27 -07:00
frytimo 0931197137
build array in auto_loader constructor (#7158)
* Build an array in the auto_loader constructor

* Update auto_loader.php

* Update auto_loader.php

* minor adjustment to name and comment and remove trailing closing tag

* use best practices for the loader method
Allowing the loader method:
- Should Never Be Called Manually
- Prevents External Modification
- Hides Implementation Details

* cache array in the temp folder and load if available

* re-organize functions within the class

* add cache recreation for auto_loader in upgrade_menu

* add cache recreation for auto_loader in upgrade_menu

* Update app_languages.php
2025-02-13 14:48:40 -07:00
fusionate 5b1697fc17
Menu - Fixed: Change to submenu item links to hopefully resolve random submenu closure on click bug. 2025-02-11 18:02:16 -07:00
frytimo d6f9b25283
format schema class (#7145)
- format schema class using autoformat
2025-01-28 17:05:00 -07:00
FusionPBX b8b796316e
Add method column_exists to the database class 2025-01-28 15:35:02 -07:00
frytimo f6adc9bdd0
suppress access on null php notice in new is_connected method (#7227) 2025-01-23 12:38:03 -07:00
frytimo 95faf83337
add is_connected method to database (#7225) 2025-01-23 11:42:19 -07:00
FusionPBX 18bce0437d
Add more debug details and return false 2025-01-22 20:35:53 -07:00
FusionPBX 7e4f82f840
Enhance message array debug details 2025-01-22 20:07:02 -07:00
FusionPBX 8ea79e56e7
Replace exit; with return false; 2025-01-22 19:26:25 -07:00
frytimo 62039c300a
fix menu php warning when restoring default menu (#7219) 2025-01-17 13:39:17 -07:00
fusionate 93309e17f9
Side Menu: Improved behavior for Expanded and Hidden states when clicking on the content body. 2025-01-15 13:56:02 -07:00
Alex 02aacd2c40
Fix menu_side_brand_image_contracted not showing (#7195) 2024-12-10 16:51:36 -07:00
Alex f0bc1cfe33
Update contacts path (#7192)
* Update contacts path

* Update menu.php

* Update contact_edit.php

* Update contact_relation_edit.php

* Update config.php

* Update authentication.php

* Update database.php

* Update totp.php

* Update email.php
2024-12-06 11:55:41 -07:00
FusionPBX cd8d5302ac
Fix temporary permissions 2024-11-29 13:57:01 -07:00
FusionPBX 4db95658c3
Method new allow null
Needed to support temporary permissions
2024-11-29 13:50:14 -07:00
FusionPBX 3a14a19800
Create a singleton method called new 2024-11-27 00:11:58 -07:00
FusionPBX 6e1d52e6b8
Update permissions.php 2024-11-26 22:49:23 -07:00
FusionPBX 5d7a124a79
Fix permissions when not using a session 2024-11-26 21:48:08 -07:00
frytimo b7afc086ec
Update the menu class (#7181)
* fix php warnings in the menu class

* remove an unreachable statement

* update the menu_horizontal function to use settings

* use a single text object

* update menu_side_state to use the default value of contracted

* remove unused variable

* use variables for menu_side_state

* remove unused variable

* remove whitespace

* remove unused variable

* check for user UUID and domain UUID passed to the constructor

* update docs
2024-11-25 10:34:16 -07:00
FusionPBX 2a41ccfebd
Return an empty array if there are no groups 2024-11-20 13:52:58 -07:00
fusionate 37ff548fa8
Side / Fixed Menu: Image placeholder tool tip. 2024-10-31 11:49:31 -06:00
fusionate b766ad7f27
Side / Fixed Menu: Image placeholder for User Menu in Body Header / menu bar. 2024-10-31 11:37:17 -06:00
FusionPBX c81e6482a8
Replace the empty function with isset
Don't use empty when value can be 0
2024-10-27 11:08:37 -06:00
FusionPBX 6e1ef36821
Correct the use of the settings class 2024-10-25 12:44:05 -06:00
FusionPBX e49e2f01ce
Remove redundant code
Handled in the constructor
2024-10-23 10:54:52 -06:00
frytimo 557de4b744
Update settings using real boolean (#7165)
* update settings using real boolean
2024-10-22 18:55:19 -06:00
FusionPBX 56c59289d4
Update boolean settings
Settings of type boolean need to be set as boolean.
2024-10-22 18:15:35 -06:00