From f0b8753e32574aaeb5cfb9823ea1653ccce974b1 Mon Sep 17 00:00:00 2001 From: Brett Bieber <bieber@unl.edu> Date: Thu, 9 Sep 2010 14:47:15 +0000 Subject: [PATCH] Readability and alignment. Move empty array member var initialization to class definition. git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@154 20a16fea-79d4-4915-8869-1ea9d5ebf173 --- sites/all/modules/unl/unl_migration.php | 49 ++++++++++++++----------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/sites/all/modules/unl/unl_migration.php b/sites/all/modules/unl/unl_migration.php index d01b6b84..392caf1e 100644 --- a/sites/all/modules/unl/unl_migration.php +++ b/sites/all/modules/unl/unl_migration.php @@ -61,44 +61,51 @@ class Unl_Migration_Tool $instance = new self($baseUrl, $frontierPath, $frontierUser, $frontierPass); return $instance->_migrate(); } - + + /** + * base url to the site to migrate, eg: http://www.unl.edu/band/ + * + * @var string + */ private $_baseUrl; + + /** + * base path to frontier dir, eg: /cwis/data/band + * + * @var string + */ private $_frontierPath; private $_frontierUser; private $_frontierPass; private $_frontier; - private $_siteMap; - private $_processedPages; + private $_curl; - private $_content; - private $_lastModifications; - private $_hrefTransform; - private $_hrefTransformFiles; - private $_menu; - private $_nodeMap; - private $_pageTitles; - private $_log; + + private $_siteMap = array(); + private $_processedPages = array(); + private $_content = array(); + private $_lastModifications = array(); + private $_hrefTransform = array(); + private $_hrefTransformFiles = array(); + private $_menu = array(); + private $_nodeMap = array(); + private $_pageTitles = array(); + private $_log = array(); private function __construct($baseUrl, $frontierPath, $frontierUser, $frontierPass) { header('Content-type: text/plain'); + + // Add trailing slash if necessary $baseUrl = trim($baseUrl); if (substr($baseUrl, -1) != '/') { $baseUrl .= '/'; } + $this->_frontierPath = $frontierPath; $this->_frontierUser = $frontierUser; $this->_frontierPass = $frontierPass; - $this->_siteMap = array(); - $this->_processedPages = array(); - $this->_content = array(); - $this->_lastModifications = array(); - $this->_hrefTransform = array(); - $this->_hrefTransformFiles = array(); - $this->_menu = array(); - $this->_nodeMap = array(); - $this->_pageTitles = array(); - $this->_log = array(); + $this->_baseUrl = $baseUrl; $this->_addSitePath(''); -- GitLab