|
@@ -12,8 +12,10 @@ class WordPressImport {
|
|
|
private $errors = [];
|
|
private $errors = [];
|
|
|
|
|
|
|
|
public function __construct($wpConfig) {
|
|
public function __construct($wpConfig) {
|
|
|
|
|
+ error_log('WordPressImport constructor called');
|
|
|
$this->wpConfig = $wpConfig;
|
|
$this->wpConfig = $wpConfig;
|
|
|
$this->targetDb = Database::getInstance();
|
|
$this->targetDb = Database::getInstance();
|
|
|
|
|
+ error_log('WordPressImport constructor completed');
|
|
|
// Don't connect in constructor - connect on demand to avoid hanging
|
|
// Don't connect in constructor - connect on demand to avoid hanging
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -87,14 +89,19 @@ class WordPressImport {
|
|
|
* Import all WordPress data
|
|
* Import all WordPress data
|
|
|
*/
|
|
*/
|
|
|
public function importAll($options = []) {
|
|
public function importAll($options = []) {
|
|
|
|
|
+ error_log('importAll() called with options: ' . print_r($options, true));
|
|
|
$results = [];
|
|
$results = [];
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
// Connect to WordPress database first
|
|
// Connect to WordPress database first
|
|
|
|
|
+ error_log('About to call connectWordPress()');
|
|
|
$this->connectWordPress();
|
|
$this->connectWordPress();
|
|
|
|
|
+ error_log('connectWordPress() completed');
|
|
|
|
|
|
|
|
// Start transaction
|
|
// Start transaction
|
|
|
|
|
+ error_log('About to start transaction');
|
|
|
$this->targetDb->beginTransaction();
|
|
$this->targetDb->beginTransaction();
|
|
|
|
|
+ error_log('Transaction started');
|
|
|
|
|
|
|
|
// Import categories first (posts depend on them)
|
|
// Import categories first (posts depend on them)
|
|
|
if ($options['import_categories'] ?? true) {
|
|
if ($options['import_categories'] ?? true) {
|