Skip to content

Commit

Permalink
Merge branch 'magento-1.7-beta' into magento-1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Apr 24, 2012
2 parents ce07759 + 3254aef commit 7652d08
Show file tree
Hide file tree
Showing 7,193 changed files with 167,358 additions and 54,738 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 23 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,35 @@

#RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

# RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment

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]

############################################
## redirect for mobile user agents

#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

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

Expand Down
2,069 changes: 2,069 additions & 0 deletions RELEASE_NOTES.txt

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Api2
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

if (version_compare(phpversion(), '5.2.0', '<')) {
echo 'It looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer';
exit;
}
error_reporting(E_ALL | E_STRICT);

$mageFilename = getcwd() . '/app/Mage.php';

if (!file_exists($mageFilename)) {
echo 'Mage file not found';
exit;
}
require $mageFilename;

if (!Mage::isInstalled()) {
echo 'Application is not installed yet, please complete install wizard first.';
exit;
}

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

// emulate index.php entry point for correct URLs generation in API
Mage::register('custom_entry_point', true);
Mage::$headersSentThrowsException = false;
Mage::init('admin');
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_ADMINHTML, Mage_Core_Model_App_Area::PART_EVENTS);

// query parameter "type" is set by .htaccess rewrite rule
$apiAlias = Mage::app()->getRequest()->getParam('type');

// check request could be processed by API2
if (in_array($apiAlias, Mage_Api2_Model_Server::getApiTypes())) {
/** @var $server Mage_Api2_Model_Server */
$server = Mage::getSingleton('api2/server');

$server->run();
} else {
/* @var $server Mage_Api_Model_Server */
$server = Mage::getSingleton('api/server');
$adapterCode = $server->getAdapterCodeByAlias($apiAlias);

// if no adapters found in aliases - find it by default, by code
if (null === $adapterCode) {
$adapterCode = $apiAlias;
}
try {
$server->initialize($adapterCode);
$server->run();

Mage::app()->getResponse()->sendResponse();
} catch (Exception $e) {
Mage::logException($e);

echo $e->getMessage();
exit;
}
}
105 changes: 91 additions & 14 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
if (defined('COMPILER_INCLUDE_PATH')) {
$appPath = COMPILER_INCLUDE_PATH;
set_include_path($appPath . PS . Mage::registry('original_include_path'));
include_once "Mage_Core_functions.php";
include_once "Varien_Autoload.php";
include_once COMPILER_INCLUDE_PATH . DS . "Mage_Core_functions.php";
include_once COMPILER_INCLUDE_PATH . DS . "Varien_Autoload.php";
} else {
/**
* Set include path
Expand Down Expand Up @@ -129,6 +129,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 All @@ -138,7 +154,8 @@ final class Mage
public static function getVersion()
{
$i = self::getVersionInfo();
return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "") . "-{$i['stability']}{$i['number']}", '.-');
return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
. "-{$i['stability']}{$i['number']}", '.-');
}

/**
Expand All @@ -151,27 +168,40 @@ public static function getVersionInfo()
{
return array(
'major' => '1',
'minor' => '6',
'revision' => '1',
'minor' => '7',
'revision' => '0',
'patch' => '0',
'stability' => '',
'number' => '',
);
}

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

/**
* Set all my static data to defaults
*
*/
public static function reset()
{
self::$_registry = array();
self::$_appRoot = null;
self::$_app = null;
self::$_config = null;
self::$_events = null;
self::$_objects = null;
self::$_isDownloader = false;
self::$_isDeveloperMode = false;
self::$_isInstalled = null;
// do not reset $headersSentThrowsException
}

Expand Down Expand Up @@ -343,6 +373,7 @@ public static function getStoreConfigFlag($path, $store = null)
* Get base URL path by type
*
* @param string $type
* @param null|bool $secure
* @return string
*/
public static function getBaseUrl($type = Mage_Core_Model_Store::URL_TYPE_LINK, $secure = null)
Expand Down Expand Up @@ -404,17 +435,16 @@ public static function addObserver($eventName, $callback, $data = array(), $obse
* Dispatch event
*
* Calls all observer callbacks registered for this event
* and multiobservers matching event name pattern
* and multiple observers matching event name pattern
*
* @param string $name
* @param array $args
* @param array $data
* @return Mage_Core_Model_App
*/
public static function dispatchEvent($name, array $data = array())
{
Varien_Profiler::start('DISPATCH EVENT:'.$name);
$result = self::app()->dispatchEvent($name, $data);
#$result = self::registry('events')->dispatch($name, $data);
Varien_Profiler::stop('DISPATCH EVENT:'.$name);
return $result;
}
Expand All @@ -424,8 +454,8 @@ public static function dispatchEvent($name, array $data = array())
*
* @link Mage_Core_Model_Config::getModelInstance
* @param string $modelClass
* @param array $arguments
* @return Mage_Core_Model_Abstract
* @param array|object $arguments
* @return Mage_Core_Model_Abstract|false
*/
public static function getModel($modelClass = '', $arguments = array())
{
Expand Down Expand Up @@ -519,7 +549,7 @@ public static function helper($name)
}

/**
* Retreive resource helper object
* Retrieve resource helper object
*
* @param string $moduleName
* @return Mage_Core_Model_Resource_Helper_Abstract
Expand Down Expand Up @@ -554,6 +584,7 @@ public static function exception($module = 'Mage_Core', $message = '', $code = 0
*
* @param string $message
* @param string $messageStorage
* @throws Mage_Core_Exception
*/
public static function throwException($message, $messageStorage = null)
{
Expand All @@ -577,7 +608,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::$_config = new Mage_Core_Model_Config($options);
self::_setIsInstalled($options);
self::_setConfigModel($options);

Varien_Profiler::start('self::app::init');
self::$_app->init($code, $type, $options);
Expand All @@ -599,7 +631,8 @@ public static function init($code = '', $type = 'store', $options = array(), $mo
try {
self::setRoot();
self::$_app = new Mage_Core_Model_App();
self::$_config = new Mage_Core_Model_Config();
self::_setIsInstalled($options);
self::_setConfigModel($options);

if (!empty($modules)) {
self::$_app->initSpecified($code, $type, $options, $modules);
Expand Down Expand Up @@ -630,9 +663,19 @@ public static function run($code = '', $type = 'store', $options = array())
try {
Varien_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']);
}
if (isset($options['response'])) {
self::$_app->setResponse($options['response']);
}
self::$_events = new Varien_Event_Collection();
self::$_config = new Mage_Core_Model_Config($options);
self::_setIsInstalled($options);
self::_setConfigModel($options);
self::$_app->run(array(
'scope_code' => $code,
'scope_type' => $type,
Expand Down Expand Up @@ -663,6 +706,40 @@ public static function run($code = '', $type = 'store', $options = array())
}
}

/**
* Set application isInstalled flag based on given options
*
* @param array $options
*/
protected static function _setIsInstalled($options = array())
{
if (isset($options['is_installed']) && $options['is_installed']) {
self::$_isInstalled = true;
}
}

/**
* Set application Config model
*
* @param array $options
*/
protected static function _setConfigModel($options = array())
{
if (isset($options['config_model']) && class_exists($options['config_model'])) {
$alternativeConfigModelName = $options['config_model'];
unset($options['config_model']);
$alternativeConfigModel = new $alternativeConfigModelName($options);
} else {
$alternativeConfigModel = null;
}

if (!is_null($alternativeConfigModel) && ($alternativeConfigModel instanceof Mage_Core_Model_Config)) {
self::$_config = $alternativeConfigModel;
} else {
self::$_config = new Mage_Core_Model_Config($options);
}
}

/**
* Retrieve application installation flag
*
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Phoenix/Moneybookers/Block/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Phoenix
* @package Phoenix_Moneybookers
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Phoenix_Moneybookers_Block_Form extends Mage_Payment_Block_Form
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Phoenix/Moneybookers/Block/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Phoenix
* @package Phoenix_Moneybookers
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Phoenix_Moneybookers_Block_Info extends Mage_Payment_Block_Info
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Phoenix/Moneybookers/Block/Jsinit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Phoenix
* @package Phoenix_Moneybookers
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Phoenix/Moneybookers/Block/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Phoenix
* @package Phoenix_Moneybookers
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Phoenix_Moneybookers_Block_Payment extends Mage_Core_Block_Template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Phoenix
* @package Phoenix_Moneybookers
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Phoenix_Moneybookers_Block_Placeform extends Mage_Core_Block_Template
Expand Down
Loading

0 comments on commit 7652d08

Please sign in to comment.