Skip to content

Commit 6194a7a

Browse files
committed
Update as of 3/26/2012
* Introduced concept of containers and "page types" in layout. * Containers replace `Mage_Core_Block_Text_List` and `Mage_Page_Block_Html_Wrapper` * Widgets now utilize page types and containers instead of "handles" and "block references" * Implemented first draft of visual design editor with the following capabilities * highlighting and dragging blocks and containers, toggling highlighting on/off * switching to arbitrary theme and skin * navigating to arbitrary page types (product view, order success page, etc...), so that they would be editable with visual design editor * Refactored various places across the system in order to accommodate transition to containers, page types and visual design editor, which includes * Output in any frontend controller action using layout only * Output in any frontend controller specifies one and only one layout handle, which equals to its full action name. There can be other handles that extend it and they are determined by layout loading parameters, provided by controller. * No program termination (exit) on logging in admin user * Session cookie lifetime is set to 0 for frontend and backend. Session will exist until browser window is open, however backend session lifetime limitation does not depend on cookie lifetime anymore. * Fixes: * Failures of tests in developer mode * `app/etc/local.xml` affected integration tests * Addressed pull requests and issues from Github * Fetched updates from Magento 1 up to March 2 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details.
1 parent 9de2223 commit 6194a7a

File tree

1,012 files changed

+46883
-13375
lines changed

Some content is hidden

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

1,012 files changed

+46883
-13375
lines changed

.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@
128128

129129
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
130130

131+
############################################
132+
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
133+
134+
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
135+
RewriteRule .* - [L,R=405]
136+
131137
############################################
132138
## always send 404 on missing files in these folders
133139

CHANGELOG.markdown

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Update as of 3/26/2012
2+
======================
3+
4+
* Introduced concept of containers and "page types" in layout.
5+
* Containers replace `Mage_Core_Block_Text_List` and `Mage_Page_Block_Html_Wrapper`
6+
* Widgets now utilize page types and containers instead of "handles" and "block references"
7+
* Implemented first draft of visual design editor with the following capabilities
8+
* highlighting and dragging blocks and containers, toggling highlighting on/off
9+
* switching to arbitrary theme and skin
10+
* navigating to arbitrary page types (product view, order success page, etc...), so that they would be editable with visual design editor
11+
* Refactored various places across the system in order to accommodate transition to containers, page types and visual design editor, which includes
12+
* Output in any frontend controller action using layout only
13+
* Output in any frontend controller specifies one and only one layout handle, which equals to its full action name. There can be other handles that extend it and they are determined by layout loading parameters, provided by controller.
14+
* No program termination (exit) on logging in admin user
15+
* Session cookie lifetime is set to 0 for frontend and backend. Session will exist until browser window is open, however backend session lifetime limitation does not depend on cookie lifetime anymore.
16+
* Fixes:
17+
* Failures of tests in developer mode
18+
* `app/etc/local.xml` affected integration tests
19+
* Addressed pull requests and issues from Github
20+
* Fetched updates from Magento 1 up to March 2 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details.
21+
22+
Update as of 2/29/2012
23+
======================
24+
25+
* Added jQuery to Magento 2. It has not been made a main library yet, however all new features are developed using jQuery.
26+
* Added support for new versions of testing tools - PHPUnit 3.6, PHPMD 1.3.0. Confirmed compatibility with latest PHPCS 1.3.2 and PHPCPD 1.3.5.
27+
* Improved legacy tests:
28+
* Refactored Integrity_ClassesTest and Legacy_ClassesTest.
29+
* Implemented a tool for migrating factory names from 1.x to 2.x. The tool scans PHP-code and replaces the most "popular" cases.
30+
* Added tests for `//model` in config.xml files and `//*[@module]` in all xml files.
31+
* Implemented a test that verifies the absence of relocated directories.
32+
* Added a test against the obsolete Varien_Profiler.
33+
* Bug fixes:
34+
* Fixed docblock for Mage_Core_Model_Design_Package.
35+
* Fixed static code analysis failures related to case-sensitivity.
36+
* Fixed several typos and minor mistakes.
37+
* Fixed integration test's failures due to specifics of xpath library version.
38+
* Imported fresh features and bug fixes from Magento 1.x.
39+
40+
Additional Tests and Fixes
41+
==========================
42+
43+
* Various code integrity fixes in different places:
44+
* Fixed obsolete references to classes
45+
* Fixed broken references to template and static view files
46+
* Fixed some minor occurrences of deprecated code
47+
* Code style minor fixes
48+
* Various minor bugfixes
49+
* Implemented "developer mode" in integration tests
50+
* Added "rollback" scripts capability for data fixtures
51+
* Removed deprecated methods and attributes from product type class
52+
* Restructured code integrity tests:
53+
* Moved out part of the tests from integration into static tests
54+
* Introduced "Legacy" test suite in static tests. This test suite is not executed by default when running either phpunit directly or using the "batch tool"
55+
* Simplified and reorganized the "Exemplar" and self-assessment tests for static code analysis
56+
* Covered previously made backwards-incompatible changes with legacy tests
57+
* Changed storage of class map from a PHP-file with array into a better-performing text file with serialized array.
58+
* Published dev/tests/static and dev/tests/unit

app/Mage.php

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

102+
/**
103+
* Magento edition constants
104+
*/
105+
const EDITION_COMMUNITY = 'Community';
106+
const EDITION_ENTERPRISE = 'Enterprise';
107+
const EDITION_PROFESSIONAL = 'Professional';
108+
const EDITION_GO = 'Go';
109+
110+
/**
111+
* Current Magento edition.
112+
*
113+
* @var string
114+
* @static
115+
*/
116+
static private $_currentEdition = self::EDITION_COMMUNITY;
117+
102118
/**
103119
* Gets the current Magento version string
104120
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
@@ -130,6 +146,17 @@ public static function getVersionInfo()
130146
);
131147
}
132148

149+
/**
150+
* Get current Magento edition
151+
*
152+
* @static
153+
* @return string
154+
*/
155+
public static function getEdition()
156+
{
157+
return self::$_currentEdition;
158+
}
159+
133160
/**
134161
* Set all my static data to defaults
135162
*
@@ -555,8 +582,8 @@ public static function app($code = '', $type = 'store', $options = array())
555582
self::$_app = new Mage_Core_Model_App();
556583
self::setRoot();
557584
self::$_events = new Varien_Event_Collection();
558-
self::setIsInstalled($options);
559-
self::setConfigModel($options);
585+
self::_setIsInstalled($options);
586+
self::_setConfigModel($options);
560587

561588
Magento_Profiler::start('self::app::init');
562589
self::$_app->init($code, $type, $options);
@@ -578,8 +605,8 @@ public static function init($code = '', $type = 'store', $options = array(), $mo
578605
try {
579606
self::setRoot();
580607
self::$_app = new Mage_Core_Model_App();
581-
self::setIsInstalled($options);
582-
self::setConfigModel($options);
608+
self::_setIsInstalled($options);
609+
self::_setConfigModel($options);
583610

584611
if (!empty($modules)) {
585612
self::$_app->initSpecified($code, $type, $options, $modules);
@@ -610,6 +637,9 @@ public static function run($code = '', $type = 'store', $options = array())
610637
try {
611638
Magento_Profiler::start('mage');
612639
self::setRoot();
640+
if (isset($options['edition'])) {
641+
self::$_currentEdition = $options['edition'];
642+
}
613643
self::$_app = new Mage_Core_Model_App();
614644
if (isset($options['request'])) {
615645
self::$_app->setRequest($options['request']);
@@ -618,8 +648,8 @@ public static function run($code = '', $type = 'store', $options = array())
618648
self::$_app->setResponse($options['response']);
619649
}
620650
self::$_events = new Varien_Event_Collection();
621-
self::setIsInstalled($options);
622-
self::setConfigModel($options);
651+
self::_setIsInstalled($options);
652+
self::_setConfigModel($options);
623653
self::$_app->run(array(
624654
'scope_code' => $code,
625655
'scope_type' => $type,
@@ -655,7 +685,7 @@ public static function run($code = '', $type = 'store', $options = array())
655685
*
656686
* @param array $options
657687
*/
658-
public static function setIsInstalled($options = array())
688+
protected static function _setIsInstalled($options = array())
659689
{
660690
if (isset($options['is_installed']) && $options['is_installed']) {
661691
self::$_isInstalled = true;
@@ -667,7 +697,7 @@ public static function setIsInstalled($options = array())
667697
*
668698
* @param array $options
669699
*/
670-
public static function setConfigModel($options = array())
700+
protected static function _setConfigModel($options = array())
671701
{
672702
if (isset($options['config_model']) && Magento_Autoload::getInstance()->classExists($options['config_model'])) {
673703
$alternativeConfigModelName = $options['config_model'];

app/bootstrap.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,15 @@
8989
Magento_Autoload::getInstance()->addFilesMap($classMapPath);
9090
}
9191

92-
#Magento_Profiler::enable();
93-
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
94-
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
95-
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/var/log/profiler.csv'));
92+
if (isset($_SERVER['MAGE_PROFILER'])) {
93+
switch ($_SERVER['MAGE_PROFILER']) {
94+
case 'firebug':
95+
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
96+
break;
97+
case 'csv':
98+
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/../var/log/profiler.csv'));
99+
break;
100+
default:
101+
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
102+
}
103+
}

app/code/community/Phoenix/Moneybookers/Block/Redirect.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@
2626
class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template
2727
{
2828
/**
29-
* Constructor. Set template.
29+
* Preparing global layout
30+
*
31+
* You can redefine this method in child classes for changing layout
32+
*
33+
* @return Mage_Core_Block_Abstract
3034
*/
31-
protected function _construct()
35+
protected function _prepareLayout()
3236
{
33-
parent::_construct();
34-
$this->setTemplate('redirect.phtml');
37+
$this->setRedirectUrl(Mage::registry(Phoenix_Moneybookers_ProcessingController::REGISTRY_REDIRECT_URL_KEY));
38+
return parent::_prepareLayout();
3539
}
3640
}

app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
*/
2626
class Phoenix_Moneybookers_ProcessingController extends Mage_Core_Controller_Front_Action
2727
{
28+
/**
29+
* Register key name for redirect url
30+
*
31+
* @const string
32+
*/
33+
const REGISTRY_REDIRECT_URL_KEY = 'phoenix_moneybookers_redirect_url';
34+
2835
/**
2936
* Get singleton of Checkout Session Model
3037
*
@@ -141,12 +148,8 @@ public function statusAction()
141148
*/
142149
protected function _redirect($path, $arguments=array())
143150
{
144-
$this->getResponse()->setBody(
145-
$this->getLayout()
146-
->createBlock('Phoenix_Moneybookers_Block_Redirect')
147-
->setRedirectUrl(Mage::getUrl($path, $arguments))
148-
->toHtml()
149-
);
151+
Mage::register(self::REGISTRY_REDIRECT_URL_KEY, Mage::getUrl($path, $arguments));
152+
$this->loadLayout('moneybookers_processing_redirect')->renderLayout();
150153
return $this;
151154
}
152155
}

app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
2828
-->
2929
<layout version="0.1.0">
30-
<moneybookers_processing_payment>
30+
<moneybookers_processing_payment translate="label" type="page" parent="checkout_onepage_paymentmethod">
31+
<label>Moneybookers Payment</label>
3132
<reference name="root">
3233
<action method="setTemplate"><template>1column.phtml</template></action>
3334
</reference>
@@ -36,12 +37,18 @@
3637
</reference>
3738
</moneybookers_processing_payment>
3839

39-
<moneybookers_processing_placeform>
40+
<moneybookers_processing_placeform translate="label" type="page" parent="moneybookers_processing_payment">
41+
<label>Moneybookers Place Form</label>
4042
<reference name="root">
4143
<action method="setTemplate"><template>Phoenix_Moneybookers::blank.phtml</template></action>
4244
</reference>
4345
<reference name="content">
4446
<block type="Phoenix_Moneybookers_Block_Placeform" name="moneybookers_placeform" template="placeform.phtml" />
4547
</reference>
4648
</moneybookers_processing_placeform>
49+
50+
<moneybookers_processing_redirect translate="label" type="page" parent="moneybookers_processing_payment">
51+
<label>Moneybookers Redirect</label>
52+
<block type="Phoenix_Moneybookers_Block_Redirect" output="1" name="moneybookers_placeform" template="redirect.phtml"/>
53+
</moneybookers_processing_redirect>
4754
</layout>

app/code/core/Mage/Admin/Model/Observer.php

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)