Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to install "drupal-core" projects to the project root #38

Closed
wants to merge 2 commits into from
Closed

Add ability to install "drupal-core" projects to the project root #38

wants to merge 2 commits into from

Conversation

RobLoach
Copy link
Contributor

@RobLoach RobLoach commented Oct 6, 2012

Drupal core is to be installed to the project root. A "drupal-core" project would be:
http://drupal.org/project/drupal

I have a fork of it using the "drupal-core" type at https://packagist.org/packages/robloach/drupal .

@ghost ghost assigned shama Oct 6, 2012
@Seldaek
Copy link
Member

Seldaek commented Oct 8, 2012

That is kinda weird, you can't really install a vendor as project root, because updating it would remove the whole directory and your entire project with it. People should rather use create-project to bootstrap project, and drupal stuff should be in vendor/ too if possible though I understand that won't be possible right now.

@RobLoach
Copy link
Contributor Author

RobLoach commented Oct 8, 2012

Hmm, Drupal has to live in the web-root, unfortunately, which currently is the project root.

|-- index.php
|-- core
|   |-- includes
|   |-- lib
|   |-- misc
|   |-- modules
|   |-- profiles
|   |-- scripts
|   |-- themes
|   `-- vendor
|-- modules
|-- profiles
|-- sites
|   `-- default
`-- themes

Right now, composer.json is in /core, but I'm working on moving it to Drupal's project root. Know of a way to make Drupal core install to the project root? Should Drupal just not have a "type" set?

@Seldaek
Copy link
Member

Seldaek commented Oct 8, 2012

Well drupal itself can't really be handled as a dependency until you fix that "has to be web-root" situation. Are you sure it couldn't live in a subdir? Surely all you need is an index.php in the root?

@shama
Copy link
Contributor

shama commented Oct 8, 2012

FWIW, I have a proof of concept handling a install to root situation using with create-project and a post-install-cmd. Take a look at https://github.com/shama/eatcake for an example. It's kind of silly over just using git clone imo but at least something until cakephp 3 adopts composer.

@RobLoach
Copy link
Contributor Author

Perhaps just "core" then?

@shama
Copy link
Contributor

shama commented Nov 10, 2012

I think this is okay to merge. Just let me get #43 done so we can test if it causes any craziness. FWIW, the ZF2 types install to a single folder. It seems problematic to me but let's at least have test cases to show whether or not we should do this.

@sbuzonas
Copy link

sbuzonas commented Jan 8, 2013

What about doing this at a higher level? This doesn't seem to be Drupal exclusive. Perhaps a webroot installer type with a webroot extra to set the path and throw an error for configuration if more than one package is set for webroot?

@davidbarratt
Copy link
Contributor

Shouldn't the Drupal core project add a composer.json file to the root?

That way you can do a command like this:

php composer.phar create-project drupal/drupal-standard path/ 8.0

This is the same way Symfony handles creation of projects:
http://symfony.com/download

I don't think it makes sense to have a completely new type for a single project (drupal core), since the installers should represent a group of projects.

thanks!

@davidbarratt
Copy link
Contributor

Here is more information on create-package:
http://getcomposer.org/doc/03-cli.md#create-project

which I think should suit everyone's needs (if a composer.json file is added to the root of Drupal)

thanks!

@RobLoach
Copy link
Contributor Author

RobLoach commented Mar 5, 2013

@davidbarratt Definitely, there's a patch I have at http://drupal.org/node/1805316 to move composer.json to Drupal's root directory.

@RobLoach
Copy link
Contributor Author

@davidbarratt The composer.json file for Drupal 8 now lives in the Drupal root, so we should update this PR accordingly. What are your thoughts on installing Drupal core into drupal?

There's also another pull request I put together which will automatically figure out the proper location for modules/themes/profiles:
#65

Thanks!

@davidbarratt
Copy link
Contributor

@RobLoach what do you mean "installing Drupal core into drupal?"

Thanks!

@davidbarratt
Copy link
Contributor

I'm not sure this pull requests makes sense. Since the composer.json file is in Drupal's root, if you were to include Drupal in a composer file it would be something like this

drupal
├── composer.json
├── core
│   ├── composer.json
│   ├── core
│   │   └── vendor
│   └── index.php
└── vendor

I'm not sure how this is really helpful since you end up with a core within a core and you still have to point your webroot to index.php, and index.php is going to get the autoloader from core/vendor not from ../vendor. So I'm not really sure how this fixes the problem. I feel like drupal/drupal-core really needs to be its own project, and drupal/drupal has it's vendor directory set as "core" that was drupal core will end up in "core/drupal" and symfony will be in "core/symfony" etc. That's the only way I can see fixing the problem, but that will require some changes to Drupal. At that point though, you might as well leave it "vendor" instead of "core". However, this still doesn't address the issue of being able to edit the composer.json file, I guess then it would be acceptable to modify (like .gitignore or .htaccess), since the only required package will be "drupal/drupal-core".

I'd support a Drupal patch like that, that would also remove the requirement to have a "drupal-core" installer and will make Drupal Core a standard library (which makes way more sense to me anyways.

This would be a similar architecture to Symfony & Symfony Standard which honestly makes way more sense to me than what Drupal is trying to do and what you're trying to compensate for in this pull request.

@davidbarratt
Copy link
Contributor

@RobLoach I couldn't find a Drupal Issue anywhere for this, so I created one: https://drupal.org/node/1975220

Thanks!

@shama shama mentioned this pull request May 24, 2013
@greg-1-anderson
Copy link

I don't think we would need to do this if we used a different solution in Drupal core. I posted some ideas here: https://www.drupal.org/node/1975220#comment-9389981

@davidbarratt
Copy link
Contributor

I've responded to @greg-1-anderson's comment at length here:
https://www.drupal.org/node/1975220#comment-9390477

Let's not junk this issue up with how to solve Drupal's composer problems. I've even described why this pull request (in Drupal's current state) doesn't work in #38 (comment)

btw @RobLoach and @shama I think this pull request is good to go when https://www.drupal.org/node/1975220 makes it into Drupal (or you can do it before then if we think it will make it).

At that point, this pull request will be blocking https://www.drupal.org/node/2372815

@davidbarratt
Copy link
Contributor

The related Drupal Issue https://www.drupal.org/node/1975220 has been committed!

This pull request should be merged! :)

@RobLoach
Copy link
Contributor Author

RobLoach commented Jan 8, 2015

Moved it over to #208 . Was an old repo.

@RobLoach RobLoach closed this Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants