- Notifications
You must be signed in to change notification settings - Fork 929
Issue #176: Implement paranoia mode #180
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
Conversation
| What about fonts from custom themes? Perhaps we should make the file types that should get copied configurable. |
| Yes, thats the idea. We can add it to the composer.json. I think we should have the ability to link whole folders as well. E.g. Symlink the css and js folder of a certain theme instead of individual files. |
| "web/modules/contrib/{$name}": ["type:drupal-module"], | ||
| "web/profiles/contrib/{$name}": ["type:drupal-profile"], | ||
| "web/themes/contrib/{$name}": ["type:drupal-theme"], | ||
| "app/core": ["type:drupal-core"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need the "app" directory? Shouldn't core be at the root? This just one annoying directory level deeper with no benefit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, but this project had a folder which contained modules, profiles, theme and some dotfiles before. And it was not on the repo root before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate breaking out all the application stuff into a separate folder. I can then put things like patternlab directly into the app folder and sync over what I need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that "app" does not make so much sense, as "vendor" would have to be part of the app also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/app" is the common folder in symfony and laravel for code you own. While "/vendor" is the default place for 3rd party (composer) dependencies. This structure is common pattern these days:
/app
/vendor
/var (or /storage)
/web (or /public)
| | ||
| // Symlink public files | ||
| $fs = new Filesystem(); | ||
| $fs->symlink(realpath($extra['drupal-app-dir']) . '/sites/default/files', $extra['drupal-web-dir'] . '/sites/default/files'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO is a good thing create the files symlink using relative paths, absolute symbolic links don't work when the filesystem is mounted elsewhere.
$fs->symlink('../../../' . $extra['drupal-web-dir'] . '/sites/default/files', $extra['drupal-app-dir'] . '/sites/default/files');
| @webflo could you please update this PR to solve those files conflicts |
| @jkribeiro Did a rebase against 8.x |
| Whenever possible I use the approach from drupal.org for new installations and I think a working "paranoia mode" is very useful. What is going to happen next with this issue? Can I do something to move forward? |
| throw new \RuntimeException('Please configure drupal-web-dir in your composer.json'); | ||
| } | ||
| foreach (static::$frontControllers as $fileName) { | ||
| static::createStubPhpFile($extra['drupal-app-dir'], $extra['drupal-web-dir'], $fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that makePathRelative() expects absolute paths to do the comparison. In this case it should be:
static::createStubPhpFile(realpath($extra['drupal-app-dir']), realpath($extra['drupal-web-dir']), $fileName);
| throw new \RuntimeException('Please configure drupal-web-dir in your composer.json'); | ||
| } | ||
| foreach (static::$frontControllers as $fileName) { | ||
| static::createStubPhpFile($extra['drupal-app-dir'], $extra['drupal-web-dir'], $fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before call createStubPhpFile(), the web and app folders must exist, otherwise the process will return an error
[Symfony\Component\Filesystem\Exception\IOException] Unable to write to the "/" directory. This was not happening before because createSymlinks() was being called before createStubPhpFile() and creating the folders.
b111239#diff-a97cd408fd45330f7510ba6d71ab4907R25
Suggestion:
// Ensure that the app and web directories exist. $cfs = new \Composer\Util\Filesystem(); $cfs->ensureDirectoryExists($web_dir); $cfs->ensureDirectoryExists($app_dir); // Call createStubPhpFile(). // Call createSymlinks(). | From: #335 Initially, I know that is not a good thing to have parallel PR for the same change, I'm gonna explain: Main changes made from the original PR
I'm running the paranoia mode on Acquia Cloud servers, to be able to customize this for Acquia structure, I've created https://github.com/jkribeiro/drupal-project-acquia-paranoia-mode for additional installation/instruction. |
No description provided.