Skip to content

Commit

Permalink
Updated WordPress scaffold to support importing existing WordPress co…
Browse files Browse the repository at this point in the history
…debases
  • Loading branch information
blobaugh committed Oct 10, 2011
1 parent 825aa6d commit 5510e68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions WordPress/WordPress/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public function parameters() {
$this->p->add('sync_folder', false, 'wp-content', 'WordPress folder to watch for changes');
$this->p->add('sync_exclude_paths', false, '', 'Path to not sync');
$this->p->add('sync_frequency', false, '7200', 'Sync time interval in seconds');
$this->p->add('source', false, '', 'If there is an existing WordPress code base you can use it via a path');


if(!$this->p->verify()) die($this->p->getError());
Expand All @@ -145,13 +146,19 @@ public function doWork() {
$this->log("Creating temporary build directory: " . $tmp);
$fs->mkdir($tmp);

// Download and unpack WordPress
$this->log('Downloading WordPress');
$file = $this->curlFile("http://wordpress.org/wordpress-3.2.1.zip", $tmp);
$this->log('Extracting WordPress');
$this->unzip($file, $tmp);
$this->log('Moving WordPress files to ' . $this->mAppRoot);
$fs->move("$tmp\wordpress", $this->mAppRoot);
if($this->p->get('source') != '' && $fs->exists($this->p->get('source'))) {
// Use WordPress codebase from source parameter
$this->log("Copying WordPress from " . $this->p->get('source'));
$fs->copy($this->p->get('source'), $this->mAppRoot);
} else {
// Download and unpack WordPress
$this->log('Downloading WordPress');
$file = $this->curlFile("http://wordpress.org/wordpress-3.2.1.zip", $tmp);
$this->log('Extracting WordPress');
$this->unzip($file, $tmp);
$this->log('Moving WordPress files to ' . $this->mAppRoot);
$fs->move("$tmp\wordpress", $this->mAppRoot);
}

// Download and unpack DB abstraction layer
$this->log('Downloading Database Abstraction Layer');
Expand Down
2 changes: 1 addition & 1 deletion WordPress/WordPress/resources/WebRole/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@



if(!isset($_SERVER['INSTANCE_NAME']) || strstr(strtolower($_SERVER['INSTANCE_NAME']), 'deployment')) {
if($_SERVER['SERVER_NAME'] == 'localhost' || !isset($_SERVER['INSTANCE_NAME']) || strstr(strtolower($_SERVER['INSTANCE_NAME']), 'deployment')) {
// ** SQL Azure settings ** //
/** The name of the database for WordPress. Please create database before starting WordPress configuration */
define('DB_NAME', '$DB_NAME$');
Expand Down

0 comments on commit 5510e68

Please sign in to comment.