Skip to content

Commit c0cf1af

Browse files
committed
Update as of 9/05/2012
* Implemented encryption of the credit card name and expiration date for the payment method "Credit Card (saved)" * Implemented console utility `dev/tools/migration/get_aliases_map.php`, which generates map file "M1 class alias" to "M2 class name" * Implemented automatic data upgrades for replacing "M1 class aliases" to "M2 class names" in a database * Implemented recursive `chmod` in the library class `Varien_Io_File` * Improved verbosity of the library class `Magento_Shell` * Migrated client-side translation mechanism to jQuery * Performance tests: * Improved assertion for number of created orders for the checkout performance testing scenario * Reverted the feature of specifying PHP scenarios to be executed before and after a JMeter scenario * Implemented validation for the number of created orders as a part of the JMeter scenario * Implemented the "Admin Login" user activity as a separate file to be reused in the performance testing scenarios * Implemented fixture of 100k customers for the performance tests * Implemented fixture of 100k products for the performance tests * Enhanced module `Mage_ImportExport` in order to utilize it for the fixture implementation * Implemented back-end performance testing scenario, which covers Dashboard, Manage Products, Manage Customers pages * Fixes: * Fixed Magento console installer to enable write permission recursively to the `var` directory * Fixed performance tests to enable write permission recursively to the `var` directory * Fixed integration test `Mage_Adminhtml_Model_System_Config_Source_Admin_PageTest::testToOptionArray` to not produce "Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity" in the developer mode * GitHub requests: * [#43](#43) -- implemented logging of executed setup files * [#44](#44) * Implemented support of writing logs into wrappers (for example, `php://output`) * Enforced a log writer model to be an instance of `Zend_Log_Writer_Stream` * [#49](#49) * Fixed sorting of totals according to "before" and "after" properties * Introduced `Magento_Data_Graph` library class and utilized it for finding cycles in "before" and "after" declarations * Implemented tests for totals sorting including the ambiguous cases
1 parent fa5121e commit c0cf1af

File tree

109 files changed

+4723
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4723
-700
lines changed

CHANGELOG.markdown

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
Update as of 9/05/2012
2+
======================
3+
* Implemented encryption of the credit card name and expiration date for the payment method "Credit Card (saved)"
4+
* Implemented console utility `dev/tools/migration/get_aliases_map.php`, which generates map file "M1 class alias" to "M2 class name"
5+
* Implemented automatic data upgrades for replacing "M1 class aliases" to "M2 class names" in a database
6+
* Implemented recursive `chmod` in the library class `Varien_Io_File`
7+
* Improved verbosity of the library class `Magento_Shell`
8+
* Migrated client-side translation mechanism to jQuery
9+
* Performance tests:
10+
* Improved assertion for number of created orders for the checkout performance testing scenario
11+
* Reverted the feature of specifying PHP scenarios to be executed before and after a JMeter scenario
12+
* Implemented validation for the number of created orders as a part of the JMeter scenario
13+
* Implemented the "Admin Login" user activity as a separate file to be reused in the performance testing scenarios
14+
* Implemented fixture of 100k customers for the performance tests
15+
* Implemented fixture of 100k products for the performance tests
16+
* Enhanced module `Mage_ImportExport` in order to utilize it for the fixture implementation
17+
* Implemented back-end performance testing scenario, which covers Dashboard, Manage Products, Manage Customers pages
18+
* Fixes:
19+
* Fixed Magento console installer to enable write permission recursively to the `var` directory
20+
* Fixed performance tests to enable write permission recursively to the `var` directory
21+
* Fixed integration test `Mage_Adminhtml_Model_System_Config_Source_Admin_PageTest::testToOptionArray` to not produce "Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity" in the developer mode
22+
* GitHub requests:
23+
* [#43](https://github.com/magento/magento2/pull/43) -- implemented logging of executed setup files
24+
* [#44](https://github.com/magento/magento2/pull/44)
25+
* Implemented support of writing logs into wrappers (for example, `php://output`)
26+
* Enforced a log writer model to be an instance of `Zend_Log_Writer_Stream`
27+
* [#49](https://github.com/magento/magento2/pull/49)
28+
* Fixed sorting of totals according to "before" and "after" properties
29+
* Introduced `Magento_Data_Graph` library class and utilized it for finding cycles in "before" and "after" declarations
30+
* Implemented tests for totals sorting including the ambiguous cases
31+
132
Update as of 8/30/2012
233
======================
334
* Fixes:

app/Mage.php

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ final class Mage
9999
*/
100100
static private $_isInstalled;
101101

102+
/**
103+
* Logger entities
104+
*
105+
* @var array
106+
*/
107+
static private $_loggers = array();
108+
102109
/**
103110
* Magento edition constants
104111
*/
@@ -172,6 +179,7 @@ public static function reset()
172179
self::$_isDownloader = false;
173180
self::$_isDeveloperMode = false;
174181
self::$_isInstalled = null;
182+
self::$_loggers = array();
175183
// do not reset $headersSentThrowsException
176184
}
177185

@@ -761,49 +769,64 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
761769
return;
762770
}
763771

764-
static $loggers = array();
765-
766772
$level = is_null($level) ? Zend_Log::DEBUG : $level;
767773
$file = empty($file) ? 'system.log' : $file;
768774

769775
try {
770-
if (!isset($loggers[$file])) {
771-
$logDir = self::getBaseDir('var') . DS . 'log';
772-
$logFile = $logDir . DS . $file;
773-
774-
if (!is_dir($logDir)) {
775-
mkdir($logDir);
776-
chmod($logDir, 0777);
777-
}
778-
779-
if (!file_exists($logFile)) {
780-
file_put_contents($logFile, '');
781-
chmod($logFile, 0777);
782-
}
776+
if (!isset(self::$_loggers[$file])) {
777+
$logFile = self::_expandLogFileName($file);
783778

784779
$format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
785780
$formatter = new Zend_Log_Formatter_Simple($format);
786781
$writerModel = (string)self::getConfig()->getNode('global/log/core/writer_model');
787-
if (!self::$_app || !$writerModel) {
788-
$writer = new Zend_Log_Writer_Stream($logFile);
789-
}
790-
else {
791-
$writer = new $writerModel($logFile);
782+
if (!self::$_app || !$writerModel || !is_subclass_of($writerModel, 'Zend_Log_Writer_Stream')) {
783+
$writerModel = 'Zend_Log_Writer_Stream';
792784
}
785+
/** @var $writer Zend_Log_Writer_Stream */
786+
$writer = new $writerModel($logFile);
793787
$writer->setFormatter($formatter);
794-
$loggers[$file] = new Zend_Log($writer);
788+
self::$_loggers[$file] = new Zend_Log($writer);
795789
}
796790

797791
if (is_array($message) || is_object($message)) {
798792
$message = print_r($message, true);
799793
}
800794

801-
$loggers[$file]->log($message, $level);
795+
self::$_loggers[$file]->log($message, $level);
802796
}
803797
catch (Exception $e) {
804798
}
805799
}
806800

801+
/**
802+
* Expand log file name to absolute path, if necessary
803+
*
804+
* @param string $file
805+
* @return string
806+
*/
807+
protected static function _expandLogFileName($file)
808+
{
809+
/*
810+
* Check whether a file is a wrapper
811+
* @link http://www.php.net/manual/en/wrappers.php
812+
*/
813+
if (preg_match('#^[a-z][a-z0-9+.-]*\://#i', $file)) {
814+
return $file;
815+
}
816+
$dir = self::getBaseDir('var') . DIRECTORY_SEPARATOR . 'log';
817+
$file = $dir . DIRECTORY_SEPARATOR . $file;
818+
if (!is_dir($dir)) {
819+
mkdir($dir);
820+
chmod($dir, 0777);
821+
}
822+
if (!file_exists($file)) {
823+
file_put_contents($file, '');
824+
chmod($file, 0777);
825+
}
826+
return $file;
827+
}
828+
829+
807830
/**
808831
* Write exception to log
809832
*

app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,7 @@ Moneybookers.prototype = {
7474
},
7575

7676
translate: function(text) {
77-
try {
78-
if(Translator){
79-
return Translator.translate(text);
80-
}
81-
}
82-
catch(e){}
83-
return text;
77+
return jQuery.mage.__ ? jQuery.mage.__(text) : text;
8478
},
8579

8680
button: function () {

app/code/core/Mage/Adminhtml/Helper/Media/Js.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ public function __construct()
6060
*/
6161
public function getTranslatorScript()
6262
{
63-
$script = 'if (typeof(Translator) == \'undefined\') {'
64-
. ' var Translator = new Translate('.$this->getTranslateJson().');'
65-
. '} else {'
66-
. ' Translator.add('.$this->getTranslateJson().');'
67-
. '}';
63+
$script = '(function($) {$.mage.translate.add(' . $this->getTranslateJson() . ')})(jQuery);';
6864
return $this->getScript($script);
6965
}
7066

app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<remove name="root"/>
3333
<block type="Mage_Adminhtml_Block_Page" name="convert_root" output="1" template="admin/page.phtml">
3434
<block type="Mage_Adminhtml_Block_Page_Head" name="convert_root_head" as="head" template="page/head.phtml">
35+
<action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
36+
<action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
3537
<action method="addJs"><file>prototype/prototype.js</file></action>
3638
<action method="addJs"><file>prototype/validation.js</file></action>
3739
<action method="addJs"><file>varien/js.js</file></action>
@@ -46,6 +48,8 @@
4648
<remove name="root"/>
4749
<block type="Mage_Adminhtml_Block_Page" name="convert_root" output="1" template="admin/page.phtml">
4850
<block type="Mage_Adminhtml_Block_Page_Head" name="convert_root_head" as="head" template="page/head.phtml">
51+
<action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
52+
<action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
4953
<action method="addJs"><file>prototype/prototype.js</file></action>
5054
<action method="addJs"><file>prototype/validation.js</file></action>
5155
<action method="addJs"><file>varien/js.js</file></action>

app/code/core/Mage/Adminhtml/view/adminhtml/main.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Supported layout update handles (special):
5555
<block type="Mage_Adminhtml_Block_Page" name="root" output="1" template="admin/page.phtml">
5656
<block type="Mage_Adminhtml_Block_Page_Head" name="head" as="head" template="page/head.phtml">
5757
<action method="setTitle" translate="title"><title>Magento Admin</title></action>
58+
<action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
59+
<action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
5860
<action method="addJs"><file>prototype/prototype.js</file></action>
5961
<action method="addJs"><file>mage/adminhtml/fix-extjs-defer.js</file><params/><if/><condition>can_load_ext_js</condition></action>
6062
<action method="addJs"><file>mage/adminhtml/fix-extjs-defer-before.js</file><params/><if/><condition>can_load_ext_js</condition></action>

app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,7 @@ $_data = array(
6363
);
6464
?>
6565
<script type="text/javascript">
66-
var Translator = new Translate(<?php echo Zend_Json::encode($_data) ?>);
66+
(function($) {
67+
$.mage.translate.add(<?php echo Zend_Json::encode($_data) ?>)
68+
})(jQuery);
6769
</script>

app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ VarienRulesForm.prototype = {
295295
var new_type = elem.value;
296296
var new_elem = document.createElement('LI');
297297
new_elem.className = 'rule-param-wait';
298-
new_elem.innerHTML = Translator.translate('Please wait, loading...');
298+
new_elem.innerHTML = jQuery.mage.__('Please wait, loading...');
299299
children_ul.insertBefore(new_elem, $(elem).up('li'));
300300

301301
new Ajax.Request(this.newChildUrl, {

app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ AdminOrder.prototype = {
6060
}
6161
});
6262

63-
var searchButton = new ControlButton(Translator.translate('Add Products')),
63+
var searchButton = new ControlButton(jQuery.mage.__('Add Products')),
6464
searchAreaId = this.getAreaId('search');
6565
searchButton.onClick = function() {
6666
$(searchAreaId).show();
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Magento
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Open Software License (OSL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/osl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade Magento to newer
18+
* versions in the future. If you wish to customize Magento for your
19+
* needs please refer to http://www.magentocommerce.com for more information.
20+
*
21+
* @category Mage
22+
* @package Mage_Catalog
23+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25+
*/
26+
27+
/** @var $this Mage_Catalog_Model_Resource_Setup */
28+
29+
/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
30+
$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
31+
$installer->startSetup();
32+
33+
$attributeData = $this->getAttribute('catalog_category', 'custom_layout_update');
34+
$installer->appendClassAliasReplace('catalog_category_entity_text', 'value',
35+
Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
36+
Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
37+
array('value_id'),
38+
'attribute_id = ' . (int) $attributeData['attribute_id']
39+
);
40+
41+
$attributeData = $this->getAttribute('catalog_product', 'custom_layout_update');
42+
$installer->appendClassAliasReplace('catalog_product_entity_text', 'value',
43+
Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
44+
Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
45+
array('value_id'),
46+
'attribute_id = ' . (int) $attributeData['attribute_id']
47+
);
48+
49+
$installer->appendClassAliasReplace('catalog_eav_attribute', 'frontend_input_renderer',
50+
Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
51+
Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
52+
array('attribute_id')
53+
);
54+
$installer->doUpdateClassAliases();
55+
56+
$installer->endSetup();

app/code/core/Mage/Catalog/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<config>
2929
<modules>
3030
<Mage_Catalog>
31-
<version>1.6.0.0.16</version>
31+
<version>1.6.0.0.17</version>
3232
<active>true</active>
3333
<codePool>core</codePool>
3434
<depends>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Magento
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Open Software License (OSL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/osl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade Magento to newer
18+
* versions in the future. If you wish to customize Magento for your
19+
* needs please refer to http://www.magentocommerce.com for more information.
20+
*
21+
* @category Mage
22+
* @package Mage_CatalogRule
23+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25+
*/
26+
27+
/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
28+
$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
29+
$installer->startSetup();
30+
31+
$installer->appendClassAliasReplace('catalogrule', 'conditions_serialized',
32+
Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
33+
Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_SERIALIZED,
34+
array('rule_id')
35+
);
36+
$installer->appendClassAliasReplace('catalogrule', 'actions_serialized',
37+
Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
38+
Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_SERIALIZED,
39+
array('rule_id')
40+
);
41+
42+
$installer->doUpdateClassAliases();
43+
44+
$installer->endSetup();

app/code/core/Mage/CatalogRule/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<config>
2929
<modules>
3030
<Mage_CatalogRule>
31-
<version>1.6.0.3</version>
31+
<version>1.6.0.4</version>
3232
<active>true</active>
3333
<codePool>core</codePool>
3434
<depends>

app/code/core/Mage/Checkout/view/frontend/opcheckout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Checkout.prototype = {
136136
this.gotoSection('billing');
137137
}
138138
else{
139-
alert(Translator.translate('Please choose to register or to checkout as a guest').stripTags());
139+
alert(jQuery.mage.__('Please choose to register or to checkout as a guest').stripTags());
140140
return false;
141141
}
142142
document.body.fire('login:setMethod', {method : this.method});
@@ -545,7 +545,7 @@ ShippingMethod.prototype = {
545545
validate: function() {
546546
var methods = document.getElementsByName('shipping_method');
547547
if (methods.length==0) {
548-
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
548+
alert(jQuery.mage.__('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
549549
return false;
550550
}
551551

@@ -558,7 +558,7 @@ ShippingMethod.prototype = {
558558
return true;
559559
}
560560
}
561-
alert(Translator.translate('Please specify shipping method.').stripTags());
561+
alert(jQuery.mage.__('Please specify shipping method.').stripTags());
562562
return false;
563563
},
564564

@@ -732,7 +732,7 @@ Payment.prototype = {
732732
}
733733
var methods = document.getElementsByName('payment[method]');
734734
if (methods.length==0) {
735-
alert(Translator.translate('Your order cannot be completed at this time as there is no payment methods available for it.').stripTags());
735+
alert(jQuery.mage.__('Your order cannot be completed at this time as there is no payment methods available for it.').stripTags());
736736
return false;
737737
}
738738
for (var i=0; i<methods.length; i++) {
@@ -744,7 +744,7 @@ Payment.prototype = {
744744
if (result) {
745745
return true;
746746
}
747-
alert(Translator.translate('Please specify payment method.').stripTags());
747+
alert(jQuery.mage.__('Please specify payment method.').stripTags());
748748
return false;
749749
},
750750

0 commit comments

Comments
 (0)