gtkforphp / cairo

PHP extension for Cairo Graphics Library
Other
27 stars 19 forks source link

PHP7 (PHPNG) compatibility #18

Closed swen100 closed 8 years ago

swen100 commented 9 years ago

It would be great if this extension is compatible for the next generation of PHP. I know that it would take a few modifications. But if we all want to use this great extension in the future, and to not loose too much time before PHP7 gets widely used, compatibility has to be made for sure.

auroraeosrose commented 9 years ago

There are plans - hopefully I get the segfault fix and the new cairo branch for php7 in this week

the PHP7 version of cairo will have some additional changes beyond internal modifications needed to make it work

  1. namespaced under cairo (you can still use old code by adding use statements at the top of files) so instead of CairoContext the class name would be Cairo\Context
  2. removal of the dual api in favor of OO only
  3. raising the minimum supported libcairo version to something less ancient, I think we currently support all the way back to 1.2
auroraeosrose commented 9 years ago

You can watch activity on the php7 branch - when PHP7 is released, I'll branch current cairo into a php5 branch and the php7 branch will become master - but that will be awhile yet

swen100 commented 9 years ago

that sounds very good :-)

auroraeosrose commented 9 years ago

So I'm raising minimum libcairo needed to 1.8 - that's still ancient but less painful

swen100 commented 9 years ago

Hi Elizabeth. Are there many differences between cairo versions 1.8, 1.10 and 1.12? I mean, if somebody wants to install this extension for PHP7, he surely installs it on mostly new environment with new software components, isn't it? As u wrote: 1.8 is ancient :-) If so, and if there are only very small differences between these versions, does something speak against the definition of 1.12 as minimum version (to reduce the pain)?

auroraeosrose commented 9 years ago

The biggest difference between the versions are new features - so it means wrapping any features not supported in library versions in ifdef checks which mean some really messy code

If go up to at least 1.8 then the ifdefs are around larger chunks of functionality (like the mesh patterns) instead of individual functions and far less - messy - and hard to maintain :)

1.12 would mean complete removal of those checks... except for 2 new api calls available in 1.14 which also would be nice

Maybe I will bump it all the way up to 1.12 :)

By the way - the branch now compiles - but only matrixes are ported so far (patterns are just about done) - I've been adding features too, mainly ones I just hadn't yet gotten around to finishing :)

auroraeosrose commented 9 years ago

http://cairographics.org/manual/index.html <- new symbols are at the bottom here for the versions if you're interested :)

swen100 commented 9 years ago

Wow Elizabeth, you were very hard-working. Compliment! I would also say, that version 1.12 should be the minimum version, if this makes the work easier.

auroraeosrose commented 9 years ago

Actually makes things a LOT easier - I'll bump it

Didn't get quite as much done over the weekend as I wanted, but patterns (including mesh stuff) are about done :) and real enums! hurray!

auroraeosrose commented 8 years ago

I'm closing this as we're actually tracking php7 support in #20 this is a duplicate