Bedrock: WordPress stack

This topic is dedicated to discussion/support/help about our new WordPress stack Bedrock

We’re especially interested in people who try it out and have any issues either getting started, or with use cases we haven’t come across yet.

3 Likes

I haven’t used it quite yet, but looking forward to it soon. Can’t wait to try out “cap deploy” :slight_smile:

Well, I for one can’t figure out how to get my wordpress localized within the Bedrock stack. I’ve set the package path in composer.json to a swedish localized version like this:

{
  "type": "package",
  "package": {
    "name": "wordpress",
    "version": "3.8",
    "type": "webroot",
    "dist": {
      "type": "zip",
      "url": "http://sv.wordpress.org/wordpress-3.8-sv_SE.zip"
    },
    "require" : {
      "fancyguy/webroot-installer": "1.1.0"
    }
  }
}

But as that didn’t seem to do much - seems like composer rather pulls the default from wordpress-packagist anyways - I went on to try and localize manually by copying in a localized language directory under wp-content and adding:

define('WPLANG', 'sv_SE');

to config/application.php but neither that would work so now I’m buffled and have no clue what more to try or do.

Hope I’m not being an ass here for asking this question. I’ve never worked with something like this - am more of an old school HTML-hacker (think pre-2005 or even further back) - but I really want to learn :blush:

Just replacing the standard ZIP url shouldn’t pose a problem. Can you post your entire composer.json file? Also if you had previously ran composer install you’ll need a composer update instead. You can always just delete the composer.lock and optionally the vendor dir to start from scratch too. There’s no harm in doing since that folder is managed by Composer.

OK, I deleted composer.lock as well as vendor dir and then it worked, but here’s my composer.json anyway:

{
  "name": "roots/bedrock",
  "type": "project",
  "license": "MIT",
  "description": "A modern WordPress stack",
  "homepage": "http://roots.io/wordpress-stack/",
  "authors": [
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    }
  ],
  "keywords": [
    "wordpress", "stack", "capistrano", "composer", "vagrant", "wp"
  ],
  "support": {
    "issues": "https://github.com/roots/bedrock/issues",
    "forum": "http://discourse.roots.io/category/bedrock"
  },
  "config": {
    "preferred-install": "dist",
    "generate-salts": true
  },
  "autoload": {
    "psr-0": {"Bedrock\\Installer": "scripts"}
  },
  "scripts": {
    "post-root-package-install": ["Bedrock\\Installer::addSalts"]
  },
  "repositories": [
    {
      "type": "composer",
      "url": "http://wpackagist.org"
    },
    {
      "type": "package",
      "package": {
        "name": "wordpress",
        "version": "3.8",
        "type": "webroot",
        "dist": {
          "type": "zip",
          "url": "http://sv.wordpress.org/wordpress-3.8-sv_SE.zip"
        },
        "require" : {
          "fancyguy/webroot-installer": "1.1.0"
        }
      }
    }
  ],
  "require": {
    "php": ">=5.3.0",
    "wordpress": "3.8",
    "fancyguy/webroot-installer": "1.1.0",
    "composer/installers": "v1.0.6",
    "wp-cli/wp-cli": "v0.13.0",
    "vlucas/phpdotenv": "1.0.2"
  },
  "extra": {
    "installer-paths": {
      "app/plugins/{$name}/": ["type:wordpress-plugin"],
      "app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
      "app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "webroot-dir": "wp",
    "webroot-package": "wordpress"

However, now it seems it doesn’t use my setting for WPLANG in my application.php which has this inserted just below the db settings:

define('WPLANG', 'sv_SE');

is there somewhere else I should put this?

1 Like

I think the issue might be the location of the language files. Using that SE zip with Composer, they’ll be in wp/wp-content/languages. They might need to be in app/languages because of the subdir setup.

If that’s the case, you could just keep the default WP zip and just have the language files in your repo.

edit: Came across this issue from WP Skeleton (similar because of the subdir setup) https://github.com/markjaquith/WordPress-Skeleton/issues/33 which seems to confirm my suspicions.

1 Like

And you confirmed my suspiscion that I needed to place the language files elsewhere I just didn’t know where. Thanx for sorting it out for me :smiley:

BTW you’re right that I realt don’t need another wp release than the default but maybe one could add a string that automates download and placing the language files. Maybe something to add as an option to the stack setup?

1 Like

I’ll add some documentation about it at a minimum. May be added to the setup script but I want to avoid adding every option in there.

Hi Scott,

Just trying out bedrock for the first time.

in the docs it says “The post-install script will automatically copy .env.example to .env and you’ll be prompted about generating salt keys and appending them to your .env file.”

I ran:

$ composer create-project roots/bedrock .

… in my project directory and it doesn’t do that for me. I tried a couple of times. No biggie, just wondered if I’m doing something wrong.

Rob

Good find! The issue is I haven’t tagged a new release (which I should do). The correct cmd is:

composer create-project roots/bedrock . dev-master

Love Bedrock and the idea behind it. I’ve been trying to figure out if WPEngine allows me to use something like this and how would I deploy in that case. I tried asking their support if I can manage the wordpress files in a subdirectory (/wp) and just have the site installed at the doc root, but they said no due to how the version and track things.

Has any one had success using this with WPEngine or know where I can find out more about their architecture? I think I am going to which over from capistrano to Jake or Grunt in combination with Dploy, since WPEngine doesn’t support SSH.

Sweet, that did it, cheers Scott :wink:

Unfortunately I don’t think WPEngine makes it possible. They have Git deploy now but that just means you’d have to have everything in Git (including WP/vendor dir) which defeats a lot of the purpose of using Composer.

Yes, and unfortunately their Git deployment is, in my opinion, half-baked. I was hoping heroku-esque deployment with it, especially since they are so niche. It has such limited options though, I have decided shy away from it for the most part.

Hopefully they will provide more in depth functionality with git deployment and take up the idea of build-packs that heroku and Dokku use. They gotta do something with all that new VC money :wink:

Hi, this is my second time using bedrock + roots, and had lots of fun with it for the first project. It’s still at staging now, but will definately share it here once I’m done with it.

The first time worked well because the wordpress site was on the domain’s root folder. For the second project, however, I have to setup bedrock in a sub-folder. All image links, stylesheets/scripts in the /app folder appear to be mydomain.com/app/ instead of mydomain.com/sub-folder/app/. So basically links to files in /app folder are all broken both on front-end and the admin panel. Thoughts on this?

Ah, I figured just update this line in config/application.php

define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . CONTENT_DIR);

to

define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/subfolder' . CONTENT_DIR);

But still love to hear if anyone has a sleeker way of doing it

The original is

define('WP_CONTENT_URL', WP_HOME . CONTENT_DIR);

Did you set WP_HOME to include the sub directory?

It’s $_SERVER['HTTP_HOST'] on my original file. Guess coz I used composer create-project . Gonna pull the files from github and check again. Thanks for the help man :smile:

Sorry about that. I really need to tag a new release so create-project has the latest code. It was switched to use WP_HOME to make it less redundant.

Rad! Using the latest from github without any issue now.