News for hackers. Stuff that matters.
Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @01:29PM (#6929458)
I'm one of the creators of this (we're the same people behind http://roots.io) so I'm happy to answer any questions. We're just trying to make developing WordPress sites a little more bearable :)
Re:Bedrock: a modern WordPress stack by mikegirouard on Wednesday December 18, 2013 @02:39PM (#6930042)
This looks like a much more formalized structure than what we do. Do you use it in production currently or is this a prototype?

This is my primary new WP project approach (which isn't perfect):

    mkdir Example-Project
    cd Example-Project

    # Grab the latest wordpress, www is our DocumentRoot
    curl wordpress.org/latest.tar.gz | tar -xvz --
    mv wordpress www
    cd www

    # Drop the default wp-content and symlink so we dont need to
    # keep all of wp in Git
    mv wp-content ..
    ln -s ../wp-content
    echo 'www/' >> .gitignore

    # Make the repo
    git init
    git add . && git commit -m 'First!'
The main problem I run into is with the symlink'd wp-content directory. WP seems to not interpret it well and I have to set up Alias directives in the virtualhost configuration to compensate. Are you doing anything similar with the app/ directory?
Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @02:42PM (#6930068)
It's being used in production for roots.io right now but it's still a work in progress.

Seems like your issue has to do with your symlink setup. We don't need to do any special configuration with the web server. Here's the configuration that deals with app/: https://github.com/roots/bedrock/blob/master/config/applicat...

Re:Bedrock: a modern WordPress stack by pestaa on Wednesday December 18, 2013 @06:00PM (#6931529)
I believe you're missing Options +FollowSymLinks from your Apache configuration and is not a problem with WP actually.
Re:Bedrock: a modern WordPress stack by codelust on Wednesday December 18, 2013 @03:13PM (#6930312)
Congrats. This looks pretty neat, especially since it uses Composer.

Does it do the whole autoloader song and dance with Composer?

Example: If I add Guzzle to Composer, can I call it from my plugin's code the way you can with other frameworks?

Only thing I would change is to swap out Capistrano with Fabric. But that's a personal choice.

Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @03:23PM (#6930398)
The autoloader is required in wp-config to get access to Dotenv: https://github.com/roots/bedrock/blob/master/wp-config.php#L...

But in the example you gave, ideally your custom plugin is itself a Composer package which requires Guzzle in its composer.json file. Then you'd require your plugin in the project's composer.json :)

Re: Capistrano. We're really trying to encourage people to fork this and modify it to their needs. So you could easily rip Cap out and integrate Fabric in your own fork. We're just providing some sensible defaults that we're familiar with.

Re:Bedrock: a modern WordPress stack by rmccue on Thursday December 19, 2013 @09:15AM (#6934714)
I know it's just an example, but: if you're doing HTTP in WordPress, please use WP HTTP rather than Guzzle. It has compatibility with many more hosts (since it uses sockets as well as cURL), plus it's already built-in.
Re:Bedrock: a modern WordPress stack by squigs25 on Wednesday December 18, 2013 @04:34PM (#6930972)
nice pun: "song and dance with Composer"
Re:Bedrock: a modern WordPress stack by MPetitt on Wednesday December 18, 2013 @02:22PM (#6929895)
Will updating Wordpress be the same as usual, or will we have to modify/get custom builds?
Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @02:36PM (#6930022)
Updating WP is just a matter of bumping the version in the composer.json file and running `composer update`. We believe it's better to manually do this and be explicit about it rather than letting WP update itself. This way you can quickly just look in the composer.json to see the versions of everything being used (WP, plugins, etc).
Re:Bedrock: a modern WordPress stack by pan69 on Wednesday December 18, 2013 @02:43PM (#6930078)
"composer update" maybe?

"composer install" will install from composer.lock.

Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @02:44PM (#6930088)
pan69: correct. Updated my reply to fix that.
Re:Bedrock: a modern WordPress stack by Xdes on Wednesday December 18, 2013 @02:05PM (#6929758)
Hi, I have not written a single of line of php. How hard would it be to get started with a Ruby/Node/.NET background?
Re:Bedrock: a modern WordPress stack by smacktoward on Wednesday December 18, 2013 @02:46PM (#6930098)
You probably won't have too hard a time. With that background, your main challenge will be overcoming the wave of nausea that will sweep across you when you realize that WordPress is a gigantic mass of procedural code studded with inconsistently documented hooks and filters rather than something with a nice, clean, easily extensible OO architecture. But with liberal applications of patience and Pepto-Bismol, this feeling eventually passes.
Re:Bedrock: a modern WordPress stack by wise_young_man on Wednesday December 18, 2013 @08:39PM (#6932349)
I believe WordPress is moving forward. Here is just one of the many OO classes. You can also do OO in plugin development as well.

https://github.com/WordPress/WordPress/blob/master/wp-includ...

Re:Bedrock: a modern WordPress stack by calgaryeng on Wednesday December 18, 2013 @04:09PM (#6930775)
lol :)
Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @02:10PM (#6929799)
WordPress is known for being "easy" but that depends on what you want to do with it. It's definitely easy to get a simple blog up and running since it's mostly done for you. But WP can quickly get complicated since it isn't designed well and the documentation is pretty bad surprisingly. There's a ton of resources online but the quality of it is hit and miss.
Re:Bedrock: a modern WordPress stack by homersapien on Wednesday December 18, 2013 @03:26PM (#6930424)
Not hard at all. PHP is incredibly easy. Wordpress is very well documented, and the enormous community support (plugins) means that you can do quite a lot without having to get your hands dirty with the code. And believe me, that's not an analogy. Wordpress is a great example of how NOT to code, regardless of the language being used.
Re:Bedrock: a modern WordPress stack by chc on Wednesday December 18, 2013 @02:45PM (#6930090)
PHP isn't the most fun language, but it's not that hard either. It's unusually quirky, but not unusable. As for WordPress, though — if you're used to a nice, sane API like you get in Rails or .NET, you're probably going to find the massive heap of cruft that we call WordPress a little bit aggravating.
Re:Bedrock: a modern WordPress stack by krapp on Wednesday December 18, 2013 @03:30PM (#6930451)
Yes, it's probably worth mentioning that even people willing to deal with PHP find Wordpress code to be 'aggravating'. It is, unfortunately, not an example of PHP application design at its best...

Upshot, though, there's plenty of documentation and SO threads out there and a huge ecosystem of plugins. Most of the time you never even need to look at the actual source code.

Re:Bedrock: a modern WordPress stack by smacktoward on Wednesday December 18, 2013 @05:28PM (#6931338)
And in the WordPress core developers' defense, it has been getting steadily better as time goes on. It's still a long way from perfect, of course, but they're working on it.
Re:Bedrock: a modern WordPress stack by krapp on Wednesday December 18, 2013 @05:43PM (#6931427)
things like this need to stop though:

   <?php /* pointless comment */ ?>
   <?php echo $something; ?><div><?php if($blah){ echo stuff(); ?></div><?php } ?>...
...keeping track of that context switching in a complex theme can be maddening. Especially if it includes inline css and javascript or (heavens forfend) mixes php in with the inline css and javascript...
Re:Bedrock: a modern WordPress stack by pestaa on Wednesday December 18, 2013 @06:09PM (#6931585)
Unfortunately, this is precisely the only thing PHP was invented for. It is a templating engine planned to be used exactly how you quoted.

Everything else is just accidental complexity.

Re:Bedrock: a modern WordPress stack by krapp on Wednesday December 18, 2013 @06:21PM (#6931670)
I know. Doesn't mean I have to like it though.
Re:Bedrock: a modern WordPress stack by thebiglebrewski on Thursday December 19, 2013 @08:19AM (#6934454)
If you're interested in doing wordpress in a Rails style, you should checkout my repo wordpress-haml-sass on GitHub! Directory structure and files like Rails, compiles to a Wordpress theme. You're still writing Php but it doesn't feel like it!

https://github.com/zachfeldman/wordpress-haml-sass

Re:Bedrock: a modern WordPress stack by csomar on Wednesday December 18, 2013 @03:53PM (#6930648)
Are you hiring freelancers/contractors?
Re:Bedrock: a modern WordPress stack by bretthopper on Wednesday December 18, 2013 @03:58PM (#6930687)
Roots isn't actually a "company". Just an open source organization although we do sell a few things like screencasts.

If you're interested in work to do with WP/Roots you can check out this thread on our forum: http://discourse.roots.io/t/looking-for-work-post-your-info-...