Commit Graph

60 Commits

Author SHA1 Message Date
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
FusionPBX
cd8d5302ac Fix temporary permissions 2024-11-29 13:57:01 -07:00
FusionPBX
e186958006 Delete app/dialplans/resources/classes/dialplan.better.php 2024-10-04 00:26:06 -06:00
frytimo
2cbb4dbc31 remove instances where a pointer is used in a foreach loop for value (#7108) 2024-08-22 12:41:10 -06:00
fusionate
4b23913555 Update Font Awesome to v6.6.x, adjust some icon references. 2024-08-09 18:14:52 -06:00
FusionPBX
a69b4d91f1 Update database handling 2024-08-05 16:19:34 -06:00
frytimo
058d9aba37 fix failing to save dialplan details xml in proper order (#6994) 2024-06-03 13:30:59 -06:00
fusionate
e81220d997 Time Conditions - Edit: Mitigate PHP 8.x warnings. 2024-05-13 11:22:32 -06:00
frytimo
41eb7ac8d3 Fix empty line printing on console (#6956)
* fix empty line printing on console
2024-04-23 08:53:14 -06:00
FusionPBX
dedafeccc8 Account for dialplan_detail_enabled false 2023-12-08 16:19:17 -07:00
FusionPBX
fa123ff069 Build dialplan xml from the array. More efficient to save data and xml in one step. 2023-11-03 02:18:57 -06:00
markjcrane
278ae0376b When using dialplan details with the public context ensure call_direction, domain_name and domain_uuids is added to each dialplan detail group 2023-07-15 18:32:25 -06:00
markjcrane
1f0c30529b Add dialplan condition regex 2023-07-14 20:44:40 -06:00
fusionate
9a7311b825 Dialplan [Class]: Updates for PHP 8.1 2023-06-06 21:45:44 +00:00
fusionate
b235f951a1 Dialplan [Class]: Updates for PHP 8.1 2023-05-20 23:57:27 +00:00
markjcrane
6d7e125743 Fix all PHP 8.1 messages for upgrade.php 2023-05-17 10:07:49 -06:00
FusionPBX
445b63ec3a Update dialplan.php to prevent PHP 8.1 warnings 2023-05-13 12:55:33 -06:00
frytimo
fef8165be2 Frytimo pr patches for php8.1 (#6630)
* Passing null to parameter #2 ($string) of type string is deprecated

* Passing null to parameter #1 ($string) of type string is deprecated

* php 8.1 fixes

* php 8.1 fixes - replace strlen($var) > 0 with !empty($var)

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - strlower with null

* php 8.1 fixes - strreplace with null

* php 8.1 fixes - passing null to base64_decode

* php 8.1 fixes - check for false and check for null on $this->dir

* php 8.1 fixes - remove assignment of $db variable to modules object

* php 8.1 fixes - avoid sending null to substr

* php 8.1 fixes - change ${var} to {$var}

* php 8.1 fixes - check for null before preg_replace

* php 8.1 fixes - remove setting db variable on domains object

* php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null

* php 8.1 fixes - set empty string if $_REQUEST['show'] is not available

* php 8.1 fixes

* php 8.1 fixes - correct $_POST checking syntax

* php 8.1 fixes - correct $_POST variables

* php 8.1 fixes

* Use brackets consistently

* Update user_setting_edit.php

* Change to not empty

* Update device.php

* Update text.php

---------

Co-authored-by: Tim Fry <tim@voipstratus.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-05-05 10:46:37 -06:00
FusionPBX
d5850f154c Update the array path after removing context tag 2023-03-27 16:49:36 -06:00
Luis Daniel Lucio Quiroz
c4422e65f8 Remove redundant SQL condition (#6573)
In this condition you already have  p.dialplay_uuid = s.dialplay_uuid  and you have p.dialplay_uuid = CONST, no need tor s.dialplay_uuid=CONST,

In small databases, this could be trivial; but in significant databases, this saves a lot of processing.
2023-03-09 14:13:50 -07:00
FusionPBX
530ba85969 Option to disable dialplan conditions 2023-02-01 11:33:36 -07:00
frytimo
7993998927 remove space before tag (#6335)
Having a space before the opening of the PHP tag causes headers to be sent prematurely.
2022-03-29 20:34:29 -06:00
FusionPBX
75e4fd94ab Use global instead of ${domain_name}. 2021-12-11 10:07:52 -07:00
FusionPBX
06f580ab05 app_uuid needs to be unique for copied dialplans except for inbound and outbound routes, fifo, time conditions 2021-11-19 22:07:26 -07:00
FusionPBX
0004a44d1c When copying a dialplan use a unique uuid for app_uuid. 2021-10-29 13:06:17 -06:00
FusionPBX
3ce50ef8d2 Add a comment with description: add a band-aid for CLI editors with faulty syntax highlighting 2021-04-09 12:12:31 -06:00
Luis Daniel Lucio Quiroz
8721dc8e80 [4.5] This is a pure cosmetic fix
When editing in the CLI with any editor that does syntax highlight, the * breaks it. Adding on the following line /* **/ restores the right highlighting
2021-04-01 14:25:17 -04:00
FusionPBX
3385b296fa Improve dialplan import efficiency.
- Add a more efficient way to check if the dialplan exits
- Remove restore_advanced_xml not used anymore.
- Add dialplan_context = public
2021-03-30 12:59:47 -06:00
FusionPBX
d10634d4b3 Add ability to import enabled attribute from the dialplan xml. 2021-01-25 10:12:29 -07:00
FusionPBX
1ddf5bbf41 Check if dialplan_detail_enabled is true or if null consider the value as true and add line feeds to improve readability of the SQL statement. 2021-01-19 18:59:09 -07:00
FusionPBX
c60f2e492f After importing the dialplans generate the dialplan xml. 2020-12-14 18:00:04 -07:00
FusionPBX
dc8f9146ba Update the array name so that is_array evaluates to true. 2020-12-14 17:31:41 -07:00
fusionate
46b2f00826 Dialplan Manager: Adjust toggle method to support multiple domains if used on show all. 2020-12-04 12:53:51 -07:00
fusionate
c67c8cd4c2 Destination Select - Dynamic: Clear session array on add/toggle/delete of a destination type record. 2020-11-30 14:15:57 -07:00
FusionPBX
d770e2f4ad Remove deprecated methods dialplan_detail_add and dialplan_detail_update. 2020-08-17 10:52:10 -06:00
FusionPBX
3161cd638b Remove the old save_dialplan_xml function. 2020-08-14 00:13:17 -06:00
FusionPBX
c8b45c9eb5 Remove root.php 2020-08-13 23:10:49 -06:00
Nate
f5bf44758b Dialplans - Edit: Permission adjustments. 2020-02-27 14:06:07 -07:00
Nate
05212dc713 Dialplans - Edit: Integrate checkboxes on Details for bulk delete on Save (uses token). Add delete button with dynamic action. 2020-02-27 13:41:13 -07:00
Nate
a8a215d10e Dialplans: Minor adjustment to class delete method. 2019-12-09 11:33:30 -07:00
Nate
bec5c647c9 List View: Updates to action classes. 2019-11-30 15:18:48 -07:00
Nate
243ae25e1f Dialplans: List view updates. 2019-11-07 23:05:38 -07:00
FusionPBX
c3b815fc2d Update dialplan.php 2019-10-22 20:56:34 -06:00
FusionPBX
f5b60fb31c Update dialplan.php 2019-10-22 14:34:18 -06:00
FusionPBX
f0e02654b2 Update dialplan.php 2019-10-20 18:45:47 -06:00
FusionPBX
7070cccb16 Update dialplan.php 2019-10-19 19:07:47 -06:00
FusionPBX
698b18a63a Update dialplan.php 2019-09-02 23:29:14 -06:00
FusionPBX
0aa002dc1d Update dialplan.php 2019-09-02 22:54:26 -06:00
Nate
836fb87136 Misc Classes: Database class integration. 2019-09-02 15:57:18 -06:00
ednt
31170138e7 A typo at the last commit (#4313) 2019-06-27 07:06:40 -06:00