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.
Related
I recently started web development. The course I took was to install WAMP and start developing right away. I used an atom text editor, this -combined with wamp- proved to be a very fast way to write client-side code(HTML, CSS, Javascript).
But when I started to write serverside PHP things got a little messy. I should probably explain my site's structure here.
I keep separate PHP, CSS, javascript files for every page on the client side, for the server side a have 2 different types of PHP files:
Files that only perform a specific operation on the database(For example returning "5 more answers"). These are always called by AJAX requests.
Files that load the page for the first time. These are only used when the user opens the page for the first time, they do necessary database queries and return the page. Later requests always go to the 1st type of PHP files.
Now regarding my problem. I debugged until now by printing variables to the screen with var_dump() or echoing. But this started to become too slow as the data I work with grew. I wonder if there is a way of debugging which will let me but a breakpoint in one of my PHP files. Then, when I open it on the browser, on the localhost I created using WAMP, will let me go through the PHP file step by step.
I have been dealing with this issue for 3 days, I tried to make it work with Eclipse IDE but couldn't find a way. Also, there seems to be no tutorials or Q&A on the internet regarding the issue.
Breakpoint debugging opens a whole new world, and is the natural step after var_dump() debugging. Not only does it speed up development, but it provides much more information about your code, as you can step through each line and see what values have been set at each step, and how they evolve as your program executes its code. This means you can track the entirety of the values at different stages with one run - imagine tracking all variables at each point using var_dump()!
Although choosing an IDE is a personal decision based on personal taste, i strongly recommend you try out PhpStorm. If you can get a student licence go for it.
PhpStorm has extensive documentation & tutorials on all features in the IDE, debugging is no exception:
https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html
https://www.youtube.com/watch?v=GokeXqI93x8
I don't know of a specific solution to your issue. I'm not exactly sure what you're doing but as a quick tip, I find add the following snippet to the top of the file useful as it will highly error more easily rather than browser just say nope.
error_reporting(E_ALL);
ini_set('display_errors', 'On');
Hope this help you a bit.
I tried out what's recommended in comments and answers. I first tried Netbeans. To be fair it disappointed me. Download kept getting stuck at 100%, even for different versions. When I stopped downloading and went ahead to create a php project, there was missing parts I guess. I couldn't even manage to create a php project. But that might just be me not being able to do it.
Then I followed #leuquim's answer and #Alex Howansky's comment and downloaded PHPStorm. And I got it to work in no more than 20 minutes. I downloaded it with a student's licence. For people who want to use PHPStorm with WAMP here's a Youtube tutorial:
https://www.youtube.com/watch?v=CxX4vnZFbZU
One thing to note in the video is that, maker of the video chooses PHP Web Application in the Run Configurations. That has been changed to PHP Web Page.
i'm pretty new to php development and want to start using an IDE with syntax checking and autocompletion.
I'm used to programming java with eclipse and thought that the PDT provides similiar functionality.
In java if i type in for example: "new Arr" and press ctrl+space autocomplete suggests a list of possibilities with "new ArrayList()" on top.
but if i try the same in a php project, for example with "new mysq" and ctrl+space i get nothing. I would expect to get "new mysqli()" or similar recommended.
Is the described functionality not included in PDT? Or did i configure something wrong?
I did the "right click on project-> configure-> Add php support" but it didn't change anything.
If you would like to have some basic auto complete feature you can use NotePad++ (download) for a quick and easy starter. This is a really great minimal program that can be used very efficiently to code in many different languages. It provides huge ammount of different functions. It is a must have tool for any developer.
I used Notepad++ to write ten thousands of lines of PHP code, it worked really great for me.
Otherwise PDT also supports autocomplete. Make sure that you have a PHP project added and then your are in a PHP file (.php extension). If you have Java autocomplete working in the same project then I think that you are in a Java project, try adding a PHP project, then a new PHP source file. Then PHP autocomplete should be working well in this source file.
Make sure also that you have PHP perspective selected.
I hope you can get by now starting using PHP! Have luck and good times using this great language!
I found the solution in this question: Why does Eclipse code completion not work on some projects?
I had to manually add this:
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
to the buildpath file of my project.
I recently switched to dreamweaver version CS6 from CS4. In CS4 there was a handy feature that would show tabs of the includes files. CSS PHP Javascript etc. It would show these tabs right above the "code, split, design, live". Does CS6 not have this feature or do I simply have to enable it?
If so, where and how?
Oh yeah. I'm using the Design Compact dreamweaver layout.
Hope you guys can help me out. I really need that feature back ^^
Nvm. I finally found what I had to change. In the general settings, enable relative files: on.
It's not only there but it works better than it did before because it can scan deeper for PHP files (I think CS5.5 improved it for use with things like Wordpress). When you open a file with includes they should be there next to the file name. Although it's better, it's still not perfect so if you have dynamically created includes you still might not see them.
A friend of mine asked me to help him edit and add content to his PHP website. It was originally created by a professional company which has now became his opponent.
I thought it would be easy to edit some texts and adding content based on an original template. I downloaded all the files from a server, but couldn't find any files that contained the text I wanted to edit.
How could I use the text search keyword in all those files: PHP & JS without opening them one by one to find it as it seems to having too many files related with one simple website?
What is the best way to check whether or not I am in need of the original files in order to finish this project?
This doesn't sound like a programming question.
Searching the files largely depends on what operating system you're using and what tools you have available. There are many tools such as grep/awk on Unix/Linux systems, and file search tools on Windows and Mac.
The text you want to edit may be stored in a database. Often, PHP sites are part of a LAMP (Linux, Apache, MySQL, PHP) stack with MySQL being the database layer. If this is the case, you would need to get the information from the database, too.
This definitely not a programming question as calvinf said .... and there are tools you can use to search keywords in all the files of your project...
Try Zend Studio and after making a project in it search for your keywords in All Files option...
Another possibility you would not be able to find files is because the text might be saved in the db and extracted at the runtime...
so in my opinion if later is the case you would have to have a look at the templates stored in your db...
But i won't mind to have a go at Zend if i were you, anyways.
I've inherited a PHP application that has "versions" of pages (viewacct.php, viewacct2.php, viewacct_rcw.php, etc). I want to discover which of these pages are called from other pages in the application and which are not. Is there a tool available that will help with that?
Using whatever tools you would like (Find/Grep/Sed on Linux, I use Visual Studio on windows), it is just a matter of crawling your source tree for references of the filenames in each file.
Similar to FlySwat's answer: any good text editor or IDE with multi-file search should be able to help you find the orphan pages. On Mac OS X I would suggest TextWrangler(free), TextMate($), or BBEdit($$). I've had good success with each of these tools, but your mileage may vary.
If you wish to find out what pages are called by other pages, you need to look at where stuff is being called. Obviously in php code, you can only reference other files via includes or requires and the singular versions of those functions.
So if I were you I would grep your code for include and then require and attempt to make some kind of map showing what is calling what. Eventually you should end up with a pretty clear map of how the php files talk to each other. Then you will need to work out how the various points of the application talk to each other from there via HTML/AJAX etc.
Good luck. I have done it before, it takes a while, but you'll get there, just make sure you document what you find out.
You may want to try out nWire for PHP.
nWire for PHP is an innovative Eclipse plugin (works with Eclipse PDT & Zend Studio 7) which accelerates PHP development by helping developers navigate through their code and better understand the architecture of their application. nWire offers unique tools for real time code visualization, navigation and search.
nWire analyzes all the components and associations in your project. While opening a file you can immediately see where (and if) it is being used.