The setHex method of PHP MapScript doesn't work - php

I'm using PHP MapScript 6.4 to interact with my Mapfile.
I try to use the setHex() colorObj method like that:
$oStyle->color->setHex($color);
Where $color is an hexadecimal value as we can see in my logs
But regarding the MapScript https://mapserver.org/mapscript/php/phpmapscript.html#colorObj I can use setHex() method.
It works perfectly fine with $oStyle->color->setRGB(255,255,255); for example, so why not setHex()?
I'm using MapScript 6.4, I have looked at the 6.0.1 release documentation and the setHex() method exists.

thanks for using MapServer ! Here are some important points:
setHex() is not available in MapServer 6.x for PHP MapScript: you can find the documentation for your exact version by:
going to https://mapserver.org
goto "Documentation" https://mapserver.org/documentation.html
at the top click on "Documentation for earlier versions of MapServer can be found on the Download page"
there you can see the various versions you can download for the documentation, such as 6.4 https://mapserver.org/pdf/MapServer-64.pdf
search for "setHex" and you will only find it only inside the SWIG MapScript section
setHex() and toHex() for PHP MapScript were added to the MapServer 7.0.0 release (ticket: https://github.com/MapServer/MapServer/pull/5078)
I've now added the text "new in version 7.0.0" to the colorObj for those methods at https://mapserver.org/mapscript/php/phpmapscript.html#colorobj
Please also note:
there was a major vulnerability found in PHP MapScript recently (6.4.4 and 7.4.4 were released for this reason)
PHP MapScript is unsupported/unmaintained, and therefore SWIG MapScript is recommended moving forward (which has full PHP7 support)
Thanks for using MapServer. Happy (fast) mapserving!
-Jeff McKenna

Related

Problem with configuration of LiveQuery in Parseplatform

Hello i have installed Parse server and parse sdk for php on my Linux Centos Server.
Parse Dashboard: 1.3.3,
Server version: 4.3.0
I'm managing those db's using php code. This parser was installed by someone else. The thing is I'm not sure how to install LiveQuery for my server. I don't know if my version of server is good for this kind of operations. I found some solutions how to enable this feature, but there was something like "index.js" - in my file system it's app.js. Screen of file system
In app.js i added lines:
liveQuery: {
classNames: ["Test"] //List of classes to support for query subscritions
}
I've created class in my db named "Test", then i found solution i need to add
this line
liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
I don't really know how to get this key.
How can i check if LiveQuery works? It will be used by flutter code, but i'd like to check it first in PHP.
My problem has been solved in my other extended topic here.

Quickest way to get Expression Engine v 2.5.5 working with PHP7

A client’s host has recently updated their server to run PHP 7, which has broken their EE 2.5.5. site (“Call to undefined function mysql_connect()”).
I tried upgrading EE to version 2.11.9 but get errors:
Frontend: can’t find safecracker_lib
Control Panel: PATH_MOD not defined in mod_structure.php, fixing this leads down a rabbit hole starting with an error related to not being able to instantiate the pagination class somewhere.
I just need to get the site running until I build a new site, what is the quickest way I can get the site running with PHP 7?
In your config folder there is a file named database.php
change the line:
$db['expressionengine']['dbdriver'] = 'mysql';
to
$db['expressionengine']['dbdriver'] = 'mysqli';
mysql_connect() has been deprecated since PHP 5 and removed in PHP 7 so you cannot use this function or any of the old mysql functions.
You need to upgrade your codebase, or downgrade your PHP version (highly discouraged).
In regards to your missing pagination class, you may not have implemented core classes that were required when upgrading.
Try running on your command line:
php system/ee/eecms upgrade
You can also read the documentation on how to upgrade the codebase for Expression Engine here.

PHP Version 7.3.17 on Amazon EC2 missing sodium?

When making call to sodium_crypto_pwhash_str I get the following in my Apache error log file.
PHP Fatal error: Uncaught Error: Call to undefined function
sodium_crypto_pwhash_str()
My php version, as noted is 7.3.17 running on an Amazon EC2 instance.
My php-info() does not return any relevant libsodium information other than module author info:
Sodium Frank Denis
Given the above author information references a module author am I supposed to enable the sodium module? If the answer is yes is it referenced in the php.ini file? Such as:
extension=sodium
or perhaps:
extension=libsodium
What am I missing here?
Am I not supposed to use the documented function sodium_crypto_pwhash_str?
Am I supposed to use some other method of accessing the desired functionality?
Yes normally it's included in PHP 7.2+ but when you use the AWS EC2 instances this is a bit minimalistic and not everything is included.
https://www.php.net/manual/de/sodium.installation.php
Here you can see that you have to enable it during the compiling with --with-sodium[=DIR]. So you can compile it on your own or you try another distro to get it from your package manager or you use another lib to make it work.
https://forums.aws.amazon.com/thread.jspa?threadID=293187

TYPO3 9.5.11: No class named EXT: ap_docchecklogin (but class exists)

I use the extension "ap_docchecklogin" (https://extensions.typo3.org/extension/ap_docchecklogin/), which works under Typo3 8.7.29. Only under a fresh TYPO3 version 9.5.11 I get the following message:
No class named EXT:ap_docchecklogin/Classes/DocCheckAuthenticationService.php:&Antwerpes\ApDocchecklogin\DocCheckAuthenticationService
This is the code where the error happends:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'][] = 'EXT:ap_docchecklogin/Classes/DocCheckAuthenticationService.php:&Antwerpes\ApDocchecklogin\DocCheckAuthenticationService->bypassLoginForCrawling';
Of course, I cleared the cache and renewed PHP Autoload. I also looked at the extension and the class definitely exists.
Both Typo3 versions run on the same server under the same settings.
Where is the difference between the Typo3 versions? Why it works in version 8? Has anyone ever had similar problems?
According to the changelog here: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5/Deprecation-86279-VariousHooksAndPSR-15Middlewares.html, Hooks which is used in the extension has deprecated in the TYPO3 9 LTS version.
You can see the issue here: https://forge.typo3.org/issues/87357
you can use a custom PSR-15 middleware instead.
I made small changes in the code and it's no longer showing an error. Don't know this works for you or not (Functionality I am talking about)
But try this way...
$GLOBALS['TYPO3_CONF_VARS']
['SC_OPTIONS']
['tslib/class.tslib_fe.php']
['initFEuser'][] = 'Antwerpes\\ApDocchecklogin\\DocCheckAuthenticationService->bypassLoginForCrawling';
Does this help?

PHP class 'Ds\Map' not found

In PHP (version 7.1), I am attempting to use a MAP as opposed to a two dimensional array to handle implicit data type conversion across different data type groups. However, I am receiving the following run-time error:
Class 'Ds\Map' not found
The error occurs on this line of code:
protected $hive_data_type_group_map = new \Ds\Map();
I have checked online, but there is little documentation on Ds\Map, even on PHP's website (click here). Does anyone know how to fix this?
Data Structures is not a built-in PHP extension.
It needs to be installed before use. The installation instructions are available on php.net.
For windows
Download compiled-dll file "php_ds.dll" from https://pecl.php.net/package/ds. Place it in your dir wamp\bin\php\[your_php_version_folder]\ext and include it in your ".ini" file.
It worked for me.
the easiest way on ubuntu:
pecl install ds
Reference: https://www.php.net/manual/en/ds-deque.allocate.php

Categories