Skip to content

Commit

Permalink
Update as of 3/26/2012
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
magento-team committed Mar 26, 2012
1 parent 9de2223 commit 6194a7a
Show file tree
Hide file tree
Showing 1,012 changed files with 46,883 additions and 13,375 deletions.
6 changes: 6 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@

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

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

############################################
## always send 404 on missing files in these folders

Expand Down
58 changes: 58 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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.

Update as of 2/29/2012
======================

* Added jQuery to Magento 2. It has not been made a main library yet, however all new features are developed using jQuery.
* 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.
* Improved legacy tests:
* Refactored Integrity_ClassesTest and Legacy_ClassesTest.
* Implemented a tool for migrating factory names from 1.x to 2.x. The tool scans PHP-code and replaces the most "popular" cases.
* Added tests for `//model` in config.xml files and `//*[@module]` in all xml files.
* Implemented a test that verifies the absence of relocated directories.
* Added a test against the obsolete Varien_Profiler.
* Bug fixes:
* Fixed docblock for Mage_Core_Model_Design_Package.
* Fixed static code analysis failures related to case-sensitivity.
* Fixed several typos and minor mistakes.
* Fixed integration test's failures due to specifics of xpath library version.
* Imported fresh features and bug fixes from Magento 1.x.

Additional Tests and Fixes
==========================

* Various code integrity fixes in different places:
* Fixed obsolete references to classes
* Fixed broken references to template and static view files
* Fixed some minor occurrences of deprecated code
* Code style minor fixes
* Various minor bugfixes
* Implemented "developer mode" in integration tests
* Added "rollback" scripts capability for data fixtures
* Removed deprecated methods and attributes from product type class
* Restructured code integrity tests:
* Moved out part of the tests from integration into static tests
* 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"
* Simplified and reorganized the "Exemplar" and self-assessment tests for static code analysis
* Covered previously made backwards-incompatible changes with legacy tests
* Changed storage of class map from a PHP-file with array into a better-performing text file with serialized array.
* Published dev/tests/static and dev/tests/unit
46 changes: 38 additions & 8 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ final class Mage
*/
static private $_isInstalled;

/**
* Magento edition constants
*/
const EDITION_COMMUNITY = 'Community';
const EDITION_ENTERPRISE = 'Enterprise';
const EDITION_PROFESSIONAL = 'Professional';
const EDITION_GO = 'Go';

/**
* Current Magento edition.
*
* @var string
* @static
*/
static private $_currentEdition = self::EDITION_COMMUNITY;

/**
* Gets the current Magento version string
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
Expand Down Expand Up @@ -130,6 +146,17 @@ public static function getVersionInfo()
);
}

/**
* Get current Magento edition
*
* @static
* @return string
*/
public static function getEdition()
{
return self::$_currentEdition;
}

/**
* Set all my static data to defaults
*
Expand Down Expand Up @@ -555,8 +582,8 @@ public static function app($code = '', $type = 'store', $options = array())
self::$_app = new Mage_Core_Model_App();
self::setRoot();
self::$_events = new Varien_Event_Collection();
self::setIsInstalled($options);
self::setConfigModel($options);
self::_setIsInstalled($options);
self::_setConfigModel($options);

Magento_Profiler::start('self::app::init');
self::$_app->init($code, $type, $options);
Expand All @@ -578,8 +605,8 @@ public static function init($code = '', $type = 'store', $options = array(), $mo
try {
self::setRoot();
self::$_app = new Mage_Core_Model_App();
self::setIsInstalled($options);
self::setConfigModel($options);
self::_setIsInstalled($options);
self::_setConfigModel($options);

if (!empty($modules)) {
self::$_app->initSpecified($code, $type, $options, $modules);
Expand Down Expand Up @@ -610,6 +637,9 @@ public static function run($code = '', $type = 'store', $options = array())
try {
Magento_Profiler::start('mage');
self::setRoot();
if (isset($options['edition'])) {
self::$_currentEdition = $options['edition'];
}
self::$_app = new Mage_Core_Model_App();
if (isset($options['request'])) {
self::$_app->setRequest($options['request']);
Expand All @@ -618,8 +648,8 @@ public static function run($code = '', $type = 'store', $options = array())
self::$_app->setResponse($options['response']);
}
self::$_events = new Varien_Event_Collection();
self::setIsInstalled($options);
self::setConfigModel($options);
self::_setIsInstalled($options);
self::_setConfigModel($options);
self::$_app->run(array(
'scope_code' => $code,
'scope_type' => $type,
Expand Down Expand Up @@ -655,7 +685,7 @@ public static function run($code = '', $type = 'store', $options = array())
*
* @param array $options
*/
public static function setIsInstalled($options = array())
protected static function _setIsInstalled($options = array())
{
if (isset($options['is_installed']) && $options['is_installed']) {
self::$_isInstalled = true;
Expand All @@ -667,7 +697,7 @@ public static function setIsInstalled($options = array())
*
* @param array $options
*/
public static function setConfigModel($options = array())
protected static function _setConfigModel($options = array())
{
if (isset($options['config_model']) && Magento_Autoload::getInstance()->classExists($options['config_model'])) {
$alternativeConfigModelName = $options['config_model'];
Expand Down
16 changes: 12 additions & 4 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@
Magento_Autoload::getInstance()->addFilesMap($classMapPath);
}

#Magento_Profiler::enable();
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
#Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/var/log/profiler.csv'));
if (isset($_SERVER['MAGE_PROFILER'])) {
switch ($_SERVER['MAGE_PROFILER']) {
case 'firebug':
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Firebug());
break;
case 'csv':
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Csvfile(__DIR__ . '/../var/log/profiler.csv'));
break;
default:
Magento_Profiler::registerOutput(new Magento_Profiler_Output_Html());
}
}
12 changes: 8 additions & 4 deletions app/code/community/Phoenix/Moneybookers/Block/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template
{
/**
* Constructor. Set template.
* Preparing global layout
*
* You can redefine this method in child classes for changing layout
*
* @return Mage_Core_Block_Abstract
*/
protected function _construct()
protected function _prepareLayout()
{
parent::_construct();
$this->setTemplate('redirect.phtml');
$this->setRedirectUrl(Mage::registry(Phoenix_Moneybookers_ProcessingController::REGISTRY_REDIRECT_URL_KEY));
return parent::_prepareLayout();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
*/
class Phoenix_Moneybookers_ProcessingController extends Mage_Core_Controller_Front_Action
{
/**
* Register key name for redirect url
*
* @const string
*/
const REGISTRY_REDIRECT_URL_KEY = 'phoenix_moneybookers_redirect_url';

/**
* Get singleton of Checkout Session Model
*
Expand Down Expand Up @@ -141,12 +148,8 @@ public function statusAction()
*/
protected function _redirect($path, $arguments=array())
{
$this->getResponse()->setBody(
$this->getLayout()
->createBlock('Phoenix_Moneybookers_Block_Redirect')
->setRedirectUrl(Mage::getUrl($path, $arguments))
->toHtml()
);
Mage::register(self::REGISTRY_REDIRECT_URL_KEY, Mage::getUrl($path, $arguments));
$this->loadLayout('moneybookers_processing_redirect')->renderLayout();
return $this;
}
}
11 changes: 9 additions & 2 deletions app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
-->
<layout version="0.1.0">
<moneybookers_processing_payment>
<moneybookers_processing_payment translate="label" type="page" parent="checkout_onepage_paymentmethod">
<label>Moneybookers Payment</label>
<reference name="root">
<action method="setTemplate"><template>1column.phtml</template></action>
</reference>
Expand All @@ -36,12 +37,18 @@
</reference>
</moneybookers_processing_payment>

<moneybookers_processing_placeform>
<moneybookers_processing_placeform translate="label" type="page" parent="moneybookers_processing_payment">
<label>Moneybookers Place Form</label>
<reference name="root">
<action method="setTemplate"><template>Phoenix_Moneybookers::blank.phtml</template></action>
</reference>
<reference name="content">
<block type="Phoenix_Moneybookers_Block_Placeform" name="moneybookers_placeform" template="placeform.phtml" />
</reference>
</moneybookers_processing_placeform>

<moneybookers_processing_redirect translate="label" type="page" parent="moneybookers_processing_payment">
<label>Moneybookers Redirect</label>
<block type="Phoenix_Moneybookers_Block_Redirect" output="1" name="moneybookers_placeform" template="redirect.phtml"/>
</moneybookers_processing_redirect>
</layout>
97 changes: 0 additions & 97 deletions app/code/core/Mage/Admin/Model/Observer.php

This file was deleted.

Loading

0 comments on commit 6194a7a

Please sign in to comment.