diff --git a/app/Mage.php b/app/Mage.php index b9b715d1a6..2baae144be 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -84,7 +84,7 @@ final class Mage { public static function getVersion() { - return '1.3.2'; + return '1.3.2.1'; } /** diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 2578056eb3..b945db58ce 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -339,3 +339,30 @@ function is_dir_writeable($dir) } return false; } + +if ( !function_exists('sys_get_temp_dir') ) { + // Based on http://www.phpit.net/ + // article/creating-zip-tar-archives-dynamically-php/2/ + function sys_get_temp_dir() + { + // Try to get from environment variable + if ( !empty($_ENV['TMP']) ) { + return realpath( $_ENV['TMP'] ); + } else if ( !empty($_ENV['TMPDIR']) ) { + return realpath( $_ENV['TMPDIR'] ); + } else if ( !empty($_ENV['TEMP']) ) { + return realpath( $_ENV['TEMP'] ); + } else { + // Try to use system's temporary directory + // as random name shouldn't exist + $temp_file = tempnam( md5(uniqid(rand(), TRUE)), '' ); + if ( $temp_file ) { + $temp_dir = realpath( dirname($temp_file) ); + unlink( $temp_file ); + return $temp_dir; + } else { + return FALSE; + } + } + } +} \ No newline at end of file diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php index 2351291a0c..4f5c36914c 100755 --- a/downloader/Maged/Controller.php +++ b/downloader/Maged/Controller.php @@ -74,12 +74,6 @@ public function indexAction() echo $this->view()->template('install/writable.phtml'); } else { $this->view()->set('mage_url', dirname(dirname($_SERVER['SCRIPT_NAME']))); - - $this->view()->set('use_custom_permissions_mode', $this->config()->get('use_custom_permissions_mode')); - $this->view()->set('mkdir_mode', $this->config()->get('mkdir_mode')); - $this->view()->set('chmod_file_mode', $this->config()->get('chmod_file_mode')); - $this->view()->set('chmod_file_mode_executable', $this->config()->get('chmod_file_mode_executable')); - echo $this->view()->template('install/download.phtml'); } } else { @@ -103,7 +97,6 @@ public function pearGlobalAction() public function pearInstallAllAction() { - $this->config()->saveConfigPost($_POST); $this->model('pear', true)->installAll(!empty($_GET['force'])); } @@ -157,12 +150,6 @@ public function settingsAction() $pearConfig = $this->model('pear', true)->pear()->getConfig(); $this->view()->set('state', $pearConfig->get('preferred_state')); $this->view()->set('mage_dir', $pearConfig->get('mage_dir')); - - $this->view()->set('use_custom_permissions_mode', $this->config()->get('use_custom_permissions_mode')); - $this->view()->set('mkdir_mode', $this->config()->get('mkdir_mode')); - $this->view()->set('chmod_file_mode', $this->config()->get('chmod_file_mode')); - $this->view()->set('chmod_file_mode_executable', $this->config()->get('chmod_file_mode_executable')); - echo $this->view()->template('settings.phtml'); } diff --git a/downloader/Maged/Model/Config.php b/downloader/Maged/Model/Config.php index 6f080d7792..3d74a98871 100644 --- a/downloader/Maged/Model/Config.php +++ b/downloader/Maged/Model/Config.php @@ -28,20 +28,7 @@ class Maged_Model_Config extends Maged_Model { public function saveConfigPost($p) { - $configParams = array( - 'preferred_state', - 'use_custom_permissions_mode', - 'mkdir_mode', - 'chmod_file_mode', - 'chmod_file_mode_executable' - ); - - foreach ($configParams as $paramName){ - if (isset($p[$paramName])) { - $this->set($paramName, $p[$paramName]); - } - } - + $this->set('preferred_state', $p['preferred_state']); //$this->set('mage_dir', $p['mage_dir']); $this->save(); return $this; @@ -67,7 +54,7 @@ public function load() continue; } $key = trim($arr[0]); - $value = trim($arr[1], " \t\"'\n"); + $value = trim($arr[1], " \t\"'"); if (!$key || $key[0]=='#' || $key[0]==';') { continue; } diff --git a/downloader/config.ini b/downloader/config.ini index 68d0f07564..c42f3e5251 100755 --- a/downloader/config.ini +++ b/downloader/config.ini @@ -1,6 +1,2 @@ preferred_state=beta -use_custom_permissions_mode=0 -mkdir_mode=0777 -chmod_file_mode=0777 -chmod_file_mode_executable=0777 -tmp_dir=../var/tmp \ No newline at end of file + diff --git a/downloader/pearlib/php/PEAR/Common.php b/downloader/pearlib/php/PEAR/Common.php index 5f5a02365e..b06b50a776 100644 --- a/downloader/pearlib/php/PEAR/Common.php +++ b/downloader/pearlib/php/PEAR/Common.php @@ -259,21 +259,6 @@ function mkDirHier($dir) if (!class_exists('System')) { require_once 'System.php'; } - - /* - * Magento fix for custom set permissions in config.ini - */ - if (class_exists('Maged_Controller',false)) { - $magedConfig = Maged_Controller::model('Config',true)->load(); - if ($magedConfig->get('use_custom_permissions_mode') == '1' && - $mode = $magedConfig->get('mkdir_mode')) { - return System::mkDir(array('-m' . $mode, $dir)); - } - } - /* - * End fix - */ - return System::mkDir(array('-p', $dir)); } diff --git a/downloader/pearlib/php/PEAR/Installer.php b/downloader/pearlib/php/PEAR/Installer.php index 0e4fdb87a0..5f73ed4429 100644 --- a/downloader/pearlib/php/PEAR/Installer.php +++ b/downloader/pearlib/php/PEAR/Installer.php @@ -612,25 +612,6 @@ function _installFile2(&$pkg, $file, $atts, $tmp_path, $options) } else { $mode = 0666 & ~(int)octdec($this->config->get('umask')); } - - /* - * Magento fix for custom set permissions in config.ini - */ - if (class_exists('Maged_Controller',false)) { - $magedConfig = Maged_Controller::model('Config',true)->load(); - if ($magedConfig->get('use_custom_permissions_mode') == '1'){ - if ($role->isExecutable() && $configMode = $magedConfig->get('chmod_file_mode_executable')) { - $mode = $magedConfig; - } - if (!$role->isExecutable() && $configMode = $magedConfig->get('chmod_file_mode')) { - $mode = $magedConfig; - } - } - } - /* - * End fix - */ - if ($attribs['role'] != 'src') { $this->addFileOperation("chmod", array($mode, $dest_file)); if (!@chmod($dest_file, $mode)) { @@ -1721,4 +1702,4 @@ function md5_file($filename) { } // }}} -?> +?> \ No newline at end of file diff --git a/downloader/pearlib/php/System.php b/downloader/pearlib/php/System.php index 9edffe1b73..7695007f40 100644 --- a/downloader/pearlib/php/System.php +++ b/downloader/pearlib/php/System.php @@ -392,32 +392,9 @@ function mktemp($args = null) if (!isset($tmpdir)) { $tmpdir = System::tmpdir(); } - - /* - * Magento fix for set tmp dir in config.ini - */ - if (class_exists('Maged_Controller',false)) { - $magedConfig = Maged_Controller::model('Config',true)->load(); - if ($magedConfig->get('use_custom_permissions_mode') == '1' && - $mode = $magedConfig->get('mkdir_mode')) { - $result = System::mkDir(array('-m' . $mode, $tmpdir)); - } else { - $result = System::mkDir(array('-p', $tmpdir)); - } - - if (!$result) { - return false; - } + if (!System::mkDir(array('-p', $tmpdir))) { + return false; } - // Old realisation - //if (!System::mkDir(array('-p', $tmpdir))) { - // return false; - //} - - /* - * End fix - */ - $tmp = tempnam($tmpdir, $prefix); if (isset($tmp_is_dir)) { unlink($tmp); // be careful possible race condition here @@ -461,22 +438,7 @@ function _removeTmpFiles() */ function tmpdir() { - - /* - * Magento fix for set tmp dir in config.ini - */ - if (class_exists('Maged_Controller',false)) { - $magedConfig = Maged_Controller::model('Config',true)->load(); - if (!is_null($tmpDir = $magedConfig->get('tmp_dir'))) - { - return $tmpDir; - } - } - /* - * End fix - */ - - if (OS_WINDOWS) { + if (OS_WINDOWS) { if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { return $var; } @@ -641,4 +603,4 @@ function find($args) } return $files; } -} +} \ No newline at end of file diff --git a/downloader/template/install/download.phtml b/downloader/template/install/download.phtml index deff77486e..42b4b9f7ad 100644 --- a/downloader/template/install/download.phtml +++ b/downloader/template/install/download.phtml @@ -35,6 +35,9 @@

You are now ready to continue the installation process by downloading the most up-to-date copy of the Magento software.

+ + +

There's an indication that Magento files already have been downloaded.

If you feel that you have arrived to this page by mistake, please continue installation:

@@ -43,45 +46,6 @@

Alternatively, you could proceed with Re-Downloading all packages

- - - - - - - -
Use custom permissions: - -
- get('use_custom_permissions_mode')=='0'):?>style="display:none;"> - - - - - - - - - - - - -
Folders: - -
Files: - -
Executable files: - -
- -controller()->isDownloaded()): ?> - - - -
@@ -107,18 +71,6 @@ - - -

Settings

@@ -66,39 +54,6 @@ function useCustomPermissions (element) --> -

Permission to create new files and folders.

- - - - - -
Use custom permissions: - -
- get('use_custom_permissions_mode')=='0'):?>style="display:none;"> - - - - - - - - - - - - -
Folders: - -
Files: - -
Executable files: - -
-