Initial best practice guidance for development

I have the following environment:

1. MacPro
2. MAMP PRO
3. localhost server (via mamp pro)
4. external svn for php project files

I have my (joomla CMS) environment installed locally and I have also installed my latest joomla extensions (not through SVN, just manually installed via joomla extension manager).

I need some guidance in order to properly setup.

Specifically some help on the following topics:

1. I assume I need to create a phpstorm project based on the existing localhost storage, so I assume I should use the create project from existing files wizard. Is there anything special I should do here?

2. How do I grab my latest files from the remote svn location? I assume I need to do a checkout. Do I over-write the already installed folder with the checkout folder? And when I make changes to the files how do i commit them? The changes menu item (View->tools window->Changes) appears to be disabled (even after I checkout the folder).

Maybe there is a specific tutorial available?

0
9 comments

Hello,

i have a small presentation with some tips how to setup phpStorm for Joomla. Maybe not exactly what you are looking for, but maybe it helps:

http://de.slideshare.net/thomaskahl/using-an-ide-for-joomla-development

Thomas

0

Thomas,

Thanks for link.

Actually I had already located your presentation and video.

However the problem is still unresolved for me.

I will give a better decription that might help people (and perhaps you) help me.

I have a Joomla website on my MAC (I use MAMP PRO).

The joomla site storage is located at:
/sys/users/nick/.../sites/joomla256

I am developing a joomla extension that when installed on my local joomla site is located at:

/sys/users/nick/.../sites/joomla256/components/.../myjextension

Now the questions go as follows:

I assume I can create a new PHPstorm project based on the Joomla code stored localy so I do this based on the folder joomla256 (see first path above).

I selected that the 'create a project from existing sources' and then selected the second radio option 'Web server is installed locally, source files are located elsewhere locally). Is this the proper way?

Once I do this, I want to grab from a remote svn location the latest code for my joomla project.

So I use the:

VCS -> Checkout from version control -> Subversion

menu and grab the correct folder from svn and place folder in the second path (above).

What I was assuming here is that I can then directly use the IDE editor to make changes to my project code and somehow commit these changes from withing the IDE.

But I am not able to get this going.

The View -> Tool Windows: Changes and Version Control menu items are disabled.

What am I doing wrong or what have I misunderstood?

0

Hello,

when you have all the files on you local machine, you can just use "File -> Open Directory" to use the file structure as a project. phpStorm automatically creates a project.

But i would do it in another way:

- you have your local Joomla site
- create another directory structure outside of the Joomla-root for the component
- add the component directories to your Joomla site a symlinks - this way, you can test it on your local machine
- activate version control for your component project
- work only in the component project

I always have several plain Joomla versions on my system to add them to my projects: "Settings -> Project Settings -> PHP -> '+' " to add files / directories to your project. This way, phpStorm "knows" the Joomla Framework and all the inspections... work.

Additionally, i use phing to pack the component files for installation.

This has several advantages...

- For me it is "cleaner" to work just in a component directory structure
- You can easily test in different Joomla versions with the same codebase (just setup another Joomla Version and add the symlinks)
- If you have more than one component, it is easyer to maintain. I currently have about 75 in my projects directory... and it would make no sense to have all the Joomla files for each project.

One small disadvantage: For debugging you have to open the Joomla directory in phpStorm, too. Otherwise, phpStorm will not recognize the file structure (as far as i know - maybe somebody has a better idea for that). But that's not a real problem. Because throught the symlinks, the component files are loaded directly from their directory structure and quick changes during debugging are saved to the original files.

Thomas

0

Thanks again for feedback - I guess I need to study up on the symlinks (do you have any url info?).

Question still open - how do i configure things in phpstorm so i can commit code to my remote svn from the ide?

0

Symlinks: http://gigaom.com/apple/how-to-create-and-use-symlinks-on-a-mac/
(If you use e.g. Forklift, there is a menu item to easily create them)

Did you read this? http://www.jetbrains.com/phpstorm/webhelp/subversion-reference.html

I never had any problems with remote SVN's. As i was in the Virtuemart Team, i have used it exactly the way i described. We also have used SVN.

BTW: do you have the whole Joomla installation in SVN?

0

Thanks for links.

No I do not have Joomla on my remote svn.

0

If it is just the component structure in the SVN, you can checkout the project from SVN and then set the Symlinks for the local Joomla installation.

Is there a proper component file structure in SVN (the structure needed for Joomla)? Or is it the structure used in your package file?

Thomas

0

If i do this (symlinking to my local checkout folder), then if I edit a fie from the IDE will it automatically edit the local checkout version?

and can i trigger commiting from the ide in this case?

0

If everything is set up correctly :) "yes"

From the "component project" that is checked out from SVN, you should have all the SVN-Options like Commit, show changes, commit history, ...

Thomas

0

Please sign in to leave a comment.