verifyCSRFToken(); $warnings = array(); $errors = array(); // Make sure an upload succeeded $error = $_FILES["file"]["error"]; if ($error == 1 || $error == 2) { $_SESSION["upload_error"] = "The file you uploaded is too large. You may need to edit your php.ini to upload larger files."; } elseif ($error == 3) { $_SESSION["upload_error"] = "File upload failed."; } if ($error) { BigTree::redirect(DEVELOPER_ROOT."packages/install/"); } // We've at least got the file now, unpack it and see what's going on. $file = $_FILES["file"]["tmp_name"]; if (!$file) { $_SESSION["upload_error"] = "File upload failed."; BigTree::redirect(DEVELOPER_ROOT."packages/install/"); } // Clean up existing area $cache_root = SERVER_ROOT."cache/package/"; BigTree::deleteDirectory($cache_root); BigTree::makeDirectory($cache_root); // Unzip the package include BigTree::path("inc/lib/pclzip.php"); $zip = new PclZip($file); $files = $zip->extract(PCLZIP_OPT_PATH,$cache_root); if (!$files) { BigTree::deleteDirectory($cache_root); $_SESSION["upload_error"] = "The zip file uploaded was corrupt."; BigTree::redirect(DEVELOPER_ROOT."packages/install/"); } // Read the manifest $json = json_decode(file_get_contents($cache_root."manifest.json"),true); // Make sure it's legit if ($json["type"] != "package" || !isset($json["id"]) || !isset($json["title"])) { BigTree::deleteDirectory($cache_root); $_SESSION["upload_error"] = "The zip file uploaded does not appear to be a BigTree package."; BigTree::redirect(DEVELOPER_ROOT."packages/install/"); } // Check for template collisions foreach ((array)$json["components"]["templates"] as $template) { if (sqlrows(sqlquery("SELECT * FROM bigtree_templates WHERE id = '".sqlescape($template["id"])."'"))) { $warnings[] = "A template already exists with the id “".$template["id"]."” — the template will be overwritten."; } } // Check for callout collisions foreach ((array)$json["components"]["callouts"] as $callout) { if (sqlrows(sqlquery("SELECT * FROM bigtree_callouts WHERE id = '".sqlescape($callout["id"])."'"))) { $warnings[] = "A callout already exists with the id “".$callout["id"]."” — the callout will be overwritten."; } } // Check for settings collisions foreach ((array)$json["components"]["settings"] as $setting) { if (sqlrows(sqlquery("SELECT * FROM bigtree_settings WHERE id = '".sqlescape($setting["id"])."'"))) { $warnings[] = "A setting already exists with the id “".$setting["id"]."” — the setting will be overwritten."; } } // Check for feed collisions foreach ((array)$json["components"]["feeds"] as $feed) { if (sqlrows(sqlquery("SELECT * FROM bigtree_feeds WHERE route = '".sqlescape($feed["route"])."'"))) { $warnings[] = "A feed already exists with the route “".$feed["route"]."” — the feed will be overwritten."; } } // Check for field type collisions foreach ((array)$json["components"]["field_types"] as $type) { if (sqlrows(sqlquery("SELECT * FROM bigtree_field_types WHERE id = '".sqlescape($type["id"])."'"))) { $warnings[] = "A field type already exists with the id “".$type["id"]."” — the field type will be overwritten."; } } // Check for table collisions foreach ((array)$json["sql"] as $command) { if (substr($command,0,14) == "CREATE TABLE `") { $table = substr($command,14); $table = substr($table,0,strpos($table,"`")); if (sqlrows(sqlquery("SHOW TABLES LIKE '$table'"))) { $warnings[] = "A table named “$table” already exists — the table will be overwritten."; } } } // Check file permissions and collisions foreach ((array)$json["files"] as $file) { if (!BigTree::isDirectoryWritable(SERVER_ROOT.$file)) { $errors[] = "Cannot write to $file — please make the root directory or file writable."; } elseif (file_exists(SERVER_ROOT.$file)) { if (!is_writable(SERVER_ROOT.$file)) { $errors[] = "Cannot overwrite existing file: $file — please make the file writable or delete it."; } else { $warnings[] = "A file already exists at $file — the file will be overwritten."; } } } ?>


Notice: Undefined variable: json in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 105

Notice: Trying to access array offset on value of type null in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 105

Notice: Undefined variable: json in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 105

Notice: Trying to access array offset on value of type null in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 105
by
Notice: Undefined variable: json in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 106

Notice: Trying to access array offset on value of type null in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 106

Notice: Trying to access array offset on value of type null in /home/bidbyte/diagnostico.bidbyte.tec.br/core/admin/modules/developer/packages/install/unpack.php on line 106

Warnings

Errors

ERRORS OCCURRED! — Please correct all errors. You may not import this module while errors persist.

Package is ready to be installed. No problems found.