summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-28 11:39:39 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-28 11:39:39 +0100
commitde37bafa5c00683984302ca6849719a282835da0 (patch)
treeca9965b6aeaffc6bdf602528bcc874acc944f7cd /lib
parent3e0bb3e7c4a34b3e7344665b901918ce54b57d81 (diff)
downloadnextcloud-server-de37bafa5c00683984302ca6849719a282835da0.tar.gz
nextcloud-server-de37bafa5c00683984302ca6849719a282835da0.zip
use in-memory files for the datase scheme during installation
Diffstat (limited to 'lib')
-rw-r--r--lib/db.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/db.php b/lib/db.php
index 02eac7cac9a..9fab51edfcd 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -316,8 +316,8 @@ class OC_DB {
// read file
$content = file_get_contents( $file );
- // Make changes and save them to a temporary file
- $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
+ // Make changes and save them to an in-memory file
+ $file2 = 'static://db_scheme';
if($file2 == ''){
die('could not create tempfile in get_temp_dir() - aborting');
}
@@ -331,7 +331,7 @@ class OC_DB {
// Try to create tables
$definition = self::$schema->parseDatabaseDefinitionFile( $file2 );
- // Delete our temporary file
+ //clean up memory
unlink( $file2 );
// Die in case something went wrong
@@ -371,8 +371,8 @@ class OC_DB {
return false;
}
- // Make changes and save them to a temporary file
- $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
+ // Make changes and save them to an in-memory file
+ $file2 = 'static://db_scheme';
$content = str_replace( '*dbname*', $previousSchema['name'], $content );
$content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content );
if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite doesn't
@@ -381,7 +381,7 @@ class OC_DB {
file_put_contents( $file2, $content );
$op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);
- // Delete our temporary file
+ //clean up memory
unlink( $file2 );
if (PEAR::isError($op)) {