"classmap" : ["."]
},
"require": {
+ "pear/archive_tar": "1.3.*",
"andy128k/routeexpression": "dev-master"
},
"require-dev": {
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
- "hash": "20bffa57e6d8564e8b9bf75a6d2f70af",
+ "hash": "09e63866555a75f0b04932883319a5f1",
"packages": [
{
"name": "andy128k/routeexpression",
"issues": "https://github.com/andy128k/routeexpression/issues"
},
"time": "2013-06-22 08:01:38"
+ },
+ {
+ "name": "pear/archive_tar",
+ "version": "1.3.11",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pear/Archive_Tar",
+ "reference": "1.3.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/1.3.11",
+ "reference": "1.3.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=4.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Archive_Tar": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Michiel Rook",
+ "email": "mrook@php.net"
+ },
+ {
+ "name": "Vincent Blavet",
+ "email": "vincent@phpconcept.net"
+ },
+ {
+ "name": "Greg Beaver",
+ "email": "greg@chiaraquartet.net"
+ }
+ ],
+ "description": "Tar file management class",
+ "homepage": "https://github.com/pear/Archive_Tar",
+ "keywords": [
+ "archive",
+ "tar"
+ ],
+ "time": "2013-02-09 11:44:32"
}
],
"packages-dev": [
new IPF_Command_Fixtures,
new IPF_Command_DB,
new IPF_Command_DBDump,
+ new IPF_Command_Pack,
new IPF_Command_CreateSuperUser,
new IPF_Command_SyncPerms,
);
{
$output = 'dump.sql';
- print "Dumping database to file $output\n";
+ if (!in_array('quiet', $args))
+ print "Dumping database to file $output\n";
$db = IPF_ORM_Manager::getInstance()->connectionParameters(IPF::get('database', IPF::get('dsn')));
--- /dev/null
+<?php
+
+class IPF_Command_Pack
+{
+ public $command = 'pack';
+ public $description = 'Pack database dump and uploaded files to a single archive.';
+
+ public function run($args=null)
+ {
+ $outputFileName = 'working-data.tar';
+
+ $uploadsDir = IPF::get('document_root') . IPF::getUploadUrl();
+ if (is_dir($uploadsDir)) {
+ $workingDirectory = getcwd();
+ chdir($uploadsDir . '/..');
+ $tar_object = new Archive_Tar($workingDirectory . '/upload.tar');
+ $tar_object->setErrorHandling(PEAR_ERROR_PRINT);
+ $tar_object->create('upload');
+ chdir($workingDirectory);
+ }
+
+ (new IPF_Command_DBDump)->run(array('quiet'));
+
+ unlink($outputFileName);
+
+ $tar_object = new Archive_Tar($outputFileName);
+ $tar_object->setErrorHandling(PEAR_ERROR_PRINT);
+ $tar_object->create('upload.tar dump.sql');
+
+ unlink('upload.tar');
+ unlink('dump.sql');
+ }
+}
+