I was asked to help getting a website that was running with 5.2 php code, to work on a 5.3 php server. The site is big, and I can't see the errors that would appear normally when a site isn't working.
I've tried to use the Search and replace function that Dream Weaver has, and simply use it all over the website. But the problem is that I only want to replace functions in PHP documents, and not in js files. When i use Search and replace, in Dreamweaver, it overwrites the js files aswell, and that would cause more errors. Because there's A LOT of files that i have to go through, it would take me a lot of time if i had to go through it manually.
I figured this must be a problem that a lot of firms experiance, so there must be ways to handle this without it being a bigger hassle.
Anybody out there who could help me out ? Any help is much appreciated!
Regards,
Mathias
Check out the official guide about Migrating from PHP 5.2.x to PHP 5.3.x
most existing PHP 5 code should work without changes, but make sure error-reporting is enabled to get some idea of what is going wrong .
I would recommend the use of sed from command line. It is most likely the fastest and most powerful find/replace utility available for LAMP developers.
http://www.grymoire.com/Unix/Sed.html
Dont worry about it! If your code works in php->5 for the most part it will work just fine. 5.3 offers a plethora of options but no doubt your not using them.
Related
I saw many different questions here, but nothing was helpful to me.
I have no trouble with an interpreter, I tried to reset PhpStorm's cache.
It looks like file functions.php isn't accessible.
I really don't want to make a total reset. Maybe somebody has an idea how to solve it?
I'm not sure what I actually did and how to reproduce this issue again, but now it works well. I took previous version of PHPstorm. When I installed new one, the previous one was simply renamed to sth like 'phpstorm2'.
Here are my thoughts what actually happened:
As I understand for highlighting is responsible that part of application which is managed under Languages & Frameworks / PHP / PHP Runtime.
To reproduce this issue you may try to disable there "Core / Core" and try to write down in any place of your phpfile following:
\Exception::class();
And in your case this class will not be highlighted, as it presents in Core_c.php. In my case it is placed in
/opt/phpstorm/plugins/php/lib/php.jar!/stubs/Core/Core_c.php
I'm 100% sure that these libs were always enabled, but why I didn't saw this - that is the question.
So if I face this issue again my steps would be:
Try to verify Languages & Frameworks / PHP / PHP Runtime. The better way would be to enable ALL libs.
Check External Libraries in the project tree. Check read privileges for /opt/phpstorm/plugins/php/lib/php.jar and probably reinstall this plugin.
Try to find out function which I don't actually see in External Libraries.
I recently had a website developed by an external source. They gave me the source code as well as sql files.
When I extract the source code I see folders like Smarty, fckeditor and many php files. I want to start editing these as I find it to be the best way to learn. What tool should I use. I tried using trial version of PHPdesigner, but it just doesnt open my php files.
Is there any tool that can take all these files in the form of a project and simultaneously show me a visual display of any changes that I make.
I suppose it is very clear that I am new to this. Any help will be greatly appreciated.
Just use simple text editor with some code highlight like Notepad++
It is free to use, very fast and it does what you need.
First of all try to know what are the different file types and which lanuguage are those targeted to. Once you know that you can then decide on the editor.
What i recommend is you try to find out if they used a framework for the website, something like CakePHP or CodeIgniter. The next step after you find out is to go the framework website and start reading the documentation.
If the site id developed in php most likely any type of WYSIWYG editing is going to inaccurate. This is because a number of different files need to be processed and combined by the php interpreter before they come together to make any given page or view. Thus the only way to really preview is to run it on a server. Since you say there are sql files he has laso used a DB to store something so most likely any changes you would need to make are going to be spread between both the php source files and the records in the db.
Aptana (Which is Eclipse based) is great at handling many different file type in one IDE. I would use Studio 2 w/ the plugins you need or if you feel cutting edge try Studio 3. It's cross platform so Linux/Windows or OSX.
I have one big php application running on php 4 but I want to move this application on php 5.2 but I am not sure whether it's all functionally work on it or not as I don't want to test full application again. So I want to know is there a way to find out compatibility of application with php versions.
PHP5 come with major changes, I don't think there's such an automated way to check compatibility out there..
You'll have to check all files manualy. use batch file text seach (and replace?) tools to look for functions, classes etc.
here's your guide to start
Unfortunately, you're going to have to test it. You can at least use the PHP changelog as a bit of a checklist to see if any code in application is affected.
PHP 4 to PHP 5 was a pretty huge leap; it's probably a safe bet your app was affected even before you go through testing.
You can use online tool for checking syntax compatibility of your code php 4 and php 5.2,5.3. For manual checking read Migrating from PHP 4 to PHP 5.0.x .
We are about to start using PHPDoctor to auto-generate documentation for our PHP codebase at work. (It was the only one we've tried that could handle our very large codebase, and unlike PHPDocumentor, it's still being updated and supports PHP 5.3).
We'd like to try using different doclets and/or stylesheets than the default that come with it. I did some Googling but didn't see where anybody has posted any. Before we make our own, does anybody know a place where they can be found online?
If you do create your own, we'd love to see it and add it into the project if it's something other people would benefit from.
I'm looking for clean way to break my current habit of using print commands in PHP when I want to see what's happening.
I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.
Does anything like this exist? Furthermore, what do you use and why?
EDIT: There was a lot of stuff out there but I needed something even simpler so I ended up coding it myself. It didn't take long (nor is it very pretty) but I've put it up on my server for anyone else interested.
There is very good extension for Google Chrome - PHP Console.
You can use Xdebug in combination with any one of the many options available to view its debugging info.
There's FirePHP which will write your PHP log messages to the Firebug console.
I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.
Not entirely sure if I understand you there, but couldn't you log to a file and then have a console window running with tail -f /path/to/log-file.txt? That works pretty well for me. Of course, you do need a console connection to the server for this.
Using Coda? That means you are using a mac. You probably want to look at XDebug and http://www.bluestatic.org/software/macgdbp/
There is another extension for Chrome available called ChromePHP. It's a little simpler than some of the other solutions:
https://chrome.google.com/webstore/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
Getting started guide available at:
http://www.chromephp.com
During my development career i have not stumbled upon a software that displays the output you describe in your question. It would be a wonderful program or feature i believe but sadly i have not found any.
Like Andrew and nickf have answered, there are some good tools out there and until someone sits down and writes this, it looks like we are out in the cold.
I was looking for similar solution which wasn't heavy and even better I didn't need to include any classes, so I created simple function that outputs php to browser console, you can check it here:
Outputting PHP To Browser Console