Skip to content

Commit

Permalink
Import Magento Release 1.3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Jun 2, 2009
1 parent 81117fa commit 0befb41
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 208 deletions.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class Mage {

public static function getVersion()
{
return '1.3.2';
return '1.3.2.1';
}

/**
Expand Down
27 changes: 27 additions & 0 deletions app/code/core/Mage/Core/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
13 changes: 0 additions & 13 deletions downloader/Maged/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -103,7 +97,6 @@ public function pearGlobalAction()

public function pearInstallAllAction()
{
$this->config()->saveConfigPost($_POST);
$this->model('pear', true)->installAll(!empty($_GET['force']));
}

Expand Down Expand Up @@ -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');
}

Expand Down
17 changes: 2 additions & 15 deletions downloader/Maged/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
6 changes: 1 addition & 5 deletions downloader/config.ini
Original file line number Diff line number Diff line change
@@ -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

15 changes: 0 additions & 15 deletions downloader/pearlib/php/PEAR/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
21 changes: 1 addition & 20 deletions downloader/pearlib/php/PEAR/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -1721,4 +1702,4 @@ function md5_file($filename) {
}
// }}}

?>
?>
46 changes: 4 additions & 42 deletions downloader/pearlib/php/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -641,4 +603,4 @@ function find($args)
}
return $files;
}
}
}
54 changes: 3 additions & 51 deletions downloader/template/install/download.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<p>You are now ready to continue the installation process by downloading the most up-to-date copy of the Magento software.</p>
<form id="install_all" method="post" action="<?php echo $this->url('pearInstallAll') ?>" target="pear_iframe" onsubmit="return installAll()">
<fieldset>
<button class="form-button" type="submit">Start the download process</button>
</fielset>
</form>
<?php else: ?>
<p>There's an indication that Magento files already have been downloaded.</p>
<p>If you feel that you have arrived to this page by mistake, please continue installation:</p>
Expand All @@ -43,45 +46,6 @@
<p>Alternatively, you could proceed with Re-Downloading all packages</p>
<form id="reinstall_all" method="post" action="<?php echo $this->url('pearInstallAll') ?>&force=1" target="pear_iframe" onsubmit="return installAll(true)">
<fieldset>
<?php endif; ?>

<table cellspacing="0" class="form-list">
<tr>
<td class="label">Use custom permissions:</td>
<td class="value">
<select onchange="useCustomPermissions(this)" id="use_custom_permissions_mode" name="use_custom_permissions_mode" style="width:150px;">
<option value="1" <?php if ($this->get('use_custom_permissions_mode')=='1'):?>selected="selected"<?php endif ?>>Yes</option>
<option value="0" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>selected="selected"<?php endif ?>>No</option>
</select>
</td>
</tr>
</table>
<table cellspacing="0" class="form-list" id="use_custom_permissions_mode_panel" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>style="display:none;"<?php endif ?>>
<tr>
<td class="label">Folders:</td>
<td class="value">
<input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
<tr>
<td class="label">Files:</td>
<td class="value">
<input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
<tr>
<td class="label">Executable files:</td>
<td class="value">
<input id="chmod_file_mode_executable" name="chmod_file_mode_executable" value="<?php echo($this->get('chmod_file_mode_executable'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
</table>

<?php if (!$this->controller()->isDownloaded()): ?>
<button class="form-button" type="submit">Start the download process</button>
</fielset>
</form>
<?php else: ?>
<button class="form-button" type="submit">Re-Download All Magento Core Packages</button>
</fieldset>
</form>
Expand All @@ -107,18 +71,6 @@
<button class="form-button" type="button" onclick="location.reload()"><span>Refresh</span></button>
</div>

<script>
function useCustomPermissions (element)
{
if (element.value == '1') {
disabledMode = 'block';
} else {
disabledMode = 'none';
}
document.getElementById('use_custom_permissions_mode_panel').style.display = disabledMode;
}
</script>

<script type="text/javascript">
function installAll(force)
{
Expand Down
2 changes: 1 addition & 1 deletion downloader/template/install/footer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="footer-container">
<div class="footer">
<p class="legality">
Help Us to Keep Magento Healthy - <a href="http://www.magentocommerce.com/bug-tracking" id="bug_tracking_link"><strong>Report All Bugs</strong></a> (Downloader ver. 1.3.1)<br/>
Help Us to Keep Magento Healthy - <a href="http://www.magentocommerce.com/bug-tracking" id="bug_tracking_link"><strong>Report All Bugs</strong></a> (Downloader ver. 1.3.2.1)<br/>

<script type="text/javascript">
$('bug_tracking_link').target = "varien_external";
Expand Down
45 changes: 0 additions & 45 deletions downloader/template/settings.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
?>
<?php echo $this->template('header.phtml') ?>

<script>
function useCustomPermissions (element)
{
if (element.value == '1') {
disabledMode = 'block';
} else {
disabledMode = 'none';
}
document.getElementById('use_custom_permissions_mode_panel').style.display = disabledMode;
}
</script>

<h2 class="page-head">Settings</h2>
<form action="<?php echo $this->url('settingsPost') ?>" method="POST">
<fieldset>
Expand Down Expand Up @@ -66,39 +54,6 @@ function useCustomPermissions (element)
</tr>
-->
</table>
<p>Permission to create new files and folders.</p>
<table cellspacing="0" class="form-list">
<tr>
<td class="label">Use custom permissions:</td>
<td class="value">
<select onchange="useCustomPermissions(this)" id="use_custom_permissions_mode" name="use_custom_permissions_mode" style="width:150px;">
<option value="1" <?php if ($this->get('use_custom_permissions_mode')=='1'):?>selected="selected"<?php endif ?>>Yes</option>
<option value="0" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>selected="selected"<?php endif ?>>No</option>
</select>
</td>
</tr>
</table>
<table cellspacing="0" class="form-list" id="use_custom_permissions_mode_panel" <?php if ($this->get('use_custom_permissions_mode')=='0'):?>style="display:none;"<?php endif ?>>
<tr>
<td class="label">Folders:</td>
<td class="value">
<input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
<tr>
<td class="label">Files:</td>
<td class="value">
<input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
<tr>
<td class="label">Executable files:</td>
<td class="value">
<input id="chmod_file_mode_executable" name="chmod_file_mode_executable" value="<?php echo($this->get('chmod_file_mode_executable'));?>" style="width:50px;" type="text"></input>
</td>
</tr>
</table>

<p><button type="submit">Save Settings</button></p>
</fieldset>
</form>
Expand Down

0 comments on commit 0befb41

Please sign in to comment.