tusharjoshi / netbeans-php-drupal

Netbeans Drupal Development Tool
Apache License 2.0
107 stars 14 forks source link

Drush in multisites #23

Closed sbilde closed 12 years ago

sbilde commented 12 years ago

Hi there.

In the individuel netbeansproject, it is possible to set the path to the drupal-installation (the root), if you for example are running multisites.

But trying to run drush, its telling me that its looking for settings.php in the sites/default -folder. Theres is no one, because its in the sites/

Is there a way to workaround this?

/Steffen

HollyIT commented 12 years ago

All you need to do is put the URI for the site in the host field on the Drush window. This passes the argument to the CLI the same way that drush does.

sbilde commented 12 years ago

Hi Jamie.

Thanks for the reply. - I tried your tip, but apparently drush is is trying to run from a wrong folder!? Here is the error, after trying to get a 'status' (st) :

EXECUTE: /usr/local/Cellar/drush/5.4/libexec/drush -r /Users/bilde/Sites/drupal/drupal7 --include=/Users/bilde/Library/Application Support/NetBeans/7.2/NBDrush --uri=core.loc -y st The drush command 'Support/NetBeans/7.2/NBDrush st' could not be      [ERROR] found. Run drush cache-clear drush to clear the commandfile cache if you have installed new extensions. Execution complete in 0.975325 seconds

Isen't it linking the drush command path wrong? (Support/NetBeans/7.2/NBDrush) ?

HollyIT commented 12 years ago

It looks like the problem is with spaces in the paths. Can you try this version and see if it works?

https://github.com/downloads/HollyIT/NBDrupalDevel/nddt.nbm

sbilde commented 12 years ago

Hi Jamie.

I have tried again after upgrading to version 2.0.11 of nddt, without any change. It still trying to run drush like from a wrong place!?

EXECUTE: /usr/local/Cellar/drush/5.4/libexec/drush -r '/Users/bilde/Sites/drupal/drupal7' --include='/Users/bilde/Library/Application Support/NetBeans/7.2/NBDrush' --uri=core.loc -y st The drush command 'Support/NetBeans/7.2/NBDrush' st' could not be      [ERROR] found. Run drush cache-clear drush to clear the commandfile cache if you have installed new extensions. The directory '/Users/bilde/Sites/drupal/drupal7' does not contain a      [ERROR] valid Drupal installation Execution complete in 0.416519 seconds

HollyIT commented 12 years ago

Got another one for you to try. You'll have to update your Drush path in the settings to where the Drush executable actually exists (do a whereis drush from the command line):

https://github.com/downloads/HollyIT/NBDrupalDevel/2011test.nbm

The problem is with spaces in the parameters and how Java's CommandProcessor handles them. If this doesn't work then I might have to look into switching over to a different method to invoke command line stuff, which won't be easy.

sbilde commented 12 years ago

Hi again Jamie.

We are getting a little closer now. - You seem to have fixed the space-in-path-issue in your latest version you sent me.

However drush in nddt doesent seem to find the database!?

Here is the output from iside NetBeans's drush-terminal:

EXECUTE: /usr/local/Cellar/drush/5.4/libexec/drush -r '/Users/bilde/Sites/drupal/drupal7' --include='/Users/bilde/Library/Application Support/NetBeans/7.2/NBDrush' --uri=core.loc -y status
PHP configuration : /Applications/MAMP/conf/php5.3/php.ini Drush version : 5.4 Drush configuration : /Users/bilde/.drush/drushrc.php Drush alias files : /Users/bilde/.drush/aliases.drushrc.php /Users/bilde/.drush/core.aliases.drushrc.php

Execution complete in 0.363057 seconds

And here is the 'coorect' output from my mac's terminal when running: /usr/local/Cellar/drush/5.4/libexec/drush -r '/Users/bilde/Sites/drupal/drupal7' --include='/Users/bilde/Library/Application Support/NetBeans/7.2/NBDrush' --uri=core.loc -y status

Drupal version : 7.15
Site URI : core.loc
Database driver : mysql
Database hostname : 127.0.0.1
Database username : root
Database name : D7_core
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : bartik
Administration theme : seven
PHP configuration : /Applications/MAMP/conf/php5.3/php.ini
Drush version : 5.4
Drush configuration : /Users/bilde/.drush/drushrc.php
Drush alias files : /Users/bilde/.drush/aliases.drushrc.php
/Users/bilde/.drush/core.aliases.drushrc.php
Drupal root : /Users/bilde/Sites/drupal/drupal7
Site path : sites/core.loc
File directory path : sites/core.loc/files
temp : /Applications/MAMP/tmp/php

I can't really figure out, why NDDT's drush aint finding the project-info..- The same issue consist with non-multisites in Netbeans 7.2 on mac.

HollyIT commented 12 years ago

Ok, did a bunch of changes to escape spaces and that. See how this one works out:

https://github.com/downloads/HollyIT/NBDrupalDevel/org-netbeans-modules-php-drupaldevel.nbm

sbilde commented 12 years ago

Thanks Jamie. That last one did the trick!

Here is how the drush command ended up looking:

EXECUTE: /usr/local/Cellar/drush/5.4/libexec/drush -r /Users/bilde/Sites/drupal/drupal7 --include=/Users/bilde/Library/Application\sSupport/NetBeans/7.2/NBDrush --uri=core.loc -y status

Drupal version : 7.15 Site URI : core.loc Database driver : mysql Database hostname : 127.0.0.1 Database username : root Database name : D7_core Database : Connected Drupal bootstrap : Successful Drupal user : Anonymous Default theme : bartik Administration theme : seven PHP configuration : /Applications/MAMP/conf/php5.3/php.ini Drush version : 5.4 Drush configuration : /Users/bilde/.drush/drushrc.php Drush alias files : /Users/bilde/.drush/aliases.drushrc.php /Users/bilde/.drush/core.aliases.drushrc.php

Drupal root : /Users/bilde/Sites/drupal/drupal7 Site path : sites/core.loc File directory path : sites/core.loc/files temp : /Applications/MAMP/tmp/php

Execution complete in 0.946751 seconds

I don't know if it was excluding the ''-signs in the execute-path or the '\s' in the path, but it works like it should now!

Once again thanks for this great tool, and for the kind support.

sbilde commented 12 years ago

Closing

HollyIT commented 12 years ago

Awesome! I just pushed out the full 2.0.11 release.