Fixes the following:
- The service would exit but fail to remove the PID file when the shutdown command was sent to the service.
Added the following:
- Better feedback during service start up if the PID fails to be created
- Appropriate POSIX error codes on failure of modifying the PID file
* Fix auto_loader duplicate classes in the interface list
This patch will stop the auto_loader from adding the same class to the interface list if it already exists in the list.
* Update auto_loader.php
* Initial commit of websockets
* Move app_menu to the active_calls websockets
* Fix hangup function
* Remove connection wait-state on web socket server so events can process
* Add timestamp and debug level to console for service debug output
* Remove debug exit
* Fix typo for ws_client instead of ws_server
* Update app_config.php
* Fix typo and remove empty function
* Remove call to empty function
* Fix the menu to point to the correct location
* Remove Logging Class
* Rename service file
* Rename service file
* Fix the in progress browser request
* Fix browser reload and implement 'active_calls' default values
* Add apply_filter function
* Create new permission_filter object
* In progress active calls now use filter
* Add invalid_uuid_exception class
* add event_key_filter to honor user permissions
* add and_link and or_link for filters
* Fix disconnected subscriber and add filters to honor permissions
* Add $key and $value for filter
* define a service name
* catch throwable instead of exception
* Add $key and $value for filter and allow returning null
* Update permission checks when loading page
* Add apply_filter function to honor subscriber permissions
* Add create_filter_chain_for function to honor subscriber permissions
* Add apply_filter function to honor subscriber permissions
* Add apply_filter function to honor subscriber permissions
* create interface to allow filterable payload
* create interface to define functions required for websocket services
* Pass in service class when creating a service token
* Allow key/name and return null for filter
* Adjust subscriber exceptions to return the ID of the subscriber
* Add event filter to filter chain
* Add command line options for ip and port for websockets and switch
* update service to use is_a syntax
* initial commit of base class for websockets system services
* initial commit of the system cpu status service
* remove extra line feed
* fix path on active_calls
* initial proof of concept for cpu status updated by websockets
* Allow returning null
* Use default settings to set the interval for cpu status broadcast
* Improve the CPU percent function for Linux systems
* Show more debug information
* Allow child processes to re-connect to the web socket service
* Fix websockets as plural instead of singular
* Add class name list-row
* Update active_calls.php
* Update active_calls.php
* Update websocket_client.js
* Update app_config.php
* Update app_menu.php
* Update debian-websockets.service
* Update debian-active_calls.service
---------
Co-authored-by: FusionPBX <markjcrane@gmail.com>
* 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>
* 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
* 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
* 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.
* 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