Page 4 of 4

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Thu Mar 22, 2018 11:47 pm
by rockedge
I ran it again and using Bionic 18.04 PHP 7.2.3 ZM 1.30.4 swapped in the cakephp 2.10.8 /lib folder and replaced Crud with version 3.1.0 then changed line 15 and the name of the abstract class and the API works.

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 11:58 am
by knight-of-ni
Not a problem. I'm just trying to understand this as best I can... the best way to fix this is file a bug report with the Crud project, but that's always tough when you don't know enough about how things work to describe the problem well enough and then intelligently answer questions.

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 12:29 pm
by bbunge
knnniggett wrote: Thu Mar 22, 2018 9:17 pm Can you guys check something for me....

I had a moment to install 18.04, and I can get the api working by changing just the abstract class to mention CakeObject, rather than Object.
The api appears to still work if I skip adding App::uses('AppController', 'Controller');

Can you confirm this?
Went back to the original api and made the change to CakeObject. the api did not work with the original cakephp and crud.

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 2:51 pm
by rockedge
if you use the stock API and that version of cakephp, 2.8 I think, there is no change in /usr/share/zoneminder/www/api/lib/Cake/Core. The version 2.10.8 includes the file /usr/share/zoneminder/www/api/lib/Cake/Core/CakeObject.php. This is really Object.php renamed and Object.php is rewritten to only refer to CakeObject.php. When we rename the Class Object to CakeObject in /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudBaseObject.php the code is now pointing to the CakeObject.php.

One can use the stock cakephp I think by renaming /usr/share/zoneminder/www/api/lib/Cake/Core/Object.php. to CakeObject.php then change the lines in Object.php to do the same function as the new version in cakephp 2.10.8 and do the change to /usr/share/zoneminder/www/api/app/Plugin/Crud/Controller/Crud/CrudBaseObject.php...I think it may work but is more involved then overwriting the /lib/Cake folder with v2.10.8 and throw in the newer version 3.1.0 of Crud and modify one line....

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 3:01 pm
by rockedge
the problem appears to be that in /usr/share/zoneminder/www/api/lib/Cake/Core/Object.php in version cakephp 2.10.8
this is the new code

Code: Select all

App::uses('CakeObject', 'Core');
class_alias('CakeObject', 'Object');
and one would think that the Crud reference to "Object" would then be referred to CakeObject.php... but as we can tell....that is not true because we need to make the change to the line of code in Crud.

It would seem the coder's from Crud should make the change and release a version of Crud 3.1.1 as a favor maybe

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 4:44 pm
by iconnor
I think we are going to have to send a PR to the Crud guys. Others could benefit from this work too.

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Mar 23, 2018 9:44 pm
by knight-of-ni

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Fri Sep 07, 2018 1:14 pm
by bfl
knight-of-ni wrote: Fri Mar 23, 2018 9:44 pm PR created:
https://github.com/FriendsOfCake/crud/issues/581
Wow, Thank you! Now api works with php7.2!

Re: (Solved)API not working with PHP 7.2 and Bionic 18.04

Posted: Sat Nov 09, 2019 8:45 pm
by denvid
Hi, I have also the problem that I´ve got an error message from CakePHP 2.10.8.:

Your tmp directory is NOT writable.

I´m running Zoneminder 1.32.3 on Ubuntu 18.04. Zoneminder is working well in the browser window, but I don´t have any acces from zmNinja. All symbolic links from /user/share/zoneminder... and deeper are pointing to /tmp and set to www-data:www-data 777.

Any idea what´s going wrong?