Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Update Server Behaviors for PHP 6

New Here ,
Sep 01, 2009 Sep 01, 2009

Copy link to clipboard

Copied

does anyone know how to update the server bahaviors in DB8 to support PHP 5.3 -> PHP 6 coding?  We have noticed that a few functions like get_magic_quotes_gpc have been depreciated and will be completely removed in PHP 6.  We would update to CS4, but I heard that version has same issues.  Does anyone know what updates are needed and how to make them?

TOPICS
Server side applications

Views

1.6K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 02, 2009 Sep 02, 2009

bgarrant wrote:

Does Coldfusion also have these issue or does the code from all old versions work?  We may try to develop in that instead of PHP in the future if so.  It takes to long to update code on hundreds of old sites developed in DW8 with PHP 4 or 5.

I don't know, because my experience of ColdFusion is rather limited. All I can say is that the code in Dreamweaver 8.0.2 and CS3 is perfectly valid. Dreamweaver CS4 introduced some simple changes to ensure future compatibility with PHP 6.

As far

...

Votes

Translate
Advisor ,
Sep 01, 2009 Sep 01, 2009

Copy link to clipboard

Copied

Use an if/else statement in script so if PHP version is less than 6 show old code else show php 6 supported code.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2009 Sep 01, 2009

Copy link to clipboard

Copied

I am not an expert with Dreamweaver or with PHP.  Do you know how to modify the server behavior sode to add the IF/THEN clause?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 01, 2009 Sep 01, 2009

Copy link to clipboard

Copied

Sure just add this wherever you want to add a condition if php version is less than v.6

if (PHP_VERSION < 6) {
// something here
get_magic_quotes_gpc()
//other php code etc
}

Put whatever code between the if statement which will run the function if php version is before v.6 That way you can run the code in the php server before v.6 and when your server launches to php v.6 your site will be ready.

You could also append an else statement to the condition. More info is available here which was found as the first result when googling the term php if else

It's unlikely to expect support in Dreamweaver for an unreleased version of php. Unfortunately you may have to become an expert at php if you want support for unreleased versions. Just a thought. Best of luck!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

bgarrant wrote:

does anyone know how to update the server bahaviors in DB8 to support PHP 5.3 -> PHP 6 coding?  We have noticed that a few functions like get_magic_quotes_gpc have been depreciated and will be completely removed in PHP 6.

You are incorrect in thinking that get_magic_quotes_gpc() will be removed from PHP 6. What is being removed is magic_quotes_gpc. To preserve backwards compatibility, get_magic_quotes_gpc() will return false or null in PHP 6.

In any case, Dreamweaver CS4 builds in a check for the PHP version, and doesn't run get_magic_quotes_gpc() if it detects PHP 6.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

What other features does it check for PHP 6?  I have a few people in office using DW8, and I am wondering if there is a way we can manually add the same check to the existing DW server behaviors?  Does Adobe typically update a patch for this even for older versions when a new PHP version comes out?  We noticed a few behaviors had issues when we migrated to PHP 5.3 last week developed from the DW8 machines.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

Adobe does not update older versions of Dreamweaver to keep pace with any change to third-party technology. So, you're whistling in the wind if you expect Dreamweaver 8, which was released in 2006, to be patched for PHP 5.3, which has only just been released.

As far as I'm aware, the only PHP code in CS4 that triggers warning notices is the XSL Transformation server behavior. If you run it in a PHP testing environment with E_DEPRECATED turned on, it produces a rash of deprecated warning messages. The temporary way to fix this in PHP 5.3 is to add this at the top of the page:

if (PHP_VERSION >= 5.3) {
  error_reporting(E_ALL ^E_DEPRECATED);
}

I have reported the problem to Adobe, and have been informed that the next release of Dreamweaver will have an updated version of MM_XSLTransform.class.php, which will be compatible with what is currently known of plans for PHP 6.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

So we will need to wait for DW CS5 for the fix or you mean a patch?  Is CS4 patched for php 5.3 depreciated and removed functions already?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

bgarrant wrote:

So we will need to wait for DW CS5 for the fix or you mean a patch?  Is CS4 patched for php 5.3 depreciated and removed functions already?

To the best of my knowledge, all the PHP code generated by Dreamweaver CS4 works in PHP 5.3. My own server has been running PHP 5.3 since mid-July, and I have not yet encountered any problems.

The only problem that I am aware of with the code in Dreamweaver CS4 is with MM_XSLTransform.class.php, which in its current form will break in PHP 6. It works fine in PHP 5.3. The only problem with it is that it triggers deprecated warnings in PHP 5.3 if ERRORS_ALL is turned on. If you are running PHP in a production environment with display_errors turned on, you should review your security policy immediately. The Dreamweaver code is not broken;  PHP 5.3 is simply warning you that the code won't work in PHP 6. Since PHP 6 hasn't been released, there's nothing to worry about.

If you have concrete examples of what's "broken" in the Dreamweaver code, please provide details. I have been putting pressure on the Dreamweaver development team for the past few years to ensure forward compatibility of the server behavior code, and the response has been very positive.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

Does Coldfusion also have these issue or does the code from all old versions work?  We may try to develop in that instead of PHP in the future if so.  It takes to long to update code on hundreds of old sites developed in DW8 with PHP 4 or 5.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 02, 2009 Sep 02, 2009

Copy link to clipboard

Copied

LATEST

bgarrant wrote:

Does Coldfusion also have these issue or does the code from all old versions work?  We may try to develop in that instead of PHP in the future if so.  It takes to long to update code on hundreds of old sites developed in DW8 with PHP 4 or 5.

I don't know, because my experience of ColdFusion is rather limited. All I can say is that the code in Dreamweaver 8.0.2 and CS3 is perfectly valid. Dreamweaver CS4 introduced some simple changes to ensure future compatibility with PHP 6.

As far as PHP 6 is concerned, it will involve some major changes to the language. But Ilia Alshanetsky, one of the main contributors to the development of PHP is on record as saying he thinks it will be 3-4 years before PHP 6 becomes production-ready: http://news.php.net/php.internals/44806.

If you're developing hundreds of sites, it sounds rather risky to continue relying on an old version of Dreamweaver to keep your code up to date.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines