Skip to content

Commit

Permalink
Merge remote-tracking branch 'main-ce/develop' into MAGETWO-42366
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Kovsher committed Sep 7, 2015
2 parents 490825d + d2d9293 commit fe5a140
Show file tree
Hide file tree
Showing 376 changed files with 19,643 additions and 3,338 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-admin-notification",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-backend": "1.0.0-beta",
"magento/module-media-storage": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedPricingImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-advanced-pricing-import-export",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-catalog": "1.0.0-beta",
"magento/module-catalog-inventory": "1.0.0-beta",
"magento/module-eav": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-authorization",
"description": "Authorization module provides access to Magento ACL functionality.",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-backend": "1.0.0-beta",
"magento/framework": "1.0.0-beta",
"magento/magento-composer-installer": "*"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorizenet/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-authorizenet",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-sales": "1.0.0-beta",
"magento/module-store": "1.0.0-beta",
"magento/module-quote": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-backend",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-directory": "1.0.0-beta",
"magento/module-developer": "1.0.0-beta",
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/Backup/Model/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
return $this;
}

/**
* Get database backup size
*
* @return int
*/
public function getDBBackupSize()
{
$tables = $this->getResource()->getTables();
$ignoreDataTablesList = $this->getIgnoreDataTablesList();
$size = 0;
foreach ($tables as $table) {
$tableStatus = $this->getResource()->getTableStatus($table);
if ($tableStatus->getRows() && !in_array($table, $ignoreDataTablesList)) {
$size += $tableStatus->getDataLength() + $tableStatus->getIndexLength();
}
}
return $size;
}

/**
* Returns the list of tables which data should not be backed up
*
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-backup",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-backend": "1.0.0-beta",
"magento/module-cron": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Braintree/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-braintree",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-config": "1.0.0-beta",
"magento/module-store": "1.0.0-beta",
"magento/module-checkout": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-bundle",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-catalog": "1.0.0-beta",
"magento/module-tax": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/BundleImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-bundle-import-export",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-catalog": "1.0.0-beta",
"magento/module-import-export": "1.0.0-beta",
"magento/module-catalog-import-export": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CacheInvalidate/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-cache-invalidate",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-page-cache": "1.0.0-beta",
"magento/framework": "1.0.0-beta",
"magento/magento-composer-installer": "*"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-captcha",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-customer": "1.0.0-beta",
"magento/module-checkout": "1.0.0-beta",
Expand Down
57 changes: 54 additions & 3 deletions app/code/Magento/Catalog/Block/Product/View/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
class Gallery extends \Magento\Catalog\Block\Product\View\AbstractView
{
/**
* Retrieve list of gallery images
* @var \Magento\Framework\Config\View
*/
protected $configView;

/**
* Retrieve collection of gallery images
*
* @return array|Collection
* @return Collection
*/
public function getGalleryImages()
{
$product = $this->getProduct();
$images = $product->getMediaGalleryImages();
if ($images instanceof \Magento\Framework\Data\Collection) {
foreach ($images as &$image) {
/* @var \Magento\Framework\DataObject $image */
$image->setData(
'small_image_url',
$this->_imageHelper->init($product, 'product_page_image_small')
Expand All @@ -47,9 +51,31 @@ public function getGalleryImages()
);
}
}

return $images;
}

/**
* Retrieve product images in JSON format
*
* @return string
*/
public function getGalleryImagesJson()
{
$imagesItems = [];
foreach ($this->getGalleryImages() as $image) {
$imagesItems[] = [
'thumb' => $image->getData('small_image_url'),
'img' => $image->getData('medium_image_url'),
'original' => $image->getData('large_image_url'),
'caption' => $image->getLabel(),
'position' => $image->getPosition(),
'isMain' => $this->isMainImage($image),
];
}
return json_encode($imagesItems);
}

/**
* Retrieve gallery url
*
Expand All @@ -76,4 +102,29 @@ public function isMainImage($image)
$product = $this->getProduct();
return $product->getImage() == $image->getFile();
}

/**
* @param string $imageId
* @param string $attributeName
* @param string $default
* @return string
*/
public function getImageAttribute($imageId, $attributeName, $default = null)
{
$attributes = $this->getConfigView()->getImageAttributes('Magento_Catalog', $imageId);
return isset($attributes[$attributeName]) ? $attributes[$attributeName] : $default;
}

/**
* Retrieve config view
*
* @return \Magento\Framework\Config\View
*/
private function getConfigView()
{
if (!$this->configView) {
$this->configView = $this->_viewConfig->getViewConfig();
}
return $this->configView;
}
}
6 changes: 0 additions & 6 deletions app/code/Magento/Catalog/Model/Product/Image/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ protected function processImageData(Product $product, array $imageData, $file)
$this->imageHelper->backgroundColor($imageData['background']);
}

$width = isset($imageData['width']) ? $imageData['width'] : null;
$height = isset($imageData['height']) ? $imageData['height'] : null;
if ($width || $height) {
$this->imageHelper->resize($width, $height);
}

$this->imageHelper->save();

return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ public function testGenerate()
->with($data['product_image']['background'])
->willReturnSelf();

$this->imageHelper->expects($this->exactly(3))
->method('resize')
->will($this->returnValueMap([
[300, 300, $this->imageHelper],
[null, 200, $this->imageHelper],
[100, null, $this->imageHelper],
]));
$this->imageHelper->expects($this->exactly(3))
->method('save')
->will($this->returnSelf());
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-catalog",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0",
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-store": "1.0.0-beta",
"magento/module-eav": "1.0.0-beta",
"magento/module-cms": "1.0.0-beta",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<css src="mage/gallery.css"/>
<css src="mage/gallery/gallery.css"/>
</head>
<update handle="catalog_product_opengraph" />
<update handle="page_calendar"/>
Expand Down Expand Up @@ -98,7 +98,7 @@
</block>
</container>
<container name="product.info.media" htmlTag="div" htmlClass="product media" after="product.info.main">
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/base-image.phtml"/>
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/gallery.phtml"/>
</container>
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">
Expand Down
Loading

0 comments on commit fe5a140

Please sign in to comment.