Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error #78

Open
maxulm opened this issue Oct 11, 2024 · 2 comments
Open

Installation error #78

maxulm opened this issue Oct 11, 2024 · 2 comments

Comments

@maxulm
Copy link

maxulm commented Oct 11, 2024

Array and string offset access syntax with curly braces is no longer supported

/var/www/html/admin/modules/endpointman/lib/json.class.php

   /**
    * convert a string from one UTF-16 char to one UTF-8 char
    *
    * Normally should be handled by mb_convert_encoding, but
    * provides a slower PHP-only method for installations
    * that lack the multibye string extension.
    *
    * @param    string  $utf16  UTF-16 character
    * @return   string  UTF-8 character
    * @access   private
    */
    function utf162utf8($utf16)
    {
        // oh please oh please oh please oh please oh please
        if(function_exists('mb_convert_encoding')) {
            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
        }

        $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});

        switch(true) {
            case ((0x7F & $bytes) == $bytes):
                // this case should never be reached, because we are in ASCII range
                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
                return chr(0x7F & $bytes);

            case (0x07FF & $bytes) == $bytes:
                // return a 2-byte UTF-8 character
@jcattan
Copy link

jcattan commented Oct 11, 2024

change this line : $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
by this one : $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);

@maxulm
Copy link
Author

maxulm commented Oct 11, 2024

Thanks for your fast reply @jcattan
I've modified all the arrays in the file, but now the installations stops here:

/var/www/html/admin/modules/endpointman/Endpointman.class.php

public $UPDATE_PATH;
public $MODULES_PATH;
public $LOCAL_PATH;
public $PHONE_MODULES_PATH;
public $PROVISIONER_BASE;


public function __construct($freepbx = null) {
    if ($freepbx == null) {
        throw new \Exception("Not given a FreePBX Object");
    }
    require_once('lib/json.class.php');
    require_once('lib/Config.class.php');
    require_once('lib/epm_system.class.php');
    require_once('lib/datetimezone.class.php');
    require_once('lib/epm_data_abstraction.class.php');
    //require_once("lib/RainTPL.class.php");

    $this->freepbx = $freepbx;
    $this->db = $freepbx->Database;
    $this->config = $freepbx->Config;
    $this->configmod = new Endpointman\Config();
    $this->system = new epm_system();
    $this->eda = new epm_data_abstraction($this->config, $this->configmod);


    $this->configmod->set('disable_epm', FALSE);
    $this->eda->global_cfg = $this->configmod->getall();

    //Generate empty array
    $this->error = array();
    $this->message = array();


    $this->configmod->set('tz', $this->config->get('PHPTIMEZONE'));
    date_default_timezone_set($this->configmod->get('tz'));

    $this->UPDATE_PATH = $this->configmod->get('update_server');
    $this->MODULES_PATH = $this->config->get('AMPWEBROOT') . '/admin/modules/';

Arguments
"Creation of dynamic property FreePBX\modules\Endpointman::$freepbx is deprecated"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants