diff --git a/.phpstorm.meta.php/magento_models_methods.meta.php b/.phpstorm.meta.php/magento_models_methods.meta.php
index ed3e9584bea..fa6d33a1112 100644
--- a/.phpstorm.meta.php/magento_models_methods.meta.php
+++ b/.phpstorm.meta.php/magento_models_methods.meta.php
@@ -1807,7 +1807,6 @@
'install/installer_db_mysql4' => \Mage_Install_Model_Installer_Db_Mysql4::class,
'install/installer_env' => \Mage_Install_Model_Installer_Env::class,
'install/installer_filesystem' => \Mage_Install_Model_Installer_Filesystem::class,
- 'install/installer_pear' => \Mage_Install_Model_Installer_Pear::class,
'install/observer' => \Mage_Install_Model_Observer::class,
'install/session' => \Mage_Install_Model_Session::class,
'install/wizard' => \Mage_Install_Model_Wizard::class,
@@ -22421,4 +22420,4 @@
'moneybookers/wlt' => \Phoenix_Moneybookers_Model_Wlt::class,
])
);
-}
\ No newline at end of file
+}
diff --git a/app/code/core/Mage/Adminhtml/Model/Extension.php b/app/code/core/Mage/Adminhtml/Model/Extension.php
deleted file mode 100644
index 282dfc7b327..00000000000
--- a/app/code/core/Mage/Adminhtml/Model/Extension.php
+++ /dev/null
@@ -1,395 +0,0 @@
-setLocalExtensionPackageFormData($this->getData());
-
- Varien_Pear::$reloadOnRegistryUpdate = false;
- $pkg = new Varien_Pear_Package;
- #$pkg->getPear()->runHtmlConsole(array('command'=>'list-channels'));
- $pfm = $pkg->getPfm();
- $pfm->setOptions(array(
- 'packagedirectory'=>'.',
- 'baseinstalldir'=>'.',
- 'simpleoutput'=>true,
- ));
-
- $this->_setPackage($pfm);
- $this->_setRelease($pfm);
- $this->_setMaintainers($pfm);
- $this->_setDependencies($pfm);
- $this->_setContents($pfm);
-#echo "
".print_r($pfm,1)." ";
- if (!$pfm->validate(PEAR_VALIDATE_NORMAL)) {
- //echo "".print_r($this->getData(),1)." ";
- //echo "TEST:";
- //echo "".print_r($pfm->getValidationWarnings(), 1)." ";
- $message = $pfm->getValidationWarnings();
- //$message = $message[0]['message'];
- throw Mage::exception('Mage_Adminhtml', Mage::helper('adminhtml')->__($message[0]['message']));
-
- return $this;
- }
-
- $this->setPackageXml($pfm->getDefaultGenerator()->toXml(PEAR_VALIDATE_NORMAL));
- return $this;
- }
-
- protected function _setPackage($pfm)
- {
- $pfm->setPackageType('php');
- $pfm->setChannel($this->getData('channel'));
-
- $pfm->setLicense($this->getData('license'), $this->getData('license_uri'));
-
- $pfm->setPackage($this->getData('name'));
- $pfm->setSummary($this->getData('summary'));
- $pfm->setDescription($this->getData('description'));
- }
-
- protected function _setRelease($pfm)
- {
- $pfm->addRelease();
- $pfm->setDate(date('Y-m-d'));
-
- $pfm->setAPIVersion($this->getData('api_version'));
- $pfm->setReleaseVersion($this->getData('release_version'));
- $pfm->setAPIStability($this->getData('api_stability'));
- $pfm->setReleaseStability($this->getData('release_stability'));
- $pfm->setNotes($this->getData('notes'));
- }
-
- protected function _setMaintainers($pfm)
- {
- $maintainers = $this->getData('maintainers');
- foreach ($maintainers['role'] as $i=>$role) {
- if (0===$i) {
- continue;
- }
- $handle = $maintainers['handle'][$i];
- $name = $maintainers['name'][$i];
- $email = $maintainers['email'][$i];
- $active = !empty($maintainers['active'][$i]) ? 'yes' : 'no';
- $pfm->addMaintainer($role, $handle, $name, $email, $active);
- }
- }
-
- protected function _setDependencies($pfm)
- {
- $pfm->clearDeps();
- $exclude = $this->getData('depends_php_exclude')!=='' ? explode(',', $this->getData('depends_php_exclude')) : false;
- $pfm->setPhpDep($this->getData('depends_php_min'), $this->getData('depends_php_max'), $exclude);
- $pfm->setPearinstallerDep('1.6.2');
-
- foreach ($this->getData('depends') as $deptype=>$deps) {
- foreach ($deps['type'] as $i=>$type) {
- if (0===$i) {
- continue;
- }
- $name = $deps['name'][$i];
- $min = !empty($deps['min'][$i]) ? $deps['min'][$i] : false;
- $max = !empty($deps['max'][$i]) ? $deps['max'][$i] : false;
- $recommended = !empty($deps['recommended'][$i]) ? $deps['recommended'][$i] : false;
- $exclude = !empty($deps['exclude'][$i]) ? explode(',', $deps['exclude'][$i]) : false;
- if ($deptype!=='extension') {
- $channel = !empty($deps['channel'][$i]) ? $deps['channel'][$i] : 'connect.magentocommerce.com/core';
- }
- switch ($deptype) {
- case 'package':
- if ($type==='conflicts') {
- $pfm->addConflictingPackageDepWithChannel(
- $name, $channel, false, $min, $max, $recommended, $exclude);
- } else {
- $pfm->addPackageDepWithChannel(
- $type, $name, $channel, $min, $max, $recommended, $exclude);
- }
- break;
-
- case 'subpackage':
- if ($type==='conflicts') {
- Mage::throwException(Mage::helper('adminhtml')->__("Subpackage cannot be conflicting."));
- }
- $pfm->addSubpackageDepWithChannel(
- $type, $name, $channel, $min, $max, $recommended, $exclude);
- break;
-
- case 'extension':
- $pfm->addExtensionDep(
- $type, $name, $min, $max, $recommended, $exclude);
- break;
- }
- }
- }
- }
-
- protected function _setContents($pfm)
- {
- $baseDir = $this->getRoleDir('mage').DS;
-
- $pfm->clearContents();
- $contents = $this->getData('contents');
- $usesRoles = array();
- foreach ($contents['role'] as $i=>$role) {
- if (0===$i) {
- continue;
- }
-
- $usesRoles[$role] = 1;
-
- $roleDir = $this->getRoleDir($role).DS;
- $fullPath = $roleDir.$contents['path'][$i];
-
- switch ($contents['type'][$i]) {
- case 'file':
- if (!is_file($fullPath)) {
- Mage::throwException(Mage::helper('adminhtml')->__("Invalid file: %s", $fullPath));
- }
- $pfm->addFile('/', $contents['path'][$i], array('role'=>$role, 'md5sum'=>md5_file($fullPath)));
- break;
-
- case 'dir':
- if (!is_dir($fullPath)) {
- Mage::throwException(Mage::helper('adminhtml')->__("Invalid directory: %s", $fullPath));
- }
- $path = $contents['path'][$i];
- $include = $contents['include'][$i];
- $ignore = $contents['ignore'][$i];
- $this->_addDir($pfm, $role, $roleDir, $path, $include, $ignore);
- break;
- }
- }
-
- $pearRoles = $this->getRoles();
-#echo "".print_r($usesRoles,1)." ";
- foreach ($usesRoles as $role=>$dummy) {
- if (empty($pearRoles[$role]['package'])) {
- continue;
- }
- $pfm->addUsesrole($role, $pearRoles[$role]['package']);
- }
- }
-
- protected function _addDir($pfm, $role, $roleDir, $path, $include, $ignore)
- {
- $roleDirLen = strlen($roleDir);
- $entries = @glob($roleDir.$path.DS."*");
- if (!empty($entries)) {
- foreach ($entries as $entry) {
- $filePath = substr($entry, $roleDirLen);
- if (!empty($include) && !preg_match($include, $filePath)) {
- continue;
- }
- if (!empty($ignore) && preg_match($ignore, $filePath)) {
- continue;
- }
- if (is_dir($entry)) {
- $baseName = basename($entry);
- if ('.'===$baseName || '..'===$baseName) {
- continue;
- }
- $this->_addDir($pfm, $role, $roleDir, $filePath, $include, $ignore);
- } elseif (is_file($entry)) {
- $pfm->addFile('/', $filePath, array('role'=>$role, 'md5sum'=>md5_file($entry)));
- }
- }
- }
- }
-
- public function getRoles()
- {
- if (!$this->_roles) {
- $frontend = $this->getPear()->getFrontend();
- $config = $this->getPear()->getConfig();
- $pearMage = new PEAR_Command_Mage($frontend, $config);
- $this->_roles = $pearMage->getRoles();
- }
- return $this->_roles;
- }
-
- public function getRoleDir($role)
- {
- $roles = $this->getRoles();
- return Varien_Pear::getInstance()->getConfig()->get($roles[$role]['dir_config']);
- }
-
- public function getMaintainerRoles()
- {
- return array(
- 'lead'=>'Lead',
- 'developer'=>'Developer',
- 'contributor'=>'Contributor',
- 'helper'=>'Helper'
- );
- }
-
- public function savePackage()
- {
- if ($this->getData('file_name') != '') {
- $fileName = $this->getData('file_name');
- $this->unsetData('file_name');
- } else {
- $fileName = $this->getName();
- }
-
- if (!preg_match('/^[a-z0-9]+[a-z0-9\-\_\.]*([\/\\\\]{1}[a-z0-9]+[a-z0-9\-\_\.]*)*$/i', $fileName)) {
- return false;
- }
-
- if (!$this->getPackageXml()) {
- $this->generatePackageXml();
- }
- if (!$this->getPackageXml()) {
- return false;
- }
-
- $pear = Varien_Pear::getInstance();
- $dir = Mage::getBaseDir('var').DS.'pear';
- if (!@file_put_contents($dir.DS.'package.xml', $this->getPackageXml())) {
- return false;
- }
-
- $pkgver = $this->getName().'-'.$this->getReleaseVersion();
- $this->unsPackageXml();
- $this->unsRoles();
- $xml = Mage::helper('core')->assocToXml($this->getData());
- $xml = new Varien_Simplexml_Element($xml->asXML());
-
- // prepare dir to save
- $parts = explode(DS, $fileName);
- array_pop($parts);
- $newDir = implode(DS, $parts);
- if ((!empty($newDir)) && (!is_dir($dir . DS . $newDir))) {
- if (!@mkdir($dir . DS . $newDir, 0777, true)) {
- return false;
- }
- }
-
- if (!@file_put_contents($dir . DS . $fileName . '.xml', $xml->asNiceXml())) {
- return false;
- }
-
- return true;
- }
-
- public function createPackage()
- {
- $pear = Varien_Pear::getInstance();
- $dir = Mage::getBaseDir('var').DS.'pear';
- if (!Mage::getConfig()->createDirIfNotExists($dir)) {
- return false;
- }
- $curDir = getcwd();
- chdir($dir);
- $result = $pear->run('mage-package', array(), array('package.xml'));
- chdir($curDir);
- if ($result instanceof PEAR_Error) {
- return $result;
- }
- return true;
- }
-
-
- public function getStabilityOptions()
- {
- return array(
- 'devel'=>'Development',
- 'alpha'=>'Alpha',
- 'beta'=>'Beta',
- 'stable'=>'Stable',
- );
- }
-
- public function getKnownChannels()
- {
- /*
- $pear = Varien_Pear::getInstance();
- $pear->run('list-channels');
- $output = $pear->getOutput();
- $pear->getFrontend()->clear();
-
- $data = $output[0]['output']['data'];
- $arr = array();
- foreach ($data as $channel) {
- $arr[$channel[0]] = $channel[1].' ('.$channel[0].')';
- }
- */
- $arr = array(
- 'connect.magentocommerce.com/core' => 'Magento Core Team',
- 'connect.magentocommerce.com/community' => 'Magento Community',
- #'pear.php.net' => 'PEAR',
- #'pear.phpunit.de' => 'PHPUnit',
- );
- return $arr;
- }
-
- public function loadLocal($package, $options=array())
- {
- $pear = $this->getPear();
-
- $pear->getFrontend()->clear();
-
- $result = $pear->run('info', $options, array($package));
- if ($result instanceof PEAR_Error) {
- Mage::throwException($result->message);
- }
-
- $output = $pear->getOutput();
- $pkg = new PEAR_PackageFile_v2;
- $pkg->fromArray($output[0]['output']['raw']);
-
- return $pkg;
- }
-
- public function loadRemote($package, $options=array())
- {
- $pear = $this->getPear();
-
- $pear->getFrontend()->clear();
-
- $result = $pear->run('remote-info', $options, array($package));
- if ($result instanceof PEAR_Error) {
- Mage::throwException($result->message);
- }
-
- $output = $pear->getOutput();
- $this->setData($output[0]['output']);
-
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml
index c9255ab70b3..2b9ba41ccab 100644
--- a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml
+++ b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml
@@ -245,19 +245,6 @@
Cache Management
-
- Magento Connect
-
-
- Magento Connect Manager
- 0
-
-
- Package Extensions
- 5
-
-
-
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php
deleted file mode 100644
index 56a98f8796b..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
-{
- /**
- * Constructor
- *
- * Initializes edit form container, adds necessary buttons
- */
- public function __construct()
- {
- $this->_objectId = 'id';
- $this->_blockGroup = 'connect';
- $this->_controller = 'adminhtml_extension_custom';
-
- parent::__construct();
-
- $this->_removeButton('back');
- $this->_updateButton('reset', 'onclick', "resetPackage()");
-
- $this->_addButton('create', array(
- 'label' => Mage::helper('connect')->__('Save Data and Create Package'),
- 'class' => 'save',
- 'onclick' => "createPackage()",
- ));
- $this->_addButton('save_as', array(
- 'label' => Mage::helper('connect')->__('Save As...'),
- 'title' => Mage::helper('connect')->__('Save package with custom package file name'),
- 'onclick' => 'saveAsPackage()'
- ));
- }
-
- /**
- * Get header of page
- *
- * @return string
- */
- public function getHeaderText()
- {
- return Mage::helper('connect')->__('New Extension');
- }
-
- /*
- * Get form submit URL
- *
- * @return string
- */
- public function getFormActionUrl()
- {
- return $this->getUrl('*/*/save');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php
deleted file mode 100644
index f617e94a14b..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
-{
- /**
- * Prepare Extension Package Form
- *
- * @return $this
- */
- protected function _prepareForm()
- {
- $form = new Varien_Data_Form(array(
- 'id' => 'edit_form',
- 'action' => $this->getData('action'),
- 'method' => 'post'
- ));
-
- $form->setUseContainer(true);
- $this->setForm($form);
-
- return parent::_prepareForm();
- }
-
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php
deleted file mode 100644
index c1f860281d8..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php
+++ /dev/null
@@ -1,173 +0,0 @@
-
- */
-abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
- extends Mage_Adminhtml_Block_Widget_Form
- implements Mage_Adminhtml_Block_Widget_Tab_Interface
-{
- /**
- * TODO
- */
- protected $_addRowButtonHtml;
-
- /**
- * TODO
- */
- protected $_removeRowButtonHtml;
-
- /**
- * TODO
- */
- protected $_addFileDepButtonHtml;
-
- /**
- * TODO
- */
- public function __construct()
- {
- parent::__construct();
- $this->setData(Mage::getSingleton('connect/session')->getCustomExtensionPackageFormData());
- }
-
- /**
- * TODO remove ???
- */
- public function initForm()
- {
- return $this;
- }
-
- /**
- * TODO
- */
- public function getValue($key, $default='')
- {
- $value = $this->getData($key);
- return htmlspecialchars($value ? $value : $default);
- }
-
- /**
- * TODO
- */
- public function getSelected($key, $value)
- {
- return $this->getData($key)==$value ? 'selected="selected"' : '';
- }
-
- /**
- * TODO
- */
- public function getChecked($key)
- {
- return $this->getData($key) ? 'checked="checked"' : '';
- }
-
- /**
- * TODO
- */
- public function getAddRowButtonHtml($container, $template, $title='Add')
- {
- if (!isset($this->_addRowButtonHtml[$container])) {
- $this->_addRowButtonHtml[$container] = $this->getLayout()
- ->createBlock('adminhtml/widget_button')
- ->setType('button')
- ->setClass('add')
- ->setLabel($this->__($title))
- ->setOnClick("addRow('".$container."', '".$template."')")
- ->toHtml();
- }
- return $this->_addRowButtonHtml[$container];
- }
-
- /**
- * TODO
- */
- public function getRemoveRowButtonHtml($selector='span')
- {
- if (!$this->_removeRowButtonHtml) {
- $this->_removeRowButtonHtml = $this->getLayout()
- ->createBlock('adminhtml/widget_button')
- ->setType('button')
- ->setClass('delete')
- ->setLabel($this->__('Remove'))
- ->setOnClick("removeRow(this, '".$selector."')")
- ->toHtml();
- }
- return $this->_removeRowButtonHtml;
- }
-
- public function getAddFileDepsRowButtonHtml($selector='span', $filesClass='files')
- {
- if (!$this->_addFileDepButtonHtml) {
- $this->_addFileDepButtonHtml = $this->getLayout()
- ->createBlock('adminhtml/widget_button')
- ->setType('button')
- ->setClass('add')
- ->setLabel($this->__('Add files'))
- ->setOnClick("showHideFiles(this, '".$selector."', '".$filesClass."')")
- ->toHtml();
- }
- return $this->_addFileDepButtonHtml;
-
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return '';
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return '';
- }
-
- public function canShowTab()
- {
- return true;
- }
-
- public function isHidden()
- {
- return false;
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php
deleted file mode 100644
index 082fe5b9f83..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Authors
- extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
-{
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Authors');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Authors');
- }
-
- /**
- * Return add author button html
- *
- * @return string
- */
- public function getAddAuthorButtonHtml()
- {
- return $this->getLayout()->createBlock('adminhtml/widget_button')
- ->setType('button')
- ->setClass('add')
- ->setLabel($this->__('Add Author'))
- ->setOnClick('addAuthor()')
- ->toHtml();
- }
-
- /**
- * Return array of authors
- *
- * @return array
- */
- public function getAuthors()
- {
- $authors = array();
- if ($this->getData('authors')) {
- $temp = array();
- foreach ($this->getData('authors') as $param => $values) {
- if (is_array($values)) {
- foreach ($values as $key => $value) {
- $temp[$key][$param] =$value;
- }
- }
- }
- foreach ($temp as $key => $value) {
- $authors[$key] = Mage::helper('core')->jsonEncode($value);
- }
- }
- return $authors;
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php
deleted file mode 100644
index f1038f8d009..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php
+++ /dev/null
@@ -1,70 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Contents
- extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
-{
- /**
- * Retrieve list of targets
- *
- * @return array
- */
- public function getMageTargets()
- {
- $targets = Mage::getModel('connect/extension')->getLabelTargets();
- if (!is_array($targets)) {
- $targets = array();
- }
- return $targets;
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Contents');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Contents');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php
deleted file mode 100644
index 9f2589c59cf..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php
+++ /dev/null
@@ -1,108 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Depends
- extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
-{
-
- /**
- * Prepare Dependencies Form before rendering HTML
- *
- * @return Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Package
- */
- protected function _prepareForm()
- {
- parent::_prepareForm();
-
- $form = new Varien_Data_Form();
- $form->setHtmlIdPrefix('_depends');
-
- $fieldset = $form->addFieldset('depends_php_fieldset', array(
- 'legend' => Mage::helper('connect')->__('PHP Version')
- ));
-
- $fieldset->addField('depends_php_min', 'text', array(
- 'name' => 'depends_php_min',
- 'label' => Mage::helper('connect')->__('Minimum'),
- 'required' => true,
- 'value' => '5.2.0',
- ));
-
- $fieldset->addField('depends_php_max', 'text', array(
- 'name' => 'depends_php_max',
- 'label' => Mage::helper('connect')->__('Maximum'),
- 'required' => true,
- 'value' => '5.2.20',
- ));
-
- $form->setValues($this->getData());
- $this->setForm($form);
-
- return $this;
- }
-
- /**
- * Retrieve list of loaded PHP extensions
- *
- * @return array
- */
- public function getExtensions()
- {
- $extensions = array();
- foreach (get_loaded_extensions() as $ext) {
- $extensions[$ext] = $ext;
- }
- asort($extensions, SORT_STRING);
- return $extensions;
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Dependencies');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Dependencies');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php
deleted file mode 100644
index f4c68d9c479..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Grid extends Mage_Adminhtml_Block_Widget_Grid
-{
- /**
- * Initialize Grid block
- *
- */
- public function __construct()
- {
- parent::__construct();
- $this->_defaultLimit = 200;
- $this->setId('extension_custom_edit_grid');
- $this->setUseAjax(true);
- }
-
- /**
- * Creates extension collection if it has not been created yet
- *
- * @return Mage_Connect_Model_Extension_Collection
- */
- public function getCollection()
- {
- if (!$this->_collection) {
- $this->_collection = Mage::getModel('connect/extension_collection');
- }
- return $this->_collection;
- }
-
- /**
- * Prepare Local Package Collection for Grid
- *
- * @return $this
- */
- protected function _prepareCollection()
- {
- $this->setCollection($this->getCollection());
- return parent::_prepareCollection();
- }
-
- /**
- * Prepare grid columns
- *
- * @return Mage_Adminhtml_Block_Extension_Custom_Edit_Tab_Grid
- */
- protected function _prepareColumns()
- {
- $this->addColumn('folder', array(
- 'header' => Mage::helper('connect')->__('Folder'),
- 'index' => 'folder',
- 'width' => 100,
- 'type' => 'options',
- 'options' => $this->getCollection()->collectFolders()
- ));
-
- $this->addColumn('package', array(
- 'header' => Mage::helper('connect')->__('Package'),
- 'index' => 'package',
- ));
-
- return parent::_prepareColumns();
- }
-
- /**
- * Self URL getter
- *
- * @return string
- */
- public function getCurrentUrl($params = array())
- {
- if (!isset($params['_current'])) {
- $params['_current'] = true;
- }
- return $this->getUrl('*/*/grid', $params);
- }
-
- /**
- * Row URL getter
- *
- * @return string
- */
- public function getRowUrl($row)
- {
- return $this->getUrl('*/*/load', array('id' => strtr(base64_encode($row->getFilenameId()), '+/=', '-_,')));
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php
deleted file mode 100644
index 76324ecaf3f..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Load
- extends Mage_Adminhtml_Block_Template
-{
- /**
- * Retrieve Grid Block HTML
- *
- * @return string
- */
- public function getPackageGridHtml()
- {
- return $this->getChildHtml('local_package_grid');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php
deleted file mode 100644
index c8c67b8744e..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Local
- extends Mage_Adminhtml_Block_Abstract
- implements Mage_Adminhtml_Block_Widget_Tab_Interface
-{
- /**
- * Retrieve Tab load URL
- *
- * @return string
- */
- public function getTabUrl()
- {
- return $this->getUrl('*/*/loadtab', array('_current' => true));
- }
-
- /**
- * Retrieve class for load by ajax
- *
- * @return string
- */
- public function getTabClass()
- {
- return 'ajax';
- }
-
- /**
- * Retrieve class for load by ajax
- *
- * @return string
- */
- public function getClass()
- {
- return 'ajax';
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Load Local Package');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Load Local Package');
- }
-
- /**
- * Is can show tab
- *
- * @return bool
- */
- public function canShowTab()
- {
- return true;
- }
-
- /**
- * Is hidden tab
- *
- * @return bool
- */
- public function isHidden()
- {
- return false;
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php
deleted file mode 100644
index 80bb10a515a..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php
+++ /dev/null
@@ -1,148 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Package
- extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
-{
- /**
- * Prepare Package Info Form before rendering HTML
- *
- * @return $this
- */
- protected function _prepareForm()
- {
- parent::_prepareForm();
-
- $form = new Varien_Data_Form();
- $form->setHtmlIdPrefix('_package');
-
- $fieldset = $form->addFieldset('package_fieldset', array(
- 'legend' => Mage::helper('connect')->__('Package')
- ));
-
- if ($this->getData('name') != $this->getData('file_name')) {
- $this->setData('file_name_disabled', $this->getData('file_name'));
- $fieldset->addField('file_name_disabled', 'text', array(
- 'name' => 'file_name_disabled',
- 'label' => Mage::helper('connect')->__('Package File Name'),
- 'disabled' => 'disabled',
- ));
- }
-
- $fieldset->addField('file_name', 'hidden', array(
- 'name' => 'file_name',
- ));
-
- $fieldset->addField('name', 'text', array(
- 'name' => 'name',
- 'label' => Mage::helper('connect')->__('Name'),
- 'required' => true,
- ));
-
- $fieldset->addField('channel', 'text', array(
- 'name' => 'channel',
- 'label' => Mage::helper('connect')->__('Channel'),
- 'required' => true,
- ));
-
- $versionsInfo = array(
- array(
- 'label' => Mage::helper('connect')->__('1.5.0.0 & later'),
- 'value' => Mage_Connect_Package::PACKAGE_VERSION_2X
- ),
- array(
- 'label' => Mage::helper('connect')->__('Pre-1.5.0.0'),
- 'value' => Mage_Connect_Package::PACKAGE_VERSION_1X
- )
- );
- $fieldset->addField('version_ids','multiselect',array(
- 'name' => 'version_ids',
- 'required' => true,
- 'label' => Mage::helper('connect')->__('Supported releases'),
- 'style' => 'height: 45px;',
- 'values' => $versionsInfo
- ));
-
- $fieldset->addField('summary', 'textarea', array(
- 'name' => 'summary',
- 'label' => Mage::helper('connect')->__('Summary'),
- 'style' => 'height:50px;',
- 'required' => true,
- ));
-
- $fieldset->addField('description', 'textarea', array(
- 'name' => 'description',
- 'label' => Mage::helper('connect')->__('Description'),
- 'style' => 'height:200px;',
- 'required' => true,
- ));
-
- $fieldset->addField('license', 'text', array(
- 'name' => 'license',
- 'label' => Mage::helper('connect')->__('License'),
- 'required' => true,
- 'value' => 'Open Software License (OSL 3.0)',
- ));
-
- $fieldset->addField('license_uri', 'text', array(
- 'name' => 'license_uri',
- 'label' => Mage::helper('connect')->__('License URI'),
- 'value' => 'http://opensource.org/licenses/osl-3.0.php',
- ));
-
- $form->setValues($this->getData());
- $this->setForm($form);
-
- return $this;
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Package Info');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Package Info');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php
deleted file mode 100644
index a5a0d663df3..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Release
- extends Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract
-{
- /**
- * Prepare Release Info Form before rendering HTML
- *
- * @return $this
- */
- protected function _prepareForm()
- {
- parent::_prepareForm();
-
- $form = new Varien_Data_Form();
- $form->setHtmlIdPrefix('_release');
-
- $fieldset = $form->addFieldset('release_fieldset', array(
- 'legend' => Mage::helper('adminhtml')->__('Release')
- ));
-
- $stabilityOptions = Mage::getModel('connect/extension')->getStabilityOptions();
- $fieldset->addField('version', 'text', array(
- 'name' => 'version',
- 'label' => Mage::helper('adminhtml')->__('Release Version'),
- 'required' => true,
- ));
-
- $fieldset->addField('stability', 'select', array(
- 'name' => 'stability',
- 'label' => Mage::helper('adminhtml')->__('Release Stability'),
- 'options' => $stabilityOptions,
- ));
-
- $fieldset->addField('notes', 'textarea', array(
- 'name' => 'notes',
- 'label' => Mage::helper('adminhtml')->__('Notes'),
- 'style' => 'height:300px;',
- 'required' => true,
- ));
-
- $form->setValues($this->getData());
- $this->setForm($form);
-
- return $this;
- }
-
- /**
- * Get Tab Label
- *
- * @return string
- */
- public function getTabLabel()
- {
- return Mage::helper('connect')->__('Release Info');
- }
-
- /**
- * Get Tab Title
- *
- * @return string
- */
- public function getTabTitle()
- {
- return Mage::helper('connect')->__('Release Info');
- }
-}
diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php
deleted file mode 100644
index a331de91826..00000000000
--- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- */
-class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
-{
- /**
- * Constructor
- */
- public function __construct()
- {
- parent::__construct();
- $this->setId('connect_extension_edit_tabs');
- $this->setDestElementId('edit_form');
- $this->setTitle(Mage::helper('connect')->__('Create Extension Package'));
- }
-
- /**
- * Set tabs
- *
- * @return $this
- */
- protected function _beforeToHtml()
- {
-// $this->addTab('package', array(
-// 'label' => Mage::helper('connect')->__('Package Info'),
-// 'content' => $this->_getTabHtml('package'),
-// 'active' => true,
-// ));
-//
-// $this->addTab('release', array(
-// 'label' => Mage::helper('connect')->__('Release Info'),
-// 'content' => $this->_getTabHtml('release'),
-// ));
-//
-// $this->addTab('maintainers', array(
-// 'label' => Mage::helper('connect')->__('Authors'),
-// 'content' => $this->_getTabHtml('authors'),
-// ));
-//
-// $this->addTab('depends', array(
-// 'label' => Mage::helper('connect')->__('Dependencies'),
-// 'content' => $this->_getTabHtml('depends'),
-// ));
-//
-// $this->addTab('contents', array(
-// 'label' => Mage::helper('connect')->__('Contents'),
-// 'content' => $this->_getTabHtml('contents'),
-// ));
-//
-// $this->addTab('load', array(
-// 'label' => Mage::helper('connect')->__('Load local Package'),
-// 'class' => 'ajax',
-// 'url' => $this->getUrl('*/*/loadtab', array('_current' => true)),
-// ));
-
- return parent::_beforeToHtml();
- }
-
- /**
- * Retrieve HTML for tab
- *
- * @param string $tab
- * @return string
- */
- protected function _getTabHtml($tab)
- {
-// return $this->getLayout()
-// ->createBlock('connect/adminhtml_extension_custom_edit_tab_'.$tab)
-// ->initForm()
-// ->toHtml();
- }
-
-}
diff --git a/app/code/core/Mage/Connect/Helper/Data.php b/app/code/core/Mage/Connect/Helper/Data.php
deleted file mode 100644
index 83215240ea7..00000000000
--- a/app/code/core/Mage/Connect/Helper/Data.php
+++ /dev/null
@@ -1,169 +0,0 @@
-
- */
-class Mage_Connect_Helper_Data extends Mage_Core_Helper_Data
-{
- /**
- * Path to directory that contains XML packages definition
- *
- * @var string
- */
- protected $_localPackagesPath;
-
- public function __construct()
- {
- $this->_localPackagesPath = Mage::getBaseDir('var') . DS . 'connect' . DS;
- }
-
- /**
- * Retrieve file system path for local extension packages
- * Return path with last directory separator
- *
- * @return string
- */
- public function getLocalPackagesPath()
- {
- return $this->_localPackagesPath;
- }
-
- /**
- * Set file system path for local extension packages
- *
- */
- public function setLocalPackagesPath($path)
- {
- $this->_localPackagesPath = $path;
- return $this;
- }
-
- /**
- * Retrieve file system path for local extension packages (for version 1 packages only)
- * Return path with last directory separator
- *
- * @return string
- */
- public function getLocalPackagesPathV1x()
- {
- return Mage::getBaseDir('var') . DS . 'pear' . DS;
- }
-
- /**
- * Retrieve a map to convert a channel from previous version of Magento Connect Manager
- *
- * @return array
- */
- public function getChannelMapFromV1x()
- {
- return array(
- 'connect.magentocommerce.com/community' => 'community',
- 'connect.magentocommerce.com/core' => 'community'
- );
- }
-
- /**
- * Retrieve a map to convert a channel to previous version of Magento Connect Manager
- *
- * @return array
- */
- public function getChannelMapToV1x()
- {
- return array(
- 'community' => 'connect.magentocommerce.com/community'
- );
- }
-
- /**
- * Convert package channel in order for it to be compatible with current version of Magento Connect Manager
- *
- * @param string $channel
- *
- * @return string
- */
- public function convertChannelFromV1x($channel)
- {
- $channelMap = $this->getChannelMapFromV1x();
- if (isset($channelMap[$channel])) {
- $channel = $channelMap[$channel];
- }
- return $channel;
- }
-
- /**
- * Convert package channel in order for it to be compatible with previous version of Magento Connect Manager
- *
- * @param string $channel
- *
- * @return string
- */
- public function convertChannelToV1x($channel)
- {
- $channelMap = $this->getChannelMapToV1x();
- if (isset($channelMap[$channel])) {
- $channel = $channelMap[$channel];
- }
- return $channel;
- }
-
- /**
- * Load local package data array
- *
- * @param string $packageName without extension
- * @return array|false
- */
- public function loadLocalPackage($packageName)
- {
- //check LFI protection
- $this->checkLfiProtection($packageName);
-
- $path = $this->getLocalPackagesPath();
- $xmlFile = $path . $packageName . '.xml';
- $serFile = $path . $packageName . '.ser';
-
- if (file_exists($xmlFile) && is_readable($xmlFile)) {
- $xml = simplexml_load_file($xmlFile);
- $data = Mage::helper('core')->xmlToAssoc($xml);
- if (!empty($data)) {
- return $data;
- }
- }
-
- if (file_exists($serFile) && is_readable($xmlFile)) {
- $data = unserialize(file_get_contents($serFile));
- if (!empty($data)) {
- return $data;
- }
- }
-
- return false;
- }
-}
diff --git a/app/code/core/Mage/Connect/Model/Extension.php b/app/code/core/Mage/Connect/Model/Extension.php
deleted file mode 100644
index 4171435f146..00000000000
--- a/app/code/core/Mage/Connect/Model/Extension.php
+++ /dev/null
@@ -1,342 +0,0 @@
-
- */
-class Mage_Connect_Model_Extension extends Varien_Object
-{
- /**
- * Cache for targets
- *
- * @var array
- */
- protected $_targets;
-
- /**
- * Internal cache for package
- *
- * @var Mage_Connect_Package
- */
- protected $_package;
-
- /**
- * Return package object
- *
- * @return Mage_Connect_Package
- */
- protected function getPackage()
- {
- if (!$this->_package instanceof Mage_Connect_Package) {
- $this->_package = new Mage_Connect_Package();
- }
- return $this->_package;
- }
-
- /**
- * Set package object.
- *
- * @return $this
- */
- public function generatePackageXml()
- {
- Mage::getSingleton('connect/session')
- ->setLocalExtensionPackageFormData($this->getData());
-
- $this->_setPackage()
- ->_setRelease()
- ->_setAuthors()
- ->_setDependencies()
- ->_setContents();
- if (!$this->getPackage()->validate()) {
- $message = $this->getPackage()->getErrors();
- throw Mage::exception('Mage_Core', Mage::helper('connect')->__($message[0]));
- }
- $this->setPackageXml($this->getPackage()->getPackageXml());
- return $this;
- }
-
- /**
- * Set general information.
- *
- * @return $this
- */
- protected function _setPackage()
- {
- $this->getPackage()
- ->setName($this->getData('name'))
- ->setChannel($this->getData('channel'))
- ->setLicense($this->getData('license'), $this->getData('license_uri'))
- ->setSummary($this->getData('summary'))
- ->setDescription($this->getData('description'));
- return $this;
- }
-
- /**
- * Set release information
- *
- * @return $this
- */
- protected function _setRelease()
- {
- $this->getPackage()
- ->setDate(date('Y-m-d'))
- ->setTime(date('H:i:s'))
- ->setVersion($this->getData('version')?$this->getData('version'):$this->getData('release_version'))
- ->setStability($this->getData('stability'))
- ->setNotes($this->getData('notes'));
- return $this;
- }
-
- /**
- * Set authors
- *
- * @return $this
- */
- protected function _setAuthors()
- {
- $authors = $this->getData('authors');
- foreach ($authors['name'] as $i => $name) {
- $user = $authors['user'][$i];
- $email = $authors['email'][$i];
- $this->getPackage()->addAuthor($name, $user, $email);
- }
- return $this;
- }
-
-
- protected function packageFilesToArray($filesString)
- {
- $packageFiles = array();
- if($filesString) {
- $filesArray = preg_split("/[\n\r]+/", $filesString);
- foreach($filesArray as $file) {
- $file = trim($file, "/");
- $res = explode(DIRECTORY_SEPARATOR, $file, 2);
- array_map('trim', $res);
- if(2 == count($res)) {
- $packageFiles[] = array('target'=>$res[0], 'path'=>$res[1]);
- }
- }
- }
- return $packageFiles;
- }
-
- /**
- * Set php, php extensions, another packages dependencies
- *
- * @return $this
- */
- protected function _setDependencies()
- {
- $this->getPackage()
- ->clearDependencies()
- ->setDependencyPhpVersion($this->getData('depends_php_min'), $this->getData('depends_php_max'));
-
- foreach ($this->getData('depends') as $deptype=>$deps) {
- foreach ($deps['name'] as $i=>$type) {
- if (0===$i) {
- continue;
- }
- $name = $deps['name'][$i];
- $min = !empty($deps['min'][$i]) ? $deps['min'][$i] : false;
- $max = !empty($deps['max'][$i]) ? $deps['max'][$i] : false;
-
- $files = !empty($deps['files'][$i]) ? $deps['files'][$i] : false;
- $packageFiles = $this->packageFilesToArray($files);
-
- if ($deptype !== 'extension') {
- $channel = !empty($deps['channel'][$i])
- ? $deps['channel'][$i]
- : 'connect.magentocommerce.com/core';
- }
- switch ($deptype) {
- case 'package':
- $this->getPackage()->addDependencyPackage($name, $channel, $min, $max, $packageFiles);
- break;
-
- case 'extension':
- $this->getPackage()->addDependencyExtension($name, $min, $max);
- break;
- }
- }
- }
- return $this;
- }
-
- /**
- * Set contents. Add file or entire directory.
- *
- * @return $this
- */
- protected function _setContents()
- {
- $this->getPackage()->clearContents();
- $contents = $this->getData('contents');
- foreach ($contents['target'] as $i=>$target) {
- if (0===$i) {
- continue;
- }
- switch ($contents['type'][$i]) {
- case 'file':
- $this->getPackage()->addContent($contents['path'][$i], $contents['target'][$i]);
- break;
-
- case 'dir':
- $target = $contents['target'][$i];
- $path = $contents['path'][$i];
- $include = $contents['include'][$i];
- $ignore = $contents['ignore'][$i];
- $this->getPackage()->addContentDir($target, $path, $ignore, $include);
- break;
- }
- }
- return $this;
- }
-
- /**
- * Save package file to var/connect.
- *
- * @return boolean
- */
- public function savePackage()
- {
- if ($this->getData('file_name') != '') {
- $fileName = $this->getData('file_name');
- $this->unsetData('file_name');
- } else {
- $fileName = $this->getName();
- }
-
- if (!preg_match('/^[a-z0-9]+[a-z0-9\-\_\.]*([\/\\\\]{1}[a-z0-9]+[a-z0-9\-\_\.]*)*$/i', $fileName)) {
- return false;
- }
-
- if (!$this->getPackageXml()) {
- $this->generatePackageXml();
- }
- if (!$this->getPackageXml()) {
- return false;
- }
-
- $path = Mage::helper('connect')->getLocalPackagesPath();
- if (!@file_put_contents($path . 'package.xml', $this->getPackageXml())) {
- return false;
- }
-
- $this->unsPackageXml();
- $this->unsTargets();
- $xml = Mage::helper('core')->assocToXml($this->getData());
- $xml = new Varien_Simplexml_Element($xml->asXML());
-
- // prepare dir to save
- $parts = explode(DS, $fileName);
- array_pop($parts);
- $newDir = implode(DS, $parts);
- if ((!empty($newDir)) && (!is_dir($path . $newDir))) {
- if (!@mkdir($path . $newDir, 0777, true)) {
- return false;
- }
- }
-
- if (!@file_put_contents($path . $fileName . '.xml', $xml->asNiceXml())) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Create package file
- *
- * @return boolean
- */
- public function createPackage()
- {
- $path = Mage::helper('connect')->getLocalPackagesPath();
- if (!Mage::getConfig()->createDirIfNotExists($path)) {
- return false;
- }
- if (!$this->getPackageXml()) {
- $this->generatePackageXml();
- }
- $this->getPackage()->save($path);
- return true;
- }
-
- /**
- * Create package file compatible with previous version of Magento Connect Manager
- *
- * @return boolean
- */
- public function createPackageV1x()
- {
- $path = Mage::helper('connect')->getLocalPackagesPathV1x();
- if (!Mage::getConfig()->createDirIfNotExists($path)) {
- return false;
- }
- if (!$this->getPackageXml()) {
- $this->generatePackageXml();
- }
- $this->getPackage()->saveV1x($path);
- return true;
- }
-
- /**
- * Retrieve stability value and name for options
- *
- * @return array
- */
- public function getStabilityOptions()
- {
- return array(
- 'devel' => 'Development',
- 'alpha' => 'Alpha',
- 'beta' => 'Beta',
- 'stable' => 'Stable',
- );
- }
-
- /**
- * Retrieve targets
- *
- * @return array
- */
- public function getLabelTargets()
- {
- if (!is_array($this->_targets)) {
- $objectTarget = new Mage_Connect_Package_Target();
- $this->_targets = $objectTarget->getLabelTargets();
- }
- return $this->_targets;
- }
-
-}
diff --git a/app/code/core/Mage/Connect/Model/Extension/Collection.php b/app/code/core/Mage/Connect/Model/Extension/Collection.php
deleted file mode 100644
index a9166957c8a..00000000000
--- a/app/code/core/Mage/Connect/Model/Extension/Collection.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- */
-class Mage_Connect_Model_Extension_Collection extends Varien_Data_Collection_Filesystem
-{
- /**
- * Files and folders regexsp
- *
- * @var string
- */
- protected $_allowedDirsMask = '/^[a-z0-9\.\-]+$/i';
- protected $_allowedFilesMask = '/^[a-z0-9\.\-\_]+\.(xml|ser)$/i';
- protected $_disallowedFilesMask = '/^package\.xml$/i';
-
- /**
- * Base dir where packages are located
- *
- * @var string
- */
- protected $_baseDir = '';
-
- /**
- * Set base dir
- */
- public function __construct()
- {
- $this->_baseDir = Mage::getBaseDir('var') . DS . 'connect';
- $io = new Varien_Io_File();
- $io->setAllowCreateFolders(true)->createDestinationDir($this->_baseDir);
- $this->addTargetDir($this->_baseDir);
- }
-
- /**
- * Row generator
- *
- * @param string $filename
- * @return array
- */
- protected function _generateRow($filename)
- {
- $row = parent::_generateRow($filename);
- $row['package'] = preg_replace('/\.(xml|ser)$/', '', str_replace($this->_baseDir . DS, '', $filename));
- $row['filename_id'] = $row['package'];
- $folder = explode(DS, $row['package']);
- array_pop($folder);
- $row['folder'] = DS;
- if (!empty($folder)) {
- $row['folder'] = implode(DS, $folder) . DS;
- }
- return $row;
- }
-
- /**
- * Get all folders as options array
- *
- * @return array
- */
- public function collectFolders()
- {
- $collectFiles = $this->_collectFiles;
- $collectDirs = $this->_collectDirs;
- $this->setCollectFiles(false)->setCollectDirs(true);
-
- $this->_collectRecursive($this->_baseDir);
- $result = array(DS => DS);
- foreach ($this->_collectedDirs as $dir) {
- $dir = str_replace($this->_baseDir . DS, '', $dir) . DS;
- $result[$dir] = $dir;
- }
-
- $this->setCollectFiles($collectFiles)->setCollectDirs($collectDirs);
- return $result;
- }
-
-}
diff --git a/app/code/core/Mage/Connect/Model/Session.php b/app/code/core/Mage/Connect/Model/Session.php
deleted file mode 100644
index faeace429eb..00000000000
--- a/app/code/core/Mage/Connect/Model/Session.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- */
-class Mage_Connect_Model_Session extends Mage_Core_Model_Session_Abstract
-{
-
- /**
- * Contructor
- */
- public function __construct()
- {
- $this->init('adminhtml');
- }
-
- /**
- * Retrieve parameters of extension from session.
- * Compatible with old version extension info file.
- *
- * @return array
- */
- public function getCustomExtensionPackageFormData()
- {
- $data = $this->getData('custom_extension_package_form_data');
- /* convert Maintainers to Authors */
- if (!isset($data['authors']) || count($data['authors']) == 0) {
- if (isset($data['maintainers'])) {
- $data['authors']['name'] = array();
- $data['authors']['user'] = array();
- $data['authors']['email'] = array();
- foreach ($data['maintainers']['name'] as $i => $name) {
- if (!$data['maintainers']['name'][$i] && !$data['maintainers']['handle'][$i] && !$data['maintainers']['email'][$i]) {
- continue;
- }
- array_push($data['authors']['name'], $data['maintainers']['name'][$i]);
- array_push($data['authors']['user'], $data['maintainers']['handle'][$i]);
- array_push($data['authors']['email'], $data['maintainers']['email'][$i]);
- }
- // Convert channel from previous version for entire package
- if (isset($data['channel'])) {
- $data['channel'] = Mage::helper('connect')->convertChannelFromV1x($data['channel']);
- }
- // Convert channel from previous version for each required package
- $nRequiredPackages = count($data['depends']['package']['channel']);
- for ($i = 0; $i < $nRequiredPackages; $i++) {
- $channel = $data['depends']['package']['channel'][$i];
- if ($channel) {
- $data['depends']['package']['channel'][$i] = Mage::helper('connect')->convertChannelFromV1x($channel);
- }
- }
- }
- }
-
- /* convert Release version to Version */
- if (!isset($data['version'])) {
- if (isset($data['release_version'])) {
- $data['version'] = $data['release_version'];
- }
- }
- /* convert Release stability to Stability */
- if (!isset($data['stability'])) {
- if (isset($data['release_stability'])) {
- $data['stability'] = $data['release_stability'];
- }
- }
- /* convert contents */
- if (!isset($data['contents']['target'])) {
- $data['contents']['target'] = $data['contents']['role'];
- }
- return $data;
- }
-
-}
diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php
deleted file mode 100644
index 00173ff5d31..00000000000
--- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php
+++ /dev/null
@@ -1,204 +0,0 @@
-
- */
-class Mage_Connect_Adminhtml_Extension_CustomController extends Mage_Adminhtml_Controller_Action
-{
- /**
- * Redirect to edit Extension Package action
- *
- */
- public function indexAction()
- {
- $this->_title($this->__('System'))
- ->_title($this->__('Magento Connect'))
- ->_title($this->__('Package Extensions'));
-
- $this->_forward('edit');
- }
-
- /**
- * Edit Extension Package Form
- *
- */
- public function editAction()
- {
- $this->_title($this->__('System'))
- ->_title($this->__('Magento Connect'))
- ->_title($this->__('Package Extensions'))
- ->_title($this->__('Edit Extension'));
-
- $this->loadLayout();
- $this->_setActiveMenu('system/extension/custom');
- $this->renderLayout();
- }
-
- /**
- * Reset Extension Package form data
- *
- */
- public function resetAction()
- {
- Mage::getSingleton('connect/session')->unsCustomExtensionPackageFormData();
- $this->_redirect('*/*/edit');
- }
-
- /**
- * Load Local Extension Package
- *
- */
- public function loadAction()
- {
- $packageName = base64_decode(strtr($this->getRequest()->getParam('id'), '-_,', '+/='));
- if ($packageName) {
- $session = Mage::getSingleton('connect/session');
- try {
- $data = Mage::helper('connect')->loadLocalPackage($packageName);
- if (!$data) {
- Mage::throwException(Mage::helper('connect')->__('Failed to load the package data.'));
- }
- $data = array_merge($data, array('file_name' => $packageName));
- $session->setCustomExtensionPackageFormData($data);
- $session->addSuccess(
- Mage::helper('connect')->__('The package %s data has been loaded.', $packageName)
- );
- } catch (Exception $e) {
- $session->addError($e->getMessage());
- }
- }
- $this->_redirect('*/*/edit');
- }
-
- /**
- * Save Extension Package
- *
- */
- public function saveAction()
- {
- $session = Mage::getSingleton('connect/session');
- $p = $this->getRequest()->getPost();
-
- if (!empty($p['_create'])) {
- $create = true;
- unset($p['_create']);
- }
-
- if ($p['file_name'] == '') {
- $p['file_name'] = $p['name'];
- }
-
- $session->setCustomExtensionPackageFormData($p);
- try {
- $ext = Mage::getModel('connect/extension');
- /** @var $ext Mage_Connect_Model_Extension */
- $ext->setData($p);
- if ($ext->savePackage()) {
- $session->addSuccess(Mage::helper('connect')->__('The package data has been saved.'));
- } else {
- $session->addError(Mage::helper('connect')->__('There was a problem saving package data'));
- $this->_redirect('*/*/edit');
- }
- if (empty($create)) {
- $this->_redirect('*/*/edit');
- } else {
- $this->_forward('create');
- }
- } catch (Mage_Core_Exception $e){
- $session->addError($e->getMessage());
- $this->_redirect('*/*');
- } catch (Exception $e){
- $session->addException($e, Mage::helper('connect')->__('Failed to save the package.'));
- $this->_redirect('*/*');
- }
- }
-
- /**
- * Create new Extension Package
- *
- */
- public function createAction()
- {
- $session = Mage::getSingleton('connect/session');
- try {
- $p = $this->getRequest()->getPost();
- $session->setCustomExtensionPackageFormData($p);
- $ext = Mage::getModel('connect/extension');
- $ext->setData($p);
- $packageVersion = $this->getRequest()->getPost('version_ids');
- if (is_array($packageVersion)) {
- if (in_array(Mage_Connect_Package::PACKAGE_VERSION_2X, $packageVersion)) {
- $ext->createPackage();
- }
- if (in_array(Mage_Connect_Package::PACKAGE_VERSION_1X, $packageVersion)) {
- $ext->createPackageV1x();
- }
- }
- $this->_redirect('*/*');
- } catch(Mage_Core_Exception $e){
- $session->addError($e->getMessage());
- $this->_redirect('*/*');
- } catch(Exception $e){
- $session->addException($e, Mage::helper('connect')->__('Failed to create the package.'));
- $this->_redirect('*/*');
- }
- }
-
- /**
- * Load Grid with Local Packages
- *
- */
- public function loadtabAction()
- {
- $this->loadLayout();
- $this->renderLayout();
- }
-
- /**
- * Grid for loading packages
- *
- */
- public function gridAction()
- {
- $this->loadLayout();
- $this->renderLayout();
- }
-
- /**
- * Check is allowed access to actions
- *
- * @return bool
- */
- protected function _isAllowed()
- {
- return Mage::getSingleton('admin/session')->isAllowed('system/extensions/custom');
- }
-}
diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php
deleted file mode 100644
index b01b8ea8da1..00000000000
--- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- */
-class Mage_Connect_Adminhtml_Extension_LocalController extends Mage_Adminhtml_Controller_Action
-{
- /**
- * Redirect to Magento Connect
- *
- */
- public function indexAction()
- {
- $url = Mage::getBaseUrl('web') . 'downloader/?return=' . urlencode(Mage::getUrl('adminhtml'));
- $this->getResponse()->setRedirect($url);
- }
-
- /**
- * Check is allowed access to action
- *
- * @return bool
- */
- protected function _isAllowed()
- {
- return Mage::getSingleton('admin/session')->isAllowed('system/extensions/local');
- }
-}
diff --git a/app/code/core/Mage/Connect/etc/adminhtml.xml b/app/code/core/Mage/Connect/etc/adminhtml.xml
deleted file mode 100644
index bb601ec71e8..00000000000
--- a/app/code/core/Mage/Connect/etc/adminhtml.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
- Magento Connect
- 80
-
-
- Magento Connect Manager
- adminhtml/extension_local
-
-
- Package Extensions
- adminhtml/extension_custom
-
-
-
-
-
-
-
diff --git a/app/code/core/Mage/Connect/etc/config.xml b/app/code/core/Mage/Connect/etc/config.xml
deleted file mode 100644
index d5e902ca625..00000000000
--- a/app/code/core/Mage/Connect/etc/config.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- 1.6.0.0
-
-
-
-
-
- Mage_Connect_Model
-
-
-
-
- Mage_Connect_Block
-
-
-
-
-
-
-
-
- Mage_Connect_Adminhtml
-
-
-
-
-
-
-
-
-
- connect.xml
-
-
-
-
-
diff --git a/app/code/core/Mage/Install/Block/Download.php b/app/code/core/Mage/Install/Block/Download.php
deleted file mode 100644
index 24acbe9ac2d..00000000000
--- a/app/code/core/Mage/Install/Block/Download.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- */
-class Mage_Install_Block_Download extends Mage_Install_Block_Abstract
-{
- public function __construct()
- {
- parent::__construct();
- $this->setTemplate('install/download.phtml');
- }
-
- /**
- * Retrieve locale data post url
- *
- * @return string
- */
- public function getPostUrl()
- {
- return $this->getUrl('*/*/downloadPost');
- }
-
- public function getNextUrl()
- {
- return Mage::getModel('install/wizard')
- ->getStepByName('download')
- ->getNextUrl();
- }
-
- public function hasLocalCopy()
- {
- $dir = Mage::getConfig()->getModuleDir('etc', 'Mage_Adminhtml');
- if ($dir && file_exists($dir)) {
- return true;
- }
- return false;
- }
-}
-
diff --git a/app/code/core/Mage/Install/Block/State.php b/app/code/core/Mage/Install/Block/State.php
index 8d484da18a8..406986e91f3 100644
--- a/app/code/core/Mage/Install/Block/State.php
+++ b/app/code/core/Mage/Install/Block/State.php
@@ -33,39 +33,10 @@
*/
class Mage_Install_Block_State extends Mage_Core_Block_Template
{
- public function __construct()
+ public function __construct()
{
$this->setTemplate('install/state.phtml');
$this->assign('steps', Mage::getSingleton('install/wizard')->getSteps());
}
-
- /**
- * Get previous downloader steps
- *
- * @return array
- */
- public function getDownloaderSteps()
- {
- if ($this->isDownloaderInstall()) {
- $steps = array(
- Mage::helper('install')->__('Welcome'),
- Mage::helper('install')->__('Validation'),
- Mage::helper('install')->__('Magento Connect Manager Deployment'),
- );
- return $steps;
- } else {
- return array();
- }
- }
- /**
- * Checks for Magento Connect Manager installation method
- *
- * @return bool
- */
- public function isDownloaderInstall()
- {
- $session = Mage::app()->getCookie()->get('magento_downloader_session');
- return $session ? true : false;
- }
}
diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php
index 35ca61bbd01..a7434e39bd2 100644
--- a/app/code/core/Mage/Install/Model/Installer.php
+++ b/app/code/core/Mage/Install/Model/Installer.php
@@ -83,23 +83,6 @@ public function setDataModel(Varien_Object $model)
return $this;
}
- /**
- * Check packages (pear) downloads
- *
- * @return boolean
- */
- public function checkDownloads()
- {
- try {
- $result = Mage::getModel('install/installer_pear')->checkDownloads();
- $result = true;
- } catch (Exception $e) {
- $result = false;
- }
- $this->setDownloadCheckStatus($result);
- return $result;
- }
-
/**
* Check server settings
*
diff --git a/app/code/core/Mage/Install/Model/Installer/Pear.php b/app/code/core/Mage/Install/Model/Installer/Pear.php
deleted file mode 100644
index 4d0ba242275..00000000000
--- a/app/code/core/Mage/Install/Model/Installer/Pear.php
+++ /dev/null
@@ -1,78 +0,0 @@
-
- */
-class Mage_Install_Model_Installer_Pear extends Mage_Install_Model_Installer_Abstract
-{
- public function getPackages()
- {
- $packages = array(
- 'pear/PEAR-stable',
- 'connect.magentocommerce.com/core/Mage_Pear_Helpers',
- 'connect.magentocommerce.com/core/Lib_ZF',
- 'connect.magentocommerce.com/core/Lib_Varien',
- 'connect.magentocommerce.com/core/Mage_All',
- 'connect.magentocommerce.com/core/Interface_Frontend_Default',
- 'connect.magentocommerce.com/core/Interface_Adminhtml_Default',
- 'connect.magentocommerce.com/core/Interface_Install_Default',
- );
- return $packages;
- }
-
- public function checkDownloads()
- {
- $pear = new Varien_Pear;
- $pkg = new PEAR_PackageFile($pear->getConfig(), false);
- $result = true;
- foreach ($this->getPackages() as $package) {
- $obj = $pkg->fromAnyFile($package, PEAR_VALIDATE_NORMAL);
- if (PEAR::isError($obj)) {
- $uinfo = $obj->getUserInfo();
- if (is_array($uinfo)) {
- foreach ($uinfo as $message) {
- if (is_array($message)) {
- $message = $message['message'];
- }
- Mage::getSingleton('install/session')->addError($message);
- }
- } else {
- print_r($obj->getUserInfo());
- #Mage::getSingleton('install/session')->addError($message);
- }
- $result = false;
- }
- }
- return $result;
- }
-}
diff --git a/app/code/core/Mage/Install/controllers/WizardController.php b/app/code/core/Mage/Install/controllers/WizardController.php
index 182847f48e1..f57ac390328 100644
--- a/app/code/core/Mage/Install/controllers/WizardController.php
+++ b/app/code/core/Mage/Install/controllers/WizardController.php
@@ -188,95 +188,6 @@ public function localePostAction()
$this->getResponse()->setRedirect($step->getNextUrl());
}
- public function downloadAction()
- {
- $this->_checkIfInstalled();
- $this->setFlag('', self::FLAG_NO_DISPATCH_BLOCK_EVENT, true);
- $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true);
-
- $this->_prepareLayout();
- $this->_initLayoutMessages('install/session');
- $this->getLayout()->getBlock('content')->append(
- $this->getLayout()->createBlock('install/download', 'install.download')
- );
-
- $this->renderLayout();
- }
-
- public function downloadPostAction()
- {
- $this->_checkIfInstalled();
- switch ($this->getRequest()->getPost('continue')) {
- case 'auto':
- $this->_forward('downloadAuto');
- break;
-
- case 'manual':
- $this->_forward('downloadManual');
- break;
-
- case 'svn':
- $step = $this->_getWizard()->getStepByName('download');
- $this->getResponse()->setRedirect($step->getNextUrl());
- break;
-
- default:
- $this->_redirect('*/*/download');
- }
- }
-
- public function downloadAutoAction()
- {
- $step = $this->_getWizard()->getStepByName('download');
- $this->getResponse()->setRedirect($step->getNextUrl());
- }
-
- public function installAction()
- {
- $pear = Varien_Pear::getInstance();
- $params = array('comment'=>Mage::helper('install')->__("Downloading and installing Magento, please wait...") . "\r\n\r\n");
- if ($this->getRequest()->getParam('do')) {
- if ($state = $this->getRequest()->getParam('state', 'beta')) {
- $result = $pear->runHtmlConsole(array(
- 'comment' => Mage::helper('install')->__("Setting preferred state to: %s", $state) . "\r\n\r\n",
- 'command' => 'config-set',
- 'params' => array('preferred_state', $state)
- ));
- if ($result instanceof PEAR_Error) {
- $this->installFailureCallback();
- exit;
- }
- }
- $params['command'] = 'install';
- $params['options'] = array('onlyreqdeps'=>1);
- $params['params'] = Mage::getModel('install/installer_pear')->getPackages();
- $params['success_callback'] = array($this, 'installSuccessCallback');
- $params['failure_callback'] = array($this, 'installFailureCallback');
- }
- $pear->runHtmlConsole($params);
- Mage::app()->getFrontController()->getResponse()->clearAllHeaders();
- }
-
- public function installSuccessCallback()
- {
- echo 'parent.installSuccess()';
- }
-
- public function installFailureCallback()
- {
- echo 'parent.installFailure()';
- }
-
- public function downloadManualAction()
- {
- $step = $this->_getWizard()->getStepByName('download');
- #if (!$this->_getInstaller()->checkDownloads()) {
- # $this->getResponse()->setRedirect($step->getUrl());
- #} else {
- $this->getResponse()->setRedirect($step->getNextUrl());
- #}
- }
-
/**
* Configuration data installation
*/
diff --git a/app/design/adminhtml/default/default/layout/connect.xml b/app/design/adminhtml/default/default/layout/connect.xml
deleted file mode 100644
index 630d1402d09..00000000000
--- a/app/design/adminhtml/default/default/layout/connect.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- package_info tab_package
- release_info tab_release
- authors tab_authors
- dependencies tab_depends
- contents tab_contents
- load_local_package tab_local
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/authors.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/authors.phtml
deleted file mode 100644
index 5ac7bec0fd6..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/authors.phtml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- getFormHtml() ?>
-
-
-
-
- __("Authors") ?>
-
-
-
- __("Name") ?> *
- __("User") ?> *
- __("Email") ?> *
- __("Remove") ?>
-
-
-
-
-
-
-
- getAddAuthorButtonHtml() ?>
-
-
-
-
-
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/contents.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/contents.phtml
deleted file mode 100644
index d055e685f6a..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/contents.phtml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
- getFormHtml() ?>
-
-
-
-
-
- __("Contents") ?>
-
-
-
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/depends.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/depends.phtml
deleted file mode 100644
index c2253531c6e..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/depends.phtml
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
- getFormHtml() ?>
-
-
-
-
-
- __("Packages") ?>
-
-
-
-
-
-
-
- __("Extensions") ?>
-
-
-
-
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/load.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/load.phtml
deleted file mode 100644
index 9f9dd0c9334..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/load.phtml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- __("Please be careful as once you click on the row it will load package data form the selected file and all unsaved form data will be lost.") ?>
-
-
-
-getPackageGridHtml() ?>
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml
deleted file mode 100644
index 0f8a43ea0e6..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
- getFormHtml() ?>
-
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/release.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/release.phtml
deleted file mode 100644
index a8adb7a0261..00000000000
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/release.phtml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- getFormHtml() ?>
-
diff --git a/app/design/install/default/default/template/install/download.phtml b/app/design/install/default/default/template/install/download.phtml
deleted file mode 100644
index a3ba76fdf5f..00000000000
--- a/app/design/install/default/default/template/install/download.phtml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
__('Download Magento Core Modules and Updates') ?>
-
-getMessagesBlock()->toHtml() ?>
-
-
-
-
diff --git a/app/design/install/default/default/template/install/state.phtml b/app/design/install/default/default/template/install/state.phtml
index 69372824cff..aaf19c4b1f8 100644
--- a/app/design/install/default/default/template/install/state.phtml
+++ b/app/design/install/default/default/template/install/state.phtml
@@ -27,10 +27,6 @@
__('Installation') ?>
-getDownloaderSteps() as $step): ?>
-
-
- __('Download')?>
getActive()): ?>style="color:green; font-weight:bold; ">__($_step->getCode()) ?>
diff --git a/app/etc/modules/Mage_Connect.xml b/app/etc/modules/Mage_Connect.xml
deleted file mode 100644
index b95883d3933..00000000000
--- a/app/etc/modules/Mage_Connect.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- true
- core
-
-
-
-
diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv
index a409bd96abb..de1a691c2b5 100644
--- a/app/locale/en_US/Mage_Adminhtml.csv
+++ b/app/locale/en_US/Mage_Adminhtml.csv
@@ -566,8 +566,6 @@
"MS Excel XML","MS Excel XML"
"Magento Admin","Magento Admin"
"Magento Commerce - Administrative Panel","Magento Commerce - Administrative Panel"
-"Magento Connect","Magento Connect"
-"Magento Connect Manager","Magento Connect Manager"
"Magento Logo","Magento Logo"
"Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento is a trademark of Magento Inc. Copyright © %s Magento Inc."
"Magento root directory","Magento root directory"
@@ -711,7 +709,6 @@
"Original Magento attribute names in first row:","Original Magento attribute names in first row:"
"Out of stock","Out of stock"
"PDT (Payment Data Transfer) Only","PDT (Payment Data Transfer) Only"
-"Package Extensions","Package Extensions"
"Pages","Pages"
"Parent Product Thumbnail","Parent Product Thumbnail"
"Parent Transaction ID","Parent Transaction ID"
diff --git a/app/locale/en_US/Mage_Connect.csv b/app/locale/en_US/Mage_Connect.csv
deleted file mode 100644
index 6470dc9e4cf..00000000000
--- a/app/locale/en_US/Mage_Connect.csv
+++ /dev/null
@@ -1,58 +0,0 @@
-"1.5.0.0 & later","1.5.0.0 & later"
-"Action","Action"
-"Add Author","Add Author"
-"Add Contents Path","Add Contents Path"
-"Add PHP Extension dependency","Add PHP Extension dependency"
-"Add Package dependency","Add Package dependency"
-"Add files","Add files"
-"Authors","Authors"
-"Channel","Channel"
-"Contents","Contents"
-"Create Extension Package","Create Extension Package"
-"Dependencies","Dependencies"
-"Description","Description"
-"Edit Extension","Edit Extension"
-"Email","Email"
-"Extension","Extension"
-"Extensions","Extensions"
-"Failed to create the package.","Failed to create the package."
-"Failed to load the package data.","Failed to load the package data."
-"Failed to save the package.","Failed to save the package."
-"Files","Files"
-"Folder","Folder"
-"Ignore","Ignore"
-"Include","Include"
-"License","License"
-"License URI","License URI"
-"Load Local Package","Load Local Package"
-"Load local Package","Load local Package"
-"Magento Connect","Magento Connect"
-"Magento Connect Manager","Magento Connect Manager"
-"Max","Max"
-"Maximum","Maximum"
-"Min","Min"
-"Minimum","Minimum"
-"Name","Name"
-"New Extension","New Extension"
-"PHP Version","PHP Version"
-"Package","Package"
-"Package Extensions","Package Extensions"
-"Package File Name","Package File Name"
-"Package Info","Package Info"
-"Packages","Packages"
-"Path","Path"
-"Pre-1.5.0.0","Pre-1.5.0.0"
-"Release Info","Release Info"
-"Remove","Remove"
-"Save As...","Save As..."
-"Save Data and Create Package","Save Data and Create Package"
-"Save package with custom package file name","Save package with custom package file name"
-"Summary","Summary"
-"Supported releases","Supported releases"
-"System","System"
-"Target","Target"
-"The package %s data has been loaded.","The package %s data has been loaded."
-"The package data has been saved.","The package data has been saved."
-"There was a problem saving package data","There was a problem saving package data"
-"Type","Type"
-"User","User"
diff --git a/app/locale/en_US/Mage_Install.csv b/app/locale/en_US/Mage_Install.csv
index bfb89f466b7..5d076bb1111 100644
--- a/app/locale/en_US/Mage_Install.csv
+++ b/app/locale/en_US/Mage_Install.csv
@@ -68,7 +68,6 @@
"Localization","Localization"
"Login Information","Login Information"
"Magento","Magento"
-"Magento Connect Manager Deployment","Magento Connect Manager Deployment"
"Magento Installation Wizard","Magento Installation Wizard"
"Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento is a trademark of Magento Inc. Copyright © %s Magento Inc."
"Magento uses this key to encrypt passwords, credit cards and more. If this field is left empty the system will create an encryption key for you and will display it on the next page.","Magento uses this key to encrypt passwords, credit cards and more. If this field is left empty the system will create an encryption key for you and will display it on the next page."
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.php b/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.php
deleted file mode 100644
index 11952660995..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.php
+++ /dev/null
@@ -1,118 +0,0 @@
-_rootElement->find($this->channelTitle)->getText();
- }
-
- /**
- * Click on the 'Check for Upgrades' button
- */
- public function checkForUpgrades()
- {
- $this->_rootElement->find($this->checkUpgradesButton)->click();
- $this->waitForElementVisible($this->upgradeAvailable);
- }
-
- /**
- * Select package for upgrade
- *
- * @param Connect $connect
- */
- public function selectPackages(Connect $connect)
- {
- $this->fill($connect);
- }
-
- /**
- * Start downloading
- */
- public function commitChanges()
- {
- $this->_rootElement->find($this->commitChangesButton)->click();
- $this->waitForElementVisible($this->connectFrame);
- $this->waitForElementVisible($this->message);
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.xml b/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.xml
deleted file mode 100644
index 8dcab95d6fd..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Content.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- actions
-
-
- [name*=Mage_All_Latest]
- select
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.php b/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.php
deleted file mode 100644
index 217b68f63e5..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.php
+++ /dev/null
@@ -1,65 +0,0 @@
-_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click();
- }
-
- /**
- * Log in to Connect Manager.
- *
- * @param User $adminUser
- */
- public function loginToConnectManager(User $adminUser)
- {
- $this->fill($adminUser);
- $this->submit();
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.xml b/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.xml
deleted file mode 100644
index 3ca54d604d8..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Login.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- [name="username"]
-
-
- [name="password"]
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Navigation.php b/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Navigation.php
deleted file mode 100644
index da8e0cd0ba9..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Block/Connect/Navigation.php
+++ /dev/null
@@ -1,63 +0,0 @@
-_rootElement->find($this->settingsTab)->click();
- }
-
- /**
- * Open 'Extensions' tab
- */
- public function openExtensionsTabs()
- {
- $this->_rootElement->find($this->extensionsTab)->click();
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertChannelTextPresent.php b/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertChannelTextPresent.php
deleted file mode 100644
index 59844b97555..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertChannelTextPresent.php
+++ /dev/null
@@ -1,66 +0,0 @@
-getConnectContent()->getChannelTitle(),
- 'License agreement text is absent.'
- );
- }
-
- /**
- * Returns a string representation of successful assertion.
- *
- * @return string
- */
- public function toString()
- {
- return "Magento has connected to channel successfully";
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertSuccessUpgrade.php b/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertSuccessUpgrade.php
deleted file mode 100644
index 61c4dc6817a..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Constraint/AssertSuccessUpgrade.php
+++ /dev/null
@@ -1,60 +0,0 @@
-getMessages()->getSuccessMessages()
- );
- }
-
- /**
- * Returns a string representation of successful assertion.
- *
- * @return string
- */
- public function toString()
- {
- return "Upgrade has been successfully";
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Fixture/Connect.xml b/dev/tests/functional/tests/app/Mage/Connect/Test/Fixture/Connect.xml
deleted file mode 100644
index 072a766d89e..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Fixture/Connect.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/Page/ConnectManager.xml b/dev/tests/functional/tests/app/Mage/Connect/Test/Page/ConnectManager.xml
deleted file mode 100644
index d708e8c1379..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/Page/ConnectManager.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.php b/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.php
deleted file mode 100644
index a4f4cce845b..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-fixtureFactory = $fixtureFactory;
- $config = \Magento\Mtf\ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\GlobalConfig');
- $adminCred['username'] = $config->get('application/0/backendLogin/0/value');
- $adminCred['password'] = $config->get('application/0/backendPassword/0/value');
- $newVersion['Mage_All_Latest'] = $config->get('version/0/value');
- $adminFixture = $this->fixtureFactory->createByCode('user', ['data' => $adminCred]);
- $connectFixture = $this->fixtureFactory->createByCode('connect', ['data' => $newVersion]);
- return ['adminUser' => $adminFixture, 'connect' => $connectFixture];
- }
-
- /**
- * Injection data.
- *
- * @param ConnectManager $connectManagerPage
- */
- public function __inject(
- ConnectManager $connectManagerPage
- ) {
- $this->connectManagerPage = $connectManagerPage;
- }
-
- /**
- * Upgrade Magento via Magento Connect Manager.
- *
- * @param AssertChannelTextPresent $assertChannelTextPresent
- * @param User $adminUser
- * @param Connect $connect
- * @return array
- */
- public function test(AssertChannelTextPresent $assertChannelTextPresent, User $adminUser, Connect $connect)
- {
- $this->connectManagerPage->open();
- $this->connectManagerPage->getConnectLogin()->loginToConnectManager($adminUser);
- $assertChannelTextPresent->processAssert($this->connectManagerPage);
- $this->connectManagerPage->getConnectContent()->checkForUpgrades();
- $this->connectManagerPage->getConnectContent()->selectPackages($connect);
- $this->connectManagerPage->getConnectContent()->commitChanges();
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.xml b/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.xml
deleted file mode 100644
index 7d66894d7cd..00000000000
--- a/dev/tests/functional/tests/app/Mage/Connect/Test/TestCase/UpgradeTest.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- Upgrade
- test_type:upgrade
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueDownloadBlock.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueDownloadBlock.php
deleted file mode 100644
index fe48b9610a9..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueDownloadBlock.php
+++ /dev/null
@@ -1,122 +0,0 @@
-_rootElement->find($this->continueDeploy)->click();
- }
-
- /**
- * Continue installation.
- *
- * @return void
- */
- public function continueValidation()
- {
- $this->_rootElement->find($this->continueValidation)->click();
- }
-
- /**
- * Continue installation.
- *
- * @return void
- */
- public function continueDownload()
- {
- $this->waitForElementVisible($this->continueDownload);
- $this->_rootElement->find($this->continueDownload)->click();
- }
-
- /**
- * Continue installation.
- *
- * @return void
- */
- public function startDownload()
- {
- $this->_rootElement->find($this->startDownload)->click();
- }
-
- /**
- * Continue installation.
- *
- * @return void
- */
- public function continueMagentoInstallation()
- {
- $this->waitForElementVisible($this->continueMagentoInstallation);
- $this->_rootElement->find($this->continueMagentoInstallation)->click();
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertDownloadCompleted.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertDownloadCompleted.php
deleted file mode 100644
index 5c981898343..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertDownloadCompleted.php
+++ /dev/null
@@ -1,67 +0,0 @@
-getMessagesBlock()->getSuccessMessages());
- }
-
- /**
- * Returns a string representation of successful assertion.
- *
- * @return string
- */
- public function toString()
- {
- return "Downloading";
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessDeploy.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessDeploy.php
deleted file mode 100644
index 15e2473287d..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessDeploy.php
+++ /dev/null
@@ -1,67 +0,0 @@
-getMainBlock()->getDeployStatus());
- }
-
- /**
- * Returns a string representation of successful assertion.
- *
- * @return string
- */
- public function toString()
- {
- return "Downloading";
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertWelcomeWizardTextPresent.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertWelcomeWizardTextPresent.php
deleted file mode 100644
index cf623e08b45..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertWelcomeWizardTextPresent.php
+++ /dev/null
@@ -1,66 +0,0 @@
-getWelcomeBlock()->getWizardTitle(),
- 'This wrong page'
- );
- }
-
- /**
- * Returns a string representation of successful assertion.
- *
- * @return string
- */
- public function toString()
- {
- return "License agreement text is present on Terms & Agreement page.";
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Downloader.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/Downloader.xml
deleted file mode 100644
index 28f014aee93..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Downloader.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeploy.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeploy.xml
deleted file mode 100644
index 70dc22504a5..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeploy.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeployEnd.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeployEnd.xml
deleted file mode 100644
index 7c7d651a3d2..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderDeployEnd.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderValidation.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderValidation.xml
deleted file mode 100644
index fd592ef33fe..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderValidation.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderWelcome.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderWelcome.xml
deleted file mode 100644
index c0bf431301f..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/DownloaderWelcome.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.php
deleted file mode 100644
index 9156d816ceb..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.php
+++ /dev/null
@@ -1,101 +0,0 @@
-downloaderDownloader = $downloaderDownloader;
- }
-
- /**
- * Install Magento via web interface.
- *
- * @param array $configData
- * @return array
- */
- public function test($configData)
- {
- // Steps:
- $this->downloaderDownloader->open();
- // Start downloading
- $this->downloaderDownloader->getContinueDownloadBlock()->startDownload();
- $i = 1;
- while ($i <= 15 and (!(($this->downloaderDownloader->getMessagesBlock()->isVisibleMessage('success')) or
- ($this->downloaderDownloader->getMessagesBlock()->isVisibleMessage('error'))))
- ) {
- sleep(60);
- $i++;
-// ObjectManager::getInstance()->create(EventManagerInterface::class)->dispatchEvent(array('exception'));
- }
-
- $this->downloaderDownloader->getMessagesBlock()->getSuccessMessages();
- $this->downloaderDownloader->getContinueDownloadBlock()->continueMagentoInstallation();
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.xml b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.xml
deleted file mode 100644
index e27bdf08401..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderPart2Test.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Install with default values
- Welcome to Magento Downloader!
- test_type:install
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.php
deleted file mode 100644
index b21ab810a7a..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-downloaderWelcome = $downloaderWelcome;
- $this->downloaderValidation = $downloaderValidation;
- $this->downloaderDeploy = $downloaderDeploy;
- $this->downloaderDownloader = $downloaderDownloader;
- $this->assertSuccessDeploy = $assertSuccessDeploy;
- $this->downloaderDeployEnd = $downloaderDeployEnd;
- }
-
- /**
- * Install Magento via web interface.
- *
- * @param AssertWelcomeWizardTextPresent $assertWelcomeWizardTextPresent
- * @param array $configData
- * @return array
- */
- public function test(AssertWelcomeWizardTextPresent $assertWelcomeWizardTextPresent, $configData)
- {
- // Steps:
- $this->downloaderWelcome->open();
- // Verify license agreement.
- $assertWelcomeWizardTextPresent->processAssert($this->downloaderWelcome);
- $this->downloaderWelcome->getContinueDownloadBlock()->continueValidation();
- $this->downloaderValidation->getContinueDownloadBlock()->continueDeploy();
- $this->downloaderDeploy->getContinueDownloadBlock()->continueDeploy();
- $this->assertSuccessDeploy->processAssert($this->downloaderDeployEnd);
- $this->downloaderDeploy->getContinueDownloadBlock()->continueDownload();
-
- }
-}
diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.xml b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.xml
deleted file mode 100644
index dd8049ef6e0..00000000000
--- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/DownloaderTest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- Install with default values
- Welcome to Magento Downloader!
- test_type:install
-
-
-
diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download.xml
deleted file mode 100644
index cdcf2aa783a..00000000000
--- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download2.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download2.xml
deleted file mode 100644
index 1086c529b63..00000000000
--- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_download2.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgradeconnectce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgradeconnectce.xml
deleted file mode 100644
index 4369452123e..00000000000
--- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgradeconnectce.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/downloader/.htaccess b/downloader/.htaccess
deleted file mode 100644
index e8420e693bb..00000000000
--- a/downloader/.htaccess
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- RemoveOutputFilter DEFLATE
- RemoveOutputFilter GZIP
-
-
-
-
- order allow,deny
- deny from all
-
\ No newline at end of file
diff --git a/downloader/Maged/.htaccess b/downloader/Maged/.htaccess
deleted file mode 100644
index 93169e4eb44..00000000000
--- a/downloader/Maged/.htaccess
+++ /dev/null
@@ -1,2 +0,0 @@
-Order deny,allow
-Deny from all
diff --git a/downloader/Maged/BruteForce/Validator.php b/downloader/Maged/BruteForce/Validator.php
deleted file mode 100644
index a7e83aa4c01..00000000000
--- a/downloader/Maged/BruteForce/Validator.php
+++ /dev/null
@@ -1,148 +0,0 @@
-model = $model;
- }
-
- /**
- * @return bool
- */
- public function isCanLogin()
- {
- $badAttempts = $this->getBadAttempts();
- $configAttemptsCount = $this->getConfigAttemptsCount();
-
- if ($badAttempts >= $configAttemptsCount and $badAttempts % $configAttemptsCount === 0) {
- $lastBadLogin = intval($this->model->get(self::MODEL_KEY_LAST_BAD_TIME));
- if ($lastBadLogin > 0) {
- $timeDiff = $this->model->get(self::MODEL_KEY_DIFF_TIME_TO_ATTEMPT, self::DEFAULT_DIFF_TIME_TO_ATTEMPT);
- $currentTime = time();
- $checkTime = $lastBadLogin + $timeDiff;
- if ($checkTime > $currentTime) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * @return int
- */
- protected function getBadAttempts()
- {
- return (int)$this->model->get(self::MODEL_KEY_BAD_ATTEMPTS_COUNT, self::DEFAULT_BAD_ATTEMPTS_COUNT);
- }
-
- /**
- * @return int
- */
- protected function getConfigAttemptsCount()
- {
- return (int)$this->model->get(self::MODEL_KEY_ATTEMPTS_COUNT, self::DEFAULT_ATTEMPTS_COUNT);
- }
-
- /**
- * @return int
- */
- public function getTimeToAttempt()
- {
- return (int)$this->model->get(self::MODEL_KEY_DIFF_TIME_TO_ATTEMPT, self::DEFAULT_DIFF_TIME_TO_ATTEMPT);
- }
-
- /**
- * @return $this
- */
- public function doGoodLogin()
- {
- $this->reset();
- return $this;
- }
-
- /**
- * @return void
- */
- public function reset()
- {
- $this->model
- ->set(self::MODEL_KEY_BAD_ATTEMPTS_COUNT, self::DEFAULT_BAD_ATTEMPTS_COUNT)
- ->set(self::MODEL_KEY_DIFF_TIME_TO_ATTEMPT, self::DEFAULT_DIFF_TIME_TO_ATTEMPT)
- ->delete(self::MODEL_KEY_LAST_BAD_TIME)
- ->save();
- }
-
- /**
- * @return $this
- */
- public function doBadLogin()
- {
- $badAttempts = $this->getBadAttempts() + 1;
- $configAttemptsCount = $this->getConfigAttemptsCount();
- $timeToNextLogin = $this->getDiffTimeToNextAttempt();
-
- if ($badAttempts % $configAttemptsCount == 0 and $badAttempts != $configAttemptsCount) {
- $timeToNextLogin += self::DEFAULT_DIFF_TIME_TO_ATTEMPT;
- }
-
- $this->model
- ->set(self::MODEL_KEY_BAD_ATTEMPTS_COUNT, $badAttempts)
- ->set(self::MODEL_KEY_DIFF_TIME_TO_ATTEMPT, $timeToNextLogin)
- ->set(self::MODEL_KEY_ATTEMPTS_COUNT, $configAttemptsCount)
- ->set(self::MODEL_KEY_LAST_BAD_TIME, time())
- ->save();
-
- return $this;
- }
-
- /**
- * @return int
- */
- protected function getDiffTimeToNextAttempt()
- {
- return (int)$this->model->get(self::MODEL_KEY_DIFF_TIME_TO_ATTEMPT, self::DEFAULT_DIFF_TIME_TO_ATTEMPT);
- }
-}
diff --git a/downloader/Maged/Connect.php b/downloader/Maged/Connect.php
deleted file mode 100644
index 0beb9a8548a..00000000000
--- a/downloader/Maged/Connect.php
+++ /dev/null
@@ -1,519 +0,0 @@
-getConfig();
- $this->getSingleConfig();
- $this->getFrontend();
- }
-
- /**
- * Destructor, sends Console footer if Console started
- */
- public function __destruct()
- {
- if ($this->_consoleStarted) {
- $this->_consoleFooter();
- }
- }
-
- /**
- * Initialize instance
- *
- * @return Maged_Connect
- */
- public static function getInstance()
- {
- if (!self::$_instance) {
- self::$_instance = new self;
- }
- return self::$_instance;
- }
-
- /**
- * Retrieve object of config and set it to Mage_Connect_Command
- *
- * @return Mage_Connect_Config
- */
- public function getConfig()
- {
- if (!$this->_config) {
- $this->_config = new Mage_Connect_Config();
- $ftp=$this->_config->__get('remote_config');
- if(!empty($ftp)){
- $packager = new Mage_Connect_Packager();
- list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp);
- $this->_config=$config;
- $this->_sconfig=$cache;
- }
- $this->_config->magento_root = dirname(dirname(__FILE__)).DS.'..';
- Mage_Connect_Command::setConfigObject($this->_config);
- }
- return $this->_config;
- }
-
- /**
- * Retrieve object of single config and set it to Mage_Connect_Command
- *
- * @param bool $reload
- * @return Mage_Connect_Singleconfig
- */
- public function getSingleConfig($reload = false)
- {
- if(!$this->_sconfig || $reload) {
- $this->_sconfig = new Mage_Connect_Singleconfig(
- $this->getConfig()->magento_root . DIRECTORY_SEPARATOR
- . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR
- . Mage_Connect_Singleconfig::DEFAULT_SCONFIG_FILENAME
- );
- }
- Mage_Connect_Command::setSconfig($this->_sconfig);
- return $this->_sconfig;
-
- }
-
- /**
- * Retrieve object of frontend and set it to Mage_Connect_Command
- *
- * @return Maged_Connect_Frontend
- */
- public function getFrontend()
- {
- if (!$this->_frontend) {
- $this->_frontend = new Maged_Connect_Frontend();
- Mage_Connect_Command::setFrontendObject($this->_frontend);
- }
- return $this->_frontend;
- }
-
- /**
- * Retrieve lof from frontend
- *
- * @return array
- */
- public function getLog()
- {
- return $this->getFrontend()->getLog();
- }
-
- /**
- * Retrieve output from frontend
- *
- * @return array
- */
- public function getOutput()
- {
- return $this->getFrontend()->getOutput();
- }
-
- /**
- * Clean registry
- *
- * @return Maged_Connect
- */
- public function cleanSconfig()
- {
- $this->getSingleConfig()->clear();
- return $this;
- }
-
- /**
- * Delete directory recursively
- *
- * @param string $path
- * @return Maged_Connect
- */
- public function delTree($path) {
- if (@is_dir($path)) {
- $entries = @scandir($path);
- foreach ($entries as $entry) {
- if ($entry != '.' && $entry != '..') {
- $this->delTree($path.DS.$entry);
- }
- }
- @rmdir($path);
- } else {
- @unlink($path);
- }
- return $this;
- }
-
- /**
- * Run commands from Mage_Connect_Command
- *
- * @param string $command
- * @param array $options
- * @param array $params
- * @return boolean|Mage_Connect_Error
- */
- public function run($command, $options=array(), $params=array())
- {
- @set_time_limit(0);
- @ini_set('memory_limit', '256M');
-
- if (empty($this->_cmdCache[$command])) {
- Mage_Connect_Command::getCommands();
- /**
- * @var $cmd Mage_Connect_Command
- */
- $cmd = Mage_Connect_Command::getInstance($command);
- if ($cmd instanceof Mage_Connect_Error) {
- return $cmd;
- }
- $this->_cmdCache[$command] = $cmd;
- } else {
- /**
- * @var $cmd Mage_Connect_Command
- */
- $cmd = $this->_cmdCache[$command];
- }
- $ftp=$this->getConfig()->remote_config;
- if(strlen($ftp)>0){
- $options=array_merge($options, array('ftp'=>$ftp));
- }
- $cmd->run($command, $options, $params);
- if ($cmd->ui()->hasErrors()) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Set remote Config by URI
- *
- * @param $uri
- * @return Maged_Connect
- */
- public function setRemoteConfig($uri)
- {
- $this->getConfig()->remote_config=$uri;
- return $this;
- }
-
- /**
- * Show Errors
- *
- * @param array $errors Error messages
- * @return Maged_Connect
- */
- public function showConnectErrors($errors)
- {
- echo '';
-
- return $this;
- }
-
- /**
- * Run Mage_Connect_Command with html output console style
- *
- * @throws Maged_Exception
- * @param array|string|Maged_Model $runParams command, options, params, comment, success_callback, failure_callback
- * @return bool|Mage_Connect_Error
- */
- public function runHtmlConsole($runParams)
- {
- if (function_exists('apache_setenv')) {
- apache_setenv('no-gzip', '1');
- }
- @ini_set('zlib.output_compression', 0);
- @ini_set('implicit_flush', 1);
- for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
- ob_implicit_flush();
-
- $fe = $this->getFrontend();
- $oldLogStream = $fe->getLogStream();
- $fe->setLogStream('stdout');
-
- if ($runParams instanceof Maged_Model) {
- $run = $runParams;
- } elseif (is_array($runParams)) {
- $run = new Maged_Model_Connect_Request($runParams);
- } elseif (is_string($runParams)) {
- $run = new Maged_Model_Connect_Request(array('comment'=>$runParams));
- } else {
- throw Maged_Exception("Invalid run parameters");
- }
-
- if (!$run->get('no-header')) {
- $this->_consoleHeader();
- }
- echo htmlspecialchars($run->get('comment')).' ';
-
- if ($command = $run->get('command')) {
- $result = $this->run($command, $run->get('options'), $run->get('params'));
-
- if ($this->getFrontend()->hasErrors()) {
- echo " CONNECT ERROR: ";
- foreach ($this->getFrontend()->getErrors(false) as $error) {
- echo nl2br($error[1]);
- echo ' ';
- }
- }
- echo '';
- } else {
- $result = false;
- }
- if ($this->getFrontend()->getErrors() || !$run->get('no-footer')) {
- //$this->_consoleFooter();
- $fe->setLogStream($oldLogStream);
- }
- return $result;
- }
-
- /**
- * Show HTML Console Header
- *
- * @return void
- */
- protected function _consoleHeader() {
- if (!$this->_consoleStarted) {
- $validateKey = md5(time());
- $sessionModel = new Maged_Model_Session();
- $sessionModel->set('validate_cache_key', $validateKey); ?>
-
-
-
-
-_consoleStarted = true;
- }
- }
-
- /**
- * Show HTML Console Footer
- *
- * @return void
- */
- protected function _consoleFooter() {
- if ($this->_consoleStarted) {
-?>
-
-
-_consoleStarted = false;
- }
- }
-}
diff --git a/downloader/Maged/Connect/Frontend.php b/downloader/Maged/Connect/Frontend.php
deleted file mode 100644
index 6c230b1aa63..00000000000
--- a/downloader/Maged/Connect/Frontend.php
+++ /dev/null
@@ -1,152 +0,0 @@
-_logStream = $stream;
- return $this;
- }
-
- /**
- * Retrieve log stream
- *
- * @return string
- */
- public function getLogStream()
- {
- return $this->_logStream;
- }
-
- /**
- * Echo data from executed command
- */
- public function output($data)
- {
-
- $this->_out = $data;
-
- if ('stdout'===$this->_logStream) {
- if (is_string($data)) {
- echo $data." ".str_repeat(" ", 256);
- } elseif (is_array($data)) {
- $data = array_pop($data);
- if (!empty($data['message']) && is_string($data['message'])) {
- echo $data['message']." ".str_repeat(" ", 256);
- } elseif (!empty($data['data'])) {
- if (is_string($data['data'])) {
- echo $data['data']." ".str_repeat(" ", 256);
- } else {
- if (isset($data['title'])) {
- echo $data['title']." ".str_repeat(" ", 256);
- }
- if (is_array($data['data'])) {
- foreach ($data['data'] as $row) {
- foreach ($row as $msg) {
- echo " ".$msg;
- }
- echo " ".str_repeat(" ", 256);
- }
- } else {
- echo " ".$data['data'];
- }
- }
- }
- } else {
- print_r($data);
- }
- }
- }
-
- /**
- * Method for ask client about rewrite all files.
- *
- * @param $string
- */
- public function confirm($string)
- {
- $confirmString = htmlentities($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
- $formId = htmlspecialchars($_POST['form_id'], ENT_COMPAT | ENT_HTML401, 'UTF-8');
-
- echo <<
-SCRIPT;
- }
-
- /**
- * Retrieve output cache
- *
- * @param bool $clearPrevious
- * @return array|mixed
- */
- public function getOutput($clearPrevious = false)
- {
- return $this->_out;
- }
-
-}
-
diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php
deleted file mode 100644
index 35167184d85..00000000000
--- a/downloader/Maged/Controller.php
+++ /dev/null
@@ -1,1264 +0,0 @@
- 0) {
- $post['ftp_path'] = '/' . trim($post['ftp_path'], '\\/') . '/';
- } else {
- $post['ftp_path'] = '/';
- }
-
- $start = stripos($post['ftp_host'],'ftp://');
- if ($start !== false){
- $post['ftp_proto'] = 'ftp://';
- $post['ftp_host'] = substr($post['ftp_host'], $start + 6 - 1);
- }
- $start = stripos($post['ftp_host'],'ftps://');
- if ($start !== false) {
- $post['ftp_proto'] = 'ftps://';
- $post['ftp_host'] = substr($post['ftp_host'], $start + 7 - 1);
- }
-
- $post['ftp_host'] = trim($post['ftp_host'], '\\/');
-
- if (!empty($post['ftp_login']) && !empty($post['ftp_password'])){
- $ftp = sprintf("%s%s:%s@%s%s",
- $post['ftp_proto'],
- $post['ftp_login'],
- $post['ftp_password'],
- $post['ftp_host'],
- $post['ftp_path']
- );
- } elseif (!empty($post['ftp_login'])) {
- $ftp = sprintf(
- "%s%s@%s%s",
- $post['ftp_proto'],
- $post['ftp_login'],
- $post['ftp_host'],
- $post['ftp_path']
- );
- } else {
- $ftp = $post['ftp_proto'] . $post['ftp_host'] . $post['ftp_path'];
- }
-
- $_POST['ftp'] = $ftp;
- return $ftp;
- }
-
- /**
- * NoRoute
- */
- public function norouteAction()
- {
- header("HTTP/1.0 404 Invalid Action");
- echo $this->view()->template('noroute.phtml');
- }
-
- /**
- * Login
- */
- public function loginAction()
- {
- $this->view()->set('username', !empty($_GET['username']) ? $_GET['username'] : '');
- echo $this->view()->template('login.phtml');
- }
-
- /**
- * Logout
- */
- public function logoutAction()
- {
- $this->session()->logout();
- $this->redirect($this->url());
- }
-
- /**
- * Index
- */
- public function indexAction()
- {
- $config = $this->config();
- if (!$this->isInstalled()) {
- $this->view()->set('mage_url', dirname(dirname($_SERVER['SCRIPT_NAME'])));
- $this->view()->set(
- 'use_custom_permissions_mode',
- $config->__get('use_custom_permissions_mode')
- ? $config->__get('use_custom_permissions_mode')
- : '0'
- );
- $this->view()->set('mkdir_mode', decoct($config->__get('global_dir_mode')));
- $this->view()->set('chmod_file_mode', decoct($config->__get('global_file_mode')));
- $this->view()->set('protocol', $config->__get('protocol'));
- $this->channelConfig()->setInstallView($config,$this->view());
-
- echo $this->view()->template('install/download.phtml');
- } elseif (!$config->sync_pear) {
- $this->model('connect', true)->connect()->run('sync');
- $this->forward('connectPackages');
- } else {
- $this->forward('connectPackages');
- }
- }
-
- /**
- * Empty Action
- */
- public function emptyAction()
- {
- $this->model('connect', true)
- ->connect()
- ->runHtmlConsole('Please wait, preparing for updates...');
- }
-
- /**
- * Install all magento
- */
- public function connectInstallAllAction()
- {
- $p = &$_POST;
- $this->getFtpPost($p);
- $errors = $this->model('connect', true)->validateConfigPost($p);
- /* todo show errors */
- if ($errors) {
- $message = "CONNECT ERROR: ";
- foreach ($errors as $err) {
- $message .= $err . "\n";
- }
- $this->model('connect', true)->connect()->runHtmlConsole($message);
- $this->model('connect', true)->connect()->showConnectErrors($errors);
- return;
- }
-
- if( 1 == $p['inst_protocol']){
- $this->model('connect', true)->connect()->setRemoteConfig($this->getFtpPost($p));
- }
-
- $this->channelConfig()->setPostData($this->config(),$p);
-
- $chan = $this->config()->__get('root_channel');
- $this->model('connect', true)->saveConfigPost($_POST);
- $this->channelConfig()->setSettingsSession($_POST, $this->session());
- $this->model('connect', true)->installAll(!empty($_GET['force']), $chan);
- $p = null;
- }
-
- /**
- * Connect packages
- */
- public function connectPackagesAction()
- {
- $connect = $this->model('connect', true);
-
- if (isset($_GET['loggedin'])) {
- $connect->connect()->run('sync');
- }
-
- $this->view()->set('connect', $connect);
- $this->view()->set('channel_config', $this->channelConfig());
- $remoteConfig = $this->config()->remote_config;
- if (!$this->isWritable() && empty($remoteConfig)) {
- $this->view()->set('writable_warning', true);
- }
-
- echo $this->view()->template('connect/packages.phtml');
- }
-
- /**
- * Connect packages POST
- */
- public function connectPackagesPostAction()
- {
- if (!$this->_validateFormKey()) {
- echo "INVALID POST DATA";
- return;
- }
- $actions = isset($_POST['actions']) ? $_POST['actions'] : array();
- if (isset($_POST['ignore_local_modification'])) {
- $ignoreLocalModification = $_POST['ignore_local_modification'];
- } else {
- $ignoreLocalModification = '';
- }
- $this->model('connect', true)->applyPackagesActions($actions, $ignoreLocalModification);
- }
-
- /**
- * Prepare package to install, get dependency info.
- */
- public function connectPreparePackagePostAction()
- {
- if (!$this->_validateFormKey()) {
- echo "INVALID POST DATA";
- return;
- }
- if (!$_POST) {
- echo "INVALID POST DATA";
- return;
- }
- $prepareResult = $this->model('connect', true)->prepareToInstall($_POST['install_package_id']);
-
- $packages = isset($prepareResult['data']) ? $prepareResult['data'] : array();
- $errors = isset($prepareResult['errors']) ? $prepareResult['errors'] : array();
-
- $this->view()->set('packages', $packages);
- $this->view()->set('errors', $errors);
- $this->view()->set('package_id', $_POST['install_package_id']);
-
- echo $this->view()->template('connect/packages_prepare.phtml');
- }
-
- /**
- * Install package
- */
- public function connectInstallPackagePostAction()
- {
- if (!$this->_validateFormKey()) {
- echo "INVALID POST DATA";
- return;
- }
- if (!$_POST) {
- echo "INVALID POST DATA";
- return;
- }
- $this->model('connect', true)->installPackage($_POST['install_package_id']);
- }
-
- /**
- * Install uploaded package
- */
- public function connectInstallPackageUploadAction()
- {
- if (!$this->_validateFormKey()) {
- echo "No file was uploaded";
- return;
- }
-
- if (!$_FILES) {
- echo "No file was uploaded";
- return;
- }
-
- if(empty($_FILES['file'])) {
- echo "No file was uploaded";
- return;
- }
-
- $info =& $_FILES['file'];
-
- if(0 !== intval($info['error'])) {
- echo "File upload problem";
- return;
- }
-
- $target = $this->_mageDir . DS . "var/" . uniqid() . $info['name'];
- $res = move_uploaded_file($info['tmp_name'], $target);
- if(false === $res) {
- echo "Error moving uploaded file";
- return;
- }
-
- $this->model('connect', true)->installUploadedPackage($target);
- @unlink($target);
- }
-
- /**
- * Clean cache on ajax request
- */
- public function cleanCacheAction()
- {
- $result = $this->cleanCache(true);
- echo json_encode($result);
- }
-
- /**
- * Settings
- */
- public function settingsAction()
- {
- $config = $this->config();
- $this->view()->set('preferred_state', $config->__get('preferred_state'));
- $this->view()->set('protocol', $config->__get('protocol'));
-
- $this->view()->set('use_custom_permissions_mode', $config->__get('use_custom_permissions_mode'));
- $this->view()->set('mkdir_mode', decoct($config->__get('global_dir_mode')));
- $this->view()->set('chmod_file_mode', decoct($config->__get('global_file_mode')));
-
- $this->channelConfig()->setSettingsView($this->session(), $this->view());
-
- $fs_disabled =! $this->isWritable();
- $ftpParams = $config->__get('remote_config') ? @parse_url($config->__get('remote_config')) : '';
-
- $this->view()->set('fs_disabled', $fs_disabled);
- $this->view()->set('deployment_type', ($fs_disabled || !empty($ftpParams) ? 'ftp' : 'fs'));
-
- if (!empty($ftpParams)) {
- $this->view()->set('ftp_host', sprintf("%s://%s", $ftpParams['scheme'], $ftpParams['host']));
- $this->view()->set('ftp_login', $ftpParams['user']);
- $this->view()->set('ftp_password', $ftpParams['pass']);
- $this->view()->set('ftp_path', $ftpParams['path']);
- }
- echo $this->view()->template('settings.phtml');
- }
-
- /**
- * Settings post
- */
- public function settingsPostAction()
- {
- if (!$this->_validateFormKey()) {
- $this->session()->addMessage('error', "Unable to save settings");
- $this->redirect($this->url('settings'));
- return;
- }
- if ($_POST) {
- $ftp = $this->getFtpPost($_POST);
-
- /* clear startup messages */
- $this->config();
- $this->session()->getMessages();
-
- $errors = $this->model('connect', true)->validateConfigPost($_POST);
- if ($errors) {
- foreach ($errors as $err) {
- $this->session()->addMessage('error', $err);
- }
- $this->redirect($this->url('settings'));
- return;
- }
- try {
- if ('ftp' == $_POST['deployment_type'] && !empty($_POST['ftp_host'])) {
- $this->model('connect', true)->connect()->setRemoteConfig($ftp);
- } else {
- $this->model('connect', true)->connect()->setRemoteConfig('');
- $_POST['ftp'] = '';
- }
- $this->channelConfig()->setPostData($this->config(), $_POST);
- $this->model('connect', true)->saveConfigPost($_POST);
- $this->channelConfig()->setSettingsSession($_POST, $this->session());
- $this->model('connect', true)->connect()->run('sync');
- } catch (Exception $e) {
- $this->session()->addMessage('error', "Unable to save settings: " . $e->getMessage());
- }
- }
- $this->redirect($this->url('settings'));
- }
-
- //////////////////////////// ABSTRACT
-
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->_rootDir = dirname(dirname(__FILE__));
- $this->_mageDir = dirname($this->_rootDir);
- }
-
- /**
- * Run
- */
- public static function run()
- {
- try {
- self::singleton()->dispatch();
- } catch (Exception $e) {
- echo $e->getMessage();
- }
- }
-
- /**
- * Initialize object of class
- *
- * @return Maged_Controller
- */
- public static function singleton()
- {
- if (!self::$_instance) {
- self::$_instance = new self;
-
- if (self::$_instance->isDownloaded() && self::$_instance->isInstalled()) {
- Mage::app('', 'store', array('global_ban_use_cache'=>true));
- Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
- }
- }
- return self::$_instance;
- }
-
- /**
- * Retrieve Downloader root dir
- *
- * @return string
- */
- public function getRootDir()
- {
- return $this->_rootDir;
- }
-
- /**
- * Retrieve Magento root dir
- *
- * @return string
- */
- public function getMageDir()
- {
- return $this->_mageDir;
- }
-
- /**
- * Retrieve Mage Class file path
- *
- * @return string
- */
- public function getMageFilename()
- {
- $ds = DIRECTORY_SEPARATOR;
- return $this->getMageDir() . $ds . 'app' . $ds . 'Mage.php';
- }
-
- /**
- * Retrieve path for Varien_Profiler
- *
- * @return string
- */
- public function getVarFilename()
- {
- $ds = DIRECTORY_SEPARATOR;
- return $this->getMageDir() . $ds . 'lib' . $ds . 'Varien' . $ds . 'Profiler.php';
- }
-
- /**
- * Retrieve downloader file path
- *
- * @param string $name
- * @return string
- */
- public function filepath($name = '')
- {
- $ds = DIRECTORY_SEPARATOR;
- return rtrim($this->getRootDir() . $ds . str_replace('/', $ds, $name), $ds);
- }
-
- /**
- * Retrieve object of view
- *
- * @return Maged_View
- */
- public function view()
- {
- if (!$this->_view) {
- $this->_view = new Maged_View;
- }
- return $this->_view;
- }
-
- /**
- * Retrieve object of model
- *
- * @param string $model
- * @param boolean $singleton
- * @return Maged_Model
- */
- public function model($model = null, $singleton = false)
- {
- if ($singleton && isset($this->_singletons[$model])) {
- return $this->_singletons[$model];
- }
-
- if (is_null($model)) {
- $class = 'Maged_Model';
- } else {
- $class = 'Maged_Model_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', $model)));
- if (!class_exists($class, false)) {
- include_once str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
- }
- }
-
- $object = new $class();
-
- if ($singleton) {
- $this->_singletons[$model] = $object;
- }
-
- return $object;
- }
-
- /**
- * Retrieve object of config
- *
- * @return Mage_Connect_Config
- */
- public function config()
- {
- if (!$this->_config) {
- $this->_config = $this->model('connect', true)->connect()->getConfig();
- if (!$this->_config->isLoaded()) {
- $this->session()->addMessage('error', "Settings has not been loaded. Used default settings");
- if ($this->_config->getError()) {
- $this->session()->addMessage('error', $this->_config->getError());
- }
- }
- }
- return $this->_config;
- }
-
- /**
- * Retrieve object of channel config
- *
- * @return Maged_Model_Config_Interface
- */
- public function channelConfig()
- {
- if (!$this->_localConfig) {
- $this->_localConfig = $this->model('config', true)->getChannelConfig();
- }
- return $this->_localConfig;
- }
-
- /**
- * Retrieve object of session
- *
- * @return Maged_Model_Session
- */
- public function session()
- {
- if (!$this->_session) {
- $this->_session = $this->model('session')->start();
- }
- return $this->_session;
- }
-
- /**
- * Set Controller action
- *
- * @param string $action
- * @return Maged_Controller
- */
- public function setAction($action=null)
- {
- if (is_null($action)) {
- if (!empty($this->_action)) {
- return $this;
- }
- $action = !empty($_GET[self::ACTION_KEY]) ? $_GET[self::ACTION_KEY] : 'index';
- }
- if (empty($action) || !is_string($action) || !method_exists($this, $this->getActionMethod($action))) {
- //$action = 'noroute';
- $action = 'index';
- }
- $this->_action = $action;
- return $this;
- }
-
- /**
- * Retrieve Controller action name
- *
- * @return string
- */
- public function getAction()
- {
- return $this->_action;
- }
-
- /**
- * Set Redirect to URL
- *
- * @param string $url
- * @param bool $force
- * @return Maged_Controller
- */
- public function redirect($url, $force = false)
- {
- $this->_redirectUrl = $url;
- if ($force) {
- $this->processRedirect();
- }
- return $this;
- }
-
- /**
- * Precess redirect
- *
- * @return Maged_Controller
- */
- public function processRedirect()
- {
- if ($this->_redirectUrl) {
- if (headers_sent()) {
- echo '';
- exit;
- } else {
- header("Location: " . $this->_redirectUrl);
- exit;
- }
- }
- return $this;
- }
-
- /**
- * Forward to action
- *
- * @param string $action
- * @return Maged_Controller
- */
- public function forward($action)
- {
- $this->setAction($action);
- $this->_isDispatched = false;
- return $this;
- }
-
- /**
- * Retrieve action method by action name
- *
- * @param string $action
- * @return string
- */
- public function getActionMethod($action = null)
- {
- $method = (!is_null($action) ? $action : $this->_action) . 'Action';
- return $method;
- }
-
- /**
- * Generate URL for action
- *
- * @param string $action
- * @param array $params
- */
- public function url($action = '', $params = array())
- {
- $args = array();
- foreach ($params as $k => $v) {
- $args[] = sprintf('%s=%s', rawurlencode($k), rawurlencode($v));
- }
- $args = $args ? join('&', $args) : '';
-
- return sprintf('%s?%s=%s%s', $_SERVER['SCRIPT_NAME'], self::ACTION_KEY, rawurlencode($action), $args);
- }
-
- /**
- * Add domain policy header according to admin area settings
- */
- protected function _addDomainPolicyHeader()
- {
- if ($this->isInstalled()) {
- /** @var Mage_Core_Model_Domainpolicy $domainPolicy */
- $domainPolicy = Mage::getModel('core/domainpolicy');
- if ($domainPolicy) {
- $policy = $domainPolicy->getBackendPolicy();
- if ($policy) {
- header('X-Frame-Options: ' . $policy);
- }
- }
- }
- }
-
- /**
- * Dispatch process
- */
- public function dispatch()
- {
- if (class_exists('Mage')) {
- if (Mage::getConfig() == null) {
- Mage::init();
- }
- $baseUrl = Mage::getBaseUrl(
- Mage_Core_Model_Store::URL_TYPE_LINK, Mage::getSingleton('adminhtml/url')->getSecure()
- );
- if (strpos($baseUrl, 'https') === 0) {
- $request = Mage::app()->getRequest();
- if (!$request->isSecure()) {
- Mage::app()->getFrontController()->getResponse()
- ->setRedirect(rtrim($baseUrl, '/') . $request->getRequestUri(), 301)->sendResponse();
- exit;
- }
- }
- }
-
- header('Content-type: text/html; charset=UTF-8');
-
- $this->_addDomainPolicyHeader();
-
- $this->setAction();
-
- if (!$this->isInstalled()) {
- if (!in_array($this->getAction(), array('index', 'connectInstallAll', 'empty', 'cleanCache'))) {
- $this->setAction('index');
- }
- } else {
- try {
- /** @var Maged_BruteForce_Validator $bruteForce */
- $bruteForce = $this->createBruteForceValidator();
- if ($bruteForce->isCanLogin()) {
- $this->session()->authenticate($bruteForce);
- } else {
- throw new Exception ("Access is locked. Please try again in a few minutes.");
- }
- } catch (Exception $e) {
- $this->session()->addMessage("error", $e->getMessage());
- $this->setAction("login");
- }
- }
-
- while (!$this->_isDispatched) {
- $this->_isDispatched = true;
-
- $method = $this->getActionMethod();
- $this->$method();
- }
-
- $this->processRedirect();
- }
-
- /**
- * Check root dir is writable
- *
- * @return bool
- */
- public function isWritable()
- {
- if (is_null($this->_writable)) {
- $this->_writable = is_writable($this->getMageDir() . DIRECTORY_SEPARATOR)
- && is_writable($this->filepath())
- && (!file_exists($this->filepath('config.ini') || is_writable($this->filepath('config.ini'))));
- }
- return $this->_writable;
- }
-
- /**
- * Check is Magento files downloaded
- *
- * @return bool
- */
- public function isDownloaded()
- {
- return file_exists($this->getMageFilename()) && file_exists($this->getVarFilename());
- }
-
- /**
- * Check is Magento installed
- *
- * @return bool
- */
- public function isInstalled()
- {
- if (!$this->isDownloaded()) {
- return false;
- }
- if (!class_exists('Mage', false)) {
- if (!file_exists($this->getMageFilename())) {
- return false;
- }
- include_once $this->getMageFilename();
- Mage::setIsDownloader();
- }
- return Mage::isInstalled();
- }
-
- /**
- * Retrieve Maintenance flag
- *
- * @return bool
- */
- protected function _getMaintenanceFlag()
- {
- if (is_null($this->_maintenance)) {
- $this->_maintenance = !empty($_REQUEST['maintenance']) && $_REQUEST['maintenance'] == '1' ? true : false;
- }
- return $this->_maintenance;
- }
-
- /**
- * Retrieve Maintenance Flag file path
- *
- * @return string
- */
- protected function _getMaintenanceFilePath()
- {
- if (is_null($this->_maintenanceFile)) {
- $path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR;
- $this->_maintenanceFile = $path . 'maintenance.flag';
- }
- return $this->_maintenanceFile;
- }
-
- /**
- * Begin install package(s)
- */
- public function startInstall()
- {
- if ($this->_getMaintenanceFlag()) {
- $maintenance_filename='maintenance.flag';
- $config = $this->config();
- if (!$this->isWritable() || strlen($config->__get('remote_config')) > 0) {
- $ftpObj = new Mage_Connect_Ftp();
- $ftpObj->connect($config->__get('remote_config'));
- $tempFile = tempnam(sys_get_temp_dir(),'maintenance');
- @file_put_contents($tempFile, 'maintenance');
- $ftpObj->upload($maintenance_filename, $tempFile);
- $ftpObj->close();
- } else {
- @file_put_contents($this->_getMaintenanceFilePath(), 'maintenance');
- }
- }
-
- if (!empty($_GET['archive_type'])) {
-
- $backupName = $_GET['backup_name'];
- $connect = $this->model('connect', true)->connect();
- $isSuccess = true;
-
- if (!preg_match('/^[a-zA-Z0-9\ ]{0,50}$/', $backupName)) {
- $connect->runHtmlConsole('Please use only letters (a-z or A-Z), numbers (0-9) or space in '
- . 'Backup Name field. Other characters are not allowed.');
- $isSuccess = false;
- }
-
- if ($isSuccess) {
- $isSuccess = $this->_createBackup($_GET['archive_type'], $_GET['backup_name']);
- }
-
- if (!$isSuccess) {
- $this->endInstall();
- $this->cleanCache();
- throw new Mage_Exception(
- 'The installation process has been canceled because of the backup creation error'
- );
- }
- }
- }
-
- /**
- * End install package(s)
- */
- public function endInstall()
- {
- //$connect
- /** @var $connect Maged_Model_Connect */
- $frontend = $this->model('connect', true)->connect()->getFrontend();
- if (!($frontend instanceof Maged_Connect_Frontend)) {
- $this->cleanCache();
- }
- }
-
- /**
- * Clean cache
- *
- * @param bool $validate
- * @return array
- */
- protected function cleanCache($validate = false)
- {
- $result = true;
- $message = '';
- try {
- if ($this->isInstalled()) {
- if ($validate) {
- $result = $this->session()->validateCleanCacheKey();
- }
- if ($result) {
- if (!empty($_REQUEST['clean_sessions'])) {
- Mage::app()->cleanAllSessions();
- $message .= 'Session cleaned successfully. ';
- }
- Mage::app()->cleanCache();
-
- // reinit config and apply all updates
- Mage::app()->getConfig()->reinit();
- Mage_Core_Model_Resource_Setup::applyAllUpdates();
- Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
- $message .= 'Cache cleaned successfully';
- } else {
- $message .= 'Validation failed';
- }
- }
- } catch (Exception $e) {
- $result = false;
- $message = "Exception during cache and session cleaning: ".$e->getMessage();
- $this->session()->addMessage('error', $message);
- }
-
- if ($result && $this->_getMaintenanceFlag()) {
- $maintenance_filename='maintenance.flag';
- $config = $this->config();
- if (!$this->isWritable() && strlen($config->__get('remote_config')) > 0) {
- $ftpObj = new Mage_Connect_Ftp();
- $ftpObj->connect($config->__get('remote_config'));
- $ftpObj->delete($maintenance_filename);
- $ftpObj->close();
- } else {
- @unlink($this->_getMaintenanceFilePath());
- }
- }
- return array('result' => $result, 'message' => $message);
- }
-
- /**
- * Gets the current Magento Connect Manager (Downloader) version string
- * @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
- *
- * @return string
- */
- public static function getVersion()
- {
- $i = self::getVersionInfo();
- return trim(
- "{$i['major']}.{$i['minor']}.{$i['revision']}"
- . ($i['patch'] != '' ? ".{$i['patch']}" : "")
- . "-{$i['stability']}{$i['number']}",
- '.-'
- );
- }
-
- /**
- * Gets the detailed Magento Connect Manager (Downloader) version information
- * @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
- *
- * @return array
- */
- public static function getVersionInfo()
- {
- return array(
- 'major' => '1',
- 'minor' => '9',
- 'revision' => '4',
- 'patch' => '5',
- 'stability' => '',
- 'number' => '',
- );
- }
-
- /**
- * Create Backup
- *
- * @param string $archiveType
- * @param string $archiveName
- * @return bool
- */
- protected function _createBackup($archiveType, $archiveName){
- /** @var $connect Maged_Connect */
- $connect = $this->model('connect', true)->connect();
- $connect->runHtmlConsole('Creating backup...');
-
- $isSuccess = false;
-
- try {
- $type = $this->_getBackupTypeByCode($archiveType);
-
- $backupManager = Mage_Backup::getBackupInstance($type)
- ->setBackupExtension(Mage::helper('backup')->getExtensionByType($type))
- ->setTime(time())
- ->setName($archiveName)
- ->setBackupsDir(Mage::helper('backup')->getBackupsDir());
-
- Mage::register('backup_manager', $backupManager);
-
- if ($type != Mage_Backup_Helper_Data::TYPE_DB) {
- $backupManager->setRootDir(Mage::getBaseDir())
- ->addIgnorePaths(Mage::helper('backup')->getBackupIgnorePaths());
- }
- $backupManager->create();
- $connect->runHtmlConsole(
- $this->_getCreateBackupSuccessMessageByType($type)
- );
- $isSuccess = true;
- } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) {
- $connect->runHtmlConsole('Not enough free space to create backup.');
- Mage::logException($e);
- } catch (Mage_Backup_Exception_NotEnoughPermissions $e) {
- $connect->runHtmlConsole('Not enough permissions to create backup.');
- Mage::logException($e);
- } catch (Exception $e) {
- $connect->runHtmlConsole('An error occurred while creating the backup.');
- Mage::logException($e);
- }
-
- return $isSuccess;
- }
-
- /**
- * Retrieve Backup Type by Code
- *
- * @param int $code
- * @return string
- */
- protected function _getBackupTypeByCode($code)
- {
- $typeMap = array(
- 1 => Mage_Backup_Helper_Data::TYPE_DB,
- 2 => Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT,
- 3 => Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA,
- 4 => Mage_Backup_Helper_Data::TYPE_MEDIA
- );
-
- if (!isset($typeMap[$code])) {
- Mage::throwException('Unknown backup type');
- }
-
- return $typeMap[$code];
- }
-
- /**
- * Get backup create success message by backup type
- *
- * @param string $type
- * @return string
- */
- protected function _getCreateBackupSuccessMessageByType($type)
- {
- $messagesMap = array(
- Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT => 'System backup has been created',
- Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'System (excluding Media) backup has been created',
- Mage_Backup_Helper_Data::TYPE_MEDIA => 'Database and media backup has been created',
- Mage_Backup_Helper_Data::TYPE_DB => 'Database backup has been created'
- );
-
- if (!isset($messagesMap[$type])) {
- return '';
- }
-
- return $messagesMap[$type];
- }
-
- /**
- * Validate Form Key
- *
- * @return bool
- */
- protected function _validateFormKey()
- {
- return $this->session()->validateFormKey();
- }
-
- /**
- * Retrieve Session Form Key
- *
- * @return string
- */
- public function getFormKey()
- {
- return $this->session()->getFormKey();
- }
-
- /**
- * @return Maged_BruteForce_Validator
- * @throws Exception
- */
- protected function createBruteForceValidator()
- {
- $isRemote = (strlen($this->config()->remote_config) > 0);
- $localFileName = ($isRemote) ? "brute-force.tmp.ini" : self::BRUTE_FORCE_CONFIG_NAME;
- $localFile = $this->getBruteForceLocalFile($localFileName);
-
- if (!is_file($localFile)) {
- $this->createBruteForceTemporaryFile($localFile, $this->getBruteForceLocalDirectory());
- }
- if (!is_writable($localFile)) {
- throw new Exception("Unable to write to the configuration file.");
- }
- if ($isRemote) {
- $resource = new Maged_Model_BruteForce_Resource_FTP($this->config()->remote_config, $localFile, self::DOWNLOADER_DIRECTORY . DIRECTORY_SEPARATOR . self::BRUTE_FORCE_CONFIG_NAME);
- } else {
- $resource = new Maged_Model_BruteForce_Resource_File($localFile, self::DOWNLOADER_DIRECTORY . DIRECTORY_SEPARATOR . self::BRUTE_FORCE_CONFIG_NAME);
- }
- return new Maged_BruteForce_Validator(new Maged_Model_BruteForce_ConfigIni($resource));
- }
-
- /**
- * @param string $fileName
- * @return false |string
- */
- protected function getBruteForceLocalFile($fileName)
- {
- $varFolder = $this->getBruteForceLocalDirectory();
- return rtrim($varFolder . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $fileName), DIRECTORY_SEPARATOR);
- }
-
- /**
- * @param string $localBruteForceConfigFile
- * @param string $folder
- * @throws Exception
- */
- protected function createBruteForceTemporaryFile($localBruteForceConfigFile, $folder)
- {
- $error = false;
- if (!is_dir($folder)) {
- if (false === mkdir($folder)) {
- $error = true;
- };
- }
- $fp = fopen($localBruteForceConfigFile, "w");
- if ($fp !== false) {
- fclose($fp);
- } else {
- $error = true;
- }
-
- if ($error) {
- throw new Exception("Unable to create a temporary file. Please add write permission to the var/ folder.");
- }
- }
-
- /**
- * @return string
- */
- protected function getBruteForceLocalDirectory()
- {
- return $this->getMageDir() . DIRECTORY_SEPARATOR . "var" . DIRECTORY_SEPARATOR;
- }
-}
diff --git a/downloader/Maged/Exception.php b/downloader/Maged/Exception.php
deleted file mode 100644
index effa1063944..00000000000
--- a/downloader/Maged/Exception.php
+++ /dev/null
@@ -1,37 +0,0 @@
-_data = $args[0];
-
- $this->_construct();
- }
-
- /**
- * Constructor for covering
- */
- protected function _construct()
- {
-
- }
-
- /**
- * Retrieve controller
- * @return Maged_Controller
- */
- public function controller()
- {
- return Maged_Controller::singleton();
- }
-
- /**
- * Set value for key
- *
- * @param string $key
- * @param mixed $value
- * @return Maged_Model
- */
- public function set($key, $value)
- {
- $this->_data[$key] = $value;
- return $this;
- }
-
- /**
- * Get value by key
- *
- * @param string $key
- * @return mixed
- */
- public function get($key)
- {
- return isset($this->_data[$key]) ? $this->_data[$key] : null;
- }
-}
diff --git a/downloader/Maged/Model/BruteForce/ConfigIni.php b/downloader/Maged/Model/BruteForce/ConfigIni.php
deleted file mode 100644
index b010cceb975..00000000000
--- a/downloader/Maged/Model/BruteForce/ConfigIni.php
+++ /dev/null
@@ -1,115 +0,0 @@
-isReadable()) {
- $this->resource = $resource;
- $this->readConfig();
- } else {
- throw new Exception("Unable to read the configuration file.");
- }
- }
-
- /**
- * @throws Exception
- */
- public function readConfig()
- {
- if (false === $data = parse_ini_string($this->resource->read())) {
- throw new Exception("Incorrect configuration file.");
- }
- $this->data = $data;
- }
-
- /**
- * @param string $name
- * @param null $defaultValue
- * @return mixed|null
- */
- public function get($name, $defaultValue = null)
- {
- return (isset($this->data[$name]) ? $this->data[$name] : $defaultValue);
- }
-
- /**
- * @param string $name
- * @param mixed $value
- * @return $this
- * @throws Exception
- */
- public function set($name, $value)
- {
- if (is_array($value) or is_object($value)) {
- throw new Exception ("Bad value type.");
- }
- $this->data[$name] = $value;
- return $this;
- }
-
- public function save()
- {
- if ($this->resource->isWritable()) {
- $res = array();
- foreach ($this->data as $key => $value) {
- $res[] = "$key = " . (is_numeric($value) ? $value : '"' . $value . '"');
- }
- $content = implode("\n", $res);
- $this->resource->write($content);
- } else {
- throw new Exception("Unable to write to the configuration file.");
- }
- }
-
- /**
- * @param string $name
- * @return $this
- */
- public function delete($name)
- {
- if (isset($this->data[$name])) {
- unset($this->data[$name]);
- }
- return $this;
- }
-
-}
diff --git a/downloader/Maged/Model/BruteForce/ModelConfigInterface.php b/downloader/Maged/Model/BruteForce/ModelConfigInterface.php
deleted file mode 100644
index bfcdedb0faf..00000000000
--- a/downloader/Maged/Model/BruteForce/ModelConfigInterface.php
+++ /dev/null
@@ -1,55 +0,0 @@
-connectionString = $connectionString;
- $this->ftp = new Mage_Connect_Ftp();
- $this->localFilePath = $localFilePath;
- $this->remoteFilePath = $remoteFileName;
-
- $this->ftp->connect($this->connectionString);
- }
-
- /**
- * @return string
- */
- public function read()
- {
- if ($this->isReadable()) {
- return file_get_contents($this->localFilePath);
- }
- return false;
- }
-
- /**
- * @return boolean
- */
- public function isReadable()
- {
- return ($this->ftp->get($this->localFilePath, $this->remoteFilePath) === true);
- }
-
- public function __destruct()
- {
- unlink($this->localFilePath);
- $this->ftp->close();
- }
-
- /**
- * @param string $content
- * @return boolean
- */
- public function write($content)
- {
- if ($this->isWritable()) {
- file_put_contents($this->localFilePath, $content);
- return $this->ftp->upload(
- $this->remoteFilePath,
- $this->localFilePath
- );
- }
- return false;
- }
-
- /**
- * @return string
- */
- public function isWritable()
- {
- return ($this->isReadable());
- }
-
- /**
- * @return string
- */
- public function getResourcePath()
- {
- return $this->remoteFilePath;
- }
-}
diff --git a/downloader/Maged/Model/BruteForce/Resource/File.php b/downloader/Maged/Model/BruteForce/Resource/File.php
deleted file mode 100644
index 1fc79f7aa83..00000000000
--- a/downloader/Maged/Model/BruteForce/Resource/File.php
+++ /dev/null
@@ -1,91 +0,0 @@
-filePath = $filePath;
- $this->displayFileName = $displayFileName;
- }
-
- /**
- * @return string
- */
- public function read()
- {
- if ($this->isReadable()) {
- return file_get_contents($this->filePath);
- }
- return false;
- }
-
- /**
- * @return boolean
- */
- public function isReadable()
- {
- return (is_file($this->filePath) and is_readable($this->filePath));
- }
-
- /**
- * @param string $content
- * @return boolean
- */
- public function write($content)
- {
- if ($this->isWritable()) {
- return (boolean)file_put_contents($this->filePath, $content);
- }
- return false;
- }
-
- /**
- * @return string
- */
- public function isWritable()
- {
- return (is_file($this->filePath) and is_writable($this->filePath));
- }
-
- /**
- * @return string
- */
- public function getResourcePath()
- {
- return $this->displayFileName;
- }
-}
diff --git a/downloader/Maged/Model/BruteForce/Resource/ResourceInterface.php b/downloader/Maged/Model/BruteForce/Resource/ResourceInterface.php
deleted file mode 100644
index 01694a02802..00000000000
--- a/downloader/Maged/Model/BruteForce/Resource/ResourceInterface.php
+++ /dev/null
@@ -1,54 +0,0 @@
-load();
- $channel = trim($this->get('root_channel'));
- if (!empty($channel)) {
- try {
- return $this->controller()->model('config_'.$channel, true);
- } catch (Exception $e) {
- throw new Exception('Not valid config.ini file.');
- }
- } else {
- throw new Exception('Not valid config.ini file.');
- }
- }
-
- /**
- * Save post data to config
- *
- * @param array $p
- * @return Maged_Model_Config
- */
- public function saveConfigPost($p)
- {
- $configParams = array(
- 'protocol',
- 'preferred_state',
- 'use_custom_permissions_mode',
- 'mkdir_mode',
- 'chmod_file_mode',
- 'magento_root',
- 'downloader_path',
- 'root_channel_uri',
- 'root_channel',
- 'ftp',
- );
- foreach ($configParams as $paramName){
- if (isset($p[$paramName])) {
- $this->set($paramName, $p[$paramName]);
- }
- }
- $this->save();
- return $this;
- }
-}
diff --git a/downloader/Maged/Model/Config/Abstract.php b/downloader/Maged/Model/Config/Abstract.php
deleted file mode 100644
index e15036aaadb..00000000000
--- a/downloader/Maged/Model/Config/Abstract.php
+++ /dev/null
@@ -1,134 +0,0 @@
-controller()->filepath('config.ini');
- }
-
- /**
- * Load file
- *
- * @return Maged_Model_Config
- */
- public function load()
- {
- if (!file_exists($this->getFilename())) {
- return $this;
- }
- $rows = file($this->getFilename());
- if (!$rows) {
- return $this;
- }
- foreach ($rows as $row) {
- $arr = explode('=', $row, 2);
- if (count($arr)!==2) {
- continue;
- }
- $key = trim($arr[0]);
- $value = trim($arr[1], " \t\"'\n\r");
- if (!$key || $key[0]=='#' || $key[0]==';') {
- continue;
- }
- $this->set($key, $value);
- }
- return $this;
- }
-
- /**
- * Save file
- *
- * @return Maged_Model_Config
- */
- public function save()
- {
- if ((!is_writable($this->getFilename())&&is_file($this->getFilename()))||(dirname($this->getFilename())!=''&&!is_writable(dirname($this->getFilename())))) {
- if(isset($this->_data['ftp'])&&!empty($this->_data['ftp'])&&strlen($this->get('downloader_path'))>0){
- $confFile=$this->get('downloader_path').DIRECTORY_SEPARATOR.basename($this->getFilename());
- $ftpObj = new Mage_Connect_Ftp();
- $ftpObj->connect($this->_data['ftp']);
- $tempFile = tempnam(sys_get_temp_dir(),'configini');
- $fp = fopen($tempFile, 'w');
- foreach ($this->_data as $k=>$v) {
- fwrite($fp, $k.'='.$v."\n");
- }
- fclose($fp);
- $ret=$ftpObj->upload($confFile, $tempFile);
- $ftpObj->close();
- }else{
- /* @TODO: show Warning message*/
- $this->controller()->session()
- ->addMessage('warning', 'Invalid file permissions, could not save configuration.');
- return $this;
- }
- /**/
- }else{
- $fp = fopen($this->getFilename(), 'w');
- foreach ($this->_data as $k=>$v) {
- fwrite($fp, $k.'='.$v."\n");
- }
- fclose($fp);
- }
- return $this;
- }
-
- /**
- * Return channel label for channel name
- *
- * @param string $channel
- * @return string
- */
- public function getChannelLabel($channel)
- {
- $channelLabel = '';
- switch($channel)
- {
- case 'community':
- $channelLabel = 'Magento Community Edition';
- break;
- default:
- $channelLabel = $channel;
- break;
- }
- return $channelLabel;
- }
-}
-?>
diff --git a/downloader/Maged/Model/Config/Community.php b/downloader/Maged/Model/Config/Community.php
deleted file mode 100644
index 27482dcb3cb..00000000000
--- a/downloader/Maged/Model/Config/Community.php
+++ /dev/null
@@ -1,112 +0,0 @@
-load();
- }
-
- /**
- * Set data for Settings View
- *
- * @param Mage_Connect_Config $config
- * @param Maged_View $view
- * @return null
- */
- public function setInstallView($config, $view)
- {
- $view->set('channel_logo', 'logo');
- }
-
- /**
- * Set data for Settings View
- * @param Mage_Connect_Config $config
- * @param Maged_View $view
- * @return null
- */
- public function setSettingsView($config, $view)
- {
- }
-
- /**
- * Set session data for Settings
- * @param array $post post data
- * @param mixed $session Session object
- * @return null
- */
- public function setSettingsSession($post, $session)
- {
- }
-
- /**
- * Get root channel URI
- *
- * @return string Root channel URI
- */
- public function getRootChannelUri(){
- if (!$this->get('root_channel_uri')) {
- $this->set('root_channel_uri', 'connect20.magentocommerce.com/community');
- }
- return $this->get('root_channel_uri');
- }
-
- /**
- * Set config data from POST
- *
- * @param Mage_Connect_Config $config Config object
- * @param array $post post data
- * @return null
- */
- public function setPostData($config, &$post)
- {
- }
-
- /**
- * Set additional command options
- *
- * @param mixed $session Session object
- * @param array $options
- * @return null
- */
- public function setCommandOptions($session, &$options)
- {
- }
-}
-?>
diff --git a/downloader/Maged/Model/Config/Interface.php b/downloader/Maged/Model/Config/Interface.php
deleted file mode 100644
index 3f0123ad829..00000000000
--- a/downloader/Maged/Model/Config/Interface.php
+++ /dev/null
@@ -1,90 +0,0 @@
-
diff --git a/downloader/Maged/Model/Connect.php b/downloader/Maged/Model/Connect.php
deleted file mode 100644
index 8839430969a..00000000000
--- a/downloader/Maged/Model/Connect.php
+++ /dev/null
@@ -1,497 +0,0 @@
-true);
- if ($force) {
- $this->connect()->cleanSconfig();
- $options['force'] = 1;
- }
- $packages = array(
- 'Mage_All_Latest',
- );
- $connectConfig = $this->connect()->getConfig();
- $ftp = $connectConfig->remote_config;
- if (!empty($ftp)) {
- $options['ftp'] = $ftp;
- }
- $params = array();
-
- $uri = $this->controller()->channelConfig()->getRootChannelUri();
-
- $this->controller()->channelConfig()->setCommandOptions($this->controller()->session(), $options);
-
- $connectConfig->root_channel = $chanName;
- foreach ($packages as $package) {
- $params[] = $uri;
- $params[] = $package;
- }
- $this->connect()->runHtmlConsole(array('command'=>'install', 'options'=>$options, 'params'=>$params));
- }
-
- /**
- * Prepare to install package
- *
- * @param string $id
- * @return array
- */
- public function prepareToInstall($id)
- {
- $match = array();
- if (!$this->checkExtensionKey($id, $match)) {
- $errorMessage[] = sprintf('Invalid package identifier provided: %s', $id);
- $packages = array(
- 'errors' => array('error'=> $errorMessage)
- );
- return $packages;
- }
-
- $channel = $match[1];
- $package = $match[2];
- $version = (!empty($match[3]) ? trim($match[3],'/\-') : '');
-
- $connect = $this->connect();
- $sconfig = $connect->getSingleConfig();
-
- $options = array();
- $params = array($channel, $package, $version, $version);
- $this->controller()->channelConfig()->setCommandOptions($this->controller()->session(), $options);
-
- $connect->run('package-prepare', $options, $params);
- $output = $connect->getOutput();
- $errors = $connect->getFrontend()->getErrors();
- $package_error = array();
- foreach ($errors as $error){
- if (isset($error[1])){
- $package_error[] = $error[1];
- }
- }
-
- $packages = array();
- if (is_array($output) && isset($output['package-prepare'])){
- $packages = array_merge($output['package-prepare'], array('errors'=>array('error'=>$package_error)));
- } elseif (is_array($output) && !empty($package_error)) {
- $packages = array('errors'=>array('error'=>$package_error));
- }
- return $packages;
- }
-
-
- /**
- * Retrieve all installed packages
- *
- * @return array
- */
- public function getAllInstalledPackages()
- {
- $connect = $this->connect();
- $sconfig = $connect->getSingleConfig(true);
- $connect->run('list-installed');
- $output = $connect->getOutput();
- $packages = array();
- if (is_array($output) && isset($output['list-installed']['data'])){
- $packages = $output['list-installed']['data'];
- } else {
-
- }
- foreach ($packages as $channel=>$package) {
- foreach ($package as $name=>$data) {
- $summary = $sconfig->getPackageObject($channel, $name)->getSummary();
- $addition = array('summary'=>$summary, 'upgrade_versions'=>array(), 'upgrade_latest'=>'');
- $packages[$channel][$name] = array_merge($data, $addition);
- }
- }
-
- if (!empty($_GET['updates'])) {
- $options = array();
- $this->controller()->channelConfig()->setCommandOptions($this->controller()->session(), $options);
- $result = $connect->run('list-upgrades', $options);
- $output = $connect->getOutput();
- if (is_array($output)) {
- $channelData = $output;
- if (!empty($channelData['list-upgrades']['data']) && is_array($channelData['list-upgrades']['data'])) {
- foreach ($channelData['list-upgrades']['data'] as $channel=>$package) {
- foreach ($package as $name=>$data) {
- if (!isset($packages[$channel][$name])) {
- continue;
- }
- $packages[$channel][$name]['upgrade_latest'] = $data['to'].' ('.$data['from'].')';
- }
- }
- }
- }
- }
-
- $states = array('snapshot'=>0, 'devel'=>1, 'alpha'=>2, 'beta'=>3, 'stable'=>4);
- $preferredState = $states[$this->getPreferredState()];
-
- foreach ($packages as $channel=>&$package) {
- foreach ($package as $name=>&$data) {
- $actions = array();
- $systemPkg = $name==='Mage_Downloader';
- if (!empty($data['upgrade_latest'])) {
- $status = 'upgrade-available';
- $releases = array();
- $connect->run('info', array(), array($channel, $name));
- $output = $connect->getOutput();
- if (!empty($output['info']['releases'])) {
- foreach ($output['info']['releases'] as $release) {
- $stability = $packages[$channel][$name]['stability'];
- if ($states[$release['s']] < min($preferredState, $states[$stability])) {
- continue;
- }
- if (version_compare($release['v'], $packages[$channel][$name]['version']) < 1) {
- continue;
- }
- $releases[$release['v']] = $release['v'].' ('.$release['s'].')';
- }
- }
-
- if ($releases) {
- uksort($releases, 'version_compare');
- foreach ($releases as $version => $release) {
- $actions['upgrade|'.$version] = 'Upgrade to '.$release;
- }
- } else {
- $a = explode(' ', $data['upgrade_latest'], 2);
- $actions['upgrade|'.$a[0]] = 'Upgrade';
- }
- if (!$systemPkg) {
- $actions['uninstall'] = 'Uninstall';
- }
- } else {
- $status = 'installed';
- $actions['reinstall'] = 'Reinstall';
- if (!$systemPkg) {
- $actions['uninstall'] = 'Uninstall';
- }
- }
- $packages[$channel][$name]['actions'] = $actions;
- $packages[$channel][$name]['status'] = $status;
- }
- }
- return $packages;
- }
-
- /**
- * Run packages action
- *
- * @param mixed $packages
- */
- public function applyPackagesActions($packages, $ignoreLocalModification='')
- {
- $actions = array();
- foreach ($packages as $package=>$action) {
- if ($action) {
- $a = explode('|', $package);
- $b = explode('|', $action);
- $package = $a[1];
- $channel = $a[0];
- $version = '';
- if ($b[0]=='upgrade') {
- $version = $b[1];
- }
- $actions[$b[0]][] = array($channel, $package, $version, $version);
- }
- }
- if (empty($actions)) {
- $this->connect()->runHtmlConsole('No actions selected');
- exit;
- }
-
- $this->controller()->startInstall();
-
- $options = array();
- if (!empty($ignoreLocalModification)) {
- $options = array('ignorelocalmodification'=>1);
- }
- if(!$this->controller()->isWritable()||strlen($this->connect()->getConfig()->__get('remote_config'))>0){
- $options['ftp'] = $this->connect()->getConfig()->__get('remote_config');
- }
-
- $this->controller()->channelConfig()->setCommandOptions($this->controller()->session(), $options);
-
- foreach ($actions as $action=>$packages) {
- foreach ($packages as $package) {
- switch ($action) {
- case 'install': case 'uninstall': case 'upgrade':
- $this->connect()->runHtmlConsole(array(
- 'command'=>$action,
- 'options'=>$options,
- 'params'=>$package
- ));
- break;
-
- case 'reinstall':
- $package_info = $this->connect()->getSingleConfig()->getPackage($package[0], $package[1]);
- if (isset($package_info['version'])) {
- $package[2] = $package_info['version'];
- $package[3] = $package_info['version'];
- }
- $this->connect()->runHtmlConsole(array(
- 'command'=>'install',
- 'options'=>array_merge($options, array('force'=>1, 'nodeps'=>1)),
- 'params'=>$package
- ));
- break;
- }
- }
- }
-
- $this->controller()->endInstall();
- }
-
-
- public function installUploadedPackage($file)
- {
- $this->controller()->startInstall();
-
- $options = array();
- if(!$this->controller()->isWritable()||strlen($this->connect()->getConfig()->__get('remote_config'))>0){
- $options['ftp'] = $this->connect()->getConfig()->__get('remote_config');
- }
- $this->connect()->runHtmlConsole(array(
- 'command'=>'install-file',
- 'options'=>$options,
- 'params'=>array($file),
- ));
- $this->controller()->endInstall();
- }
-
- /**
- * Install package by id
- *
- * @param string $id
- * @param boolean $force
- */
- public function installPackage($id, $force=false)
- {
- $match = array();
- if (!$this->checkExtensionKey($id, $match)) {
- $this->connect()->runHtmlConsole('Invalid package identifier provided: '.$id);
- exit;
- }
-
- $channel = $match[1];
- $package = $match[2];//.(!empty($match[3]) ? $match[3] : '');
- $version = (!empty($match[3]) ? trim($match[3],'/\-') : '');
-
- $this->controller()->startInstall();
-
- $options = array();
- if ($force) {
- $options['force'] = 1;
- }
- if(!$this->controller()->isWritable()||strlen($this->connect()->getConfig()->__get('remote_config'))>0){
- $options['ftp'] = $this->connect()->getConfig()->__get('remote_config');
- }
-
- $this->controller()->channelConfig()->setCommandOptions($this->controller()->session(), $options);
-
- $this->connect()->runHtmlConsole(array(
- 'command'=>'install',
- 'options'=>$options,
- 'params'=>array(0=>$channel, 1=>$package, 2=>$version),
- ));
-
- $this->controller()->endInstall();
- }
-
- /**
- * Retrieve stability choosen client
- *
- * @return string alpha, beta, ...
- */
- public function getPreferredState()
- {
- if (is_null($this->get('preferred_state'))) {
- $connectConfig = $this->connect()->getConfig();
- $this->set('preferred_state', $connectConfig->__get('preferred_state'));
- }
- return $this->get('preferred_state');
- }
-
- /**
- * Retrieve protocol choosen client
- *
- * @return string http, ftp
- */
- public function getProtocol()
- {
- if (is_null($this->get('protocol'))) {
- $connectConfig = $this->connect()->getConfig();
- $this->set('protocol', $connectConfig->__get('protocol'));
- }
- return $this->get('protocol');
- }
-
- /**
- * Validate settings post data.
- *
- * @param array $p
- */
- public function validateConfigPost($p)
- {
- $errors = array();
- $configTestFile = 'connect.cfgt';
- $configObj = $this->connect()->getConfig();
- if ('ftp' == $p['deployment_type'] || '1' == $p['inst_protocol']) {
- /*check ftp*/
-
- $confFile = $configObj->downloader_path.DIRECTORY_SEPARATOR.$configTestFile;
- try {
- $ftpObj = new Mage_Connect_Ftp();
- $ftpObj->connect($p['ftp']);
- $tempFile = tempnam(sys_get_temp_dir(),'config');
- $serial = md5('config test file');
- $f = @fopen($tempFile, "w+");
- @fwrite($f, $serial);
- @fclose($f);
- $ret=$ftpObj->upload($confFile, $tempFile);
-
- //read file
- if (!$errors && is_file($configTestFile)) {
- $size = filesize($configTestFile);
- if(!$size) {
- $errors[]='Unable to read saved settings. Please check Installation Path of FTP Connection.';
- }
-
- if (!$errors) {
- $f = @fopen($configTestFile, "r");
- @fseek($f, 0, SEEK_SET);
-
- $contents = @fread($f, strlen($serial));
- if ($serial != $contents) {
- $errors[]='Wrong Installation Path of FTP Connection.';
- }
- fclose($f);
- }
- } else {
- $errors[] = 'Unable to read saved settings. Please check Installation Path of FTP Connection.';
- }
- $ftpObj->delete($confFile);
- $ftpObj->close();
- } catch (Exception $e) {
- $errors[] = 'Deployment FTP Error. ' . $e->getMessage();
- }
- } else {
- $p['ftp'] = '';
- }
-
- if ('1' == $p['use_custom_permissions_mode']) {
- /*check permissions*/
- if (octdec(intval($p['mkdir_mode'])) < 73 || octdec(intval($p['mkdir_mode'])) > 511) {
- $errors[]='Folders permissions not valid. ';
- }
- if (octdec(intval($p['chmod_file_mode'])) < 73 || octdec(intval($p['chmod_file_mode'])) > 511) {
- $errors[]='Files permissions not valid. ';
- }
- }
- //$this->controller()->session()->addMessage('success', 'Settings has been successfully saved');
- return $errors;
- }
- /**
- * Save settings.
- *
- * @param array $p
- */
- public function saveConfigPost($p)
- {
- $configObj = $this->connect()->getConfig();
- if ('ftp' == $p['deployment_type'] || '1' == $p['inst_protocol']){
- $this->set('ftp',$p['ftp']);
- } else {
- $p['ftp'] = '';
- }
- $configObj->remote_config = $p['ftp'];
- $configObj->preferred_state = $p['preferred_state'];
- $configObj->protocol = $p['protocol'];
- $configObj->use_custom_permissions_mode = $p['use_custom_permissions_mode'];
- if ('1' == $p['use_custom_permissions_mode']) {
- $configObj->global_dir_mode = octdec(intval($p['mkdir_mode']));
- $configObj->global_file_mode = octdec(intval($p['chmod_file_mode']));
- }
- if ($configObj->save()) {
- $this->controller()->session()->addMessage('success', 'Settings has been successfully saved');
- } else {
- $this->controller()->session()->addMessage('error', 'Settings cannot be saved');
- }
- return $this;
- }
-
- /**
- * Check Extension Key
- *
- * @param string $id
- * @param array $match
- * @return int
- */
- public function checkExtensionKey($id, &$match)
- {
- if (preg_match('#^(.+)\/(.+)-([\.\d]+)$#', $id, $match)) {
- return $match;
- }
- return preg_match('#^(.+)\/(.+)$#', $id, $match);
- }
-}
diff --git a/downloader/Maged/Model/Connect/Request.php b/downloader/Maged/Model/Connect/Request.php
deleted file mode 100644
index fe6b6aaf551..00000000000
--- a/downloader/Maged/Model/Connect/Request.php
+++ /dev/null
@@ -1,43 +0,0 @@
-set('success_callback', 'clear_cache({success:parent.onSuccess, fail:parent.onFailure})');
- $this->set('failure_callback', 'parent.onFailure()');
- }
-}
diff --git a/downloader/Maged/Model/Dowloader.php b/downloader/Maged/Model/Dowloader.php
deleted file mode 100644
index 95f96fde225..00000000000
--- a/downloader/Maged/Model/Dowloader.php
+++ /dev/null
@@ -1,30 +0,0 @@
-controller()->isInstalled()) {
- // initialize Magento Config
- Mage::app();
- $this->_session = Mage::getSingleton('admin/session');
- } else {
- session_start();
- }
- return $this;
- }
-
- /**
- * Get value by key
- *
- * @param string $key
- * @return mixed
- */
- public function get($key)
- {
- return isset($_SESSION[$key]) ? $_SESSION[$key] : null;
- }
-
- /**
- * Set value for key
- *
- * @param string $key
- * @param mixed $value
- */
- public function set($key, $value)
- {
- $_SESSION[$key] = $value;
- return $this;
- }
-
- /**
- * Unset value by key
- *
- * @param string $key
- * @return $this
- */
- public function delete($key)
- {
- if (isset($_SESSION[$key])) {
- unset($_SESSION[$key]);
- }
- return $this;
- }
-
- /**
- * Authentication to downloader
- * @param Maged_BruteForce_Validator $bruteForceValidator
- * @return $this
- */
- public function authenticate(Maged_BruteForce_Validator $bruteForceValidator )
- {
- if (!$this->_session) {
- return $this;
- }
-
- if (!empty($_GET['return'])) {
- $this->set('return_url', $_GET['return']);
- }
-
- if ($this->_checkUserAccess()) {
- return $this;
- }
-
- if (!$this->controller()->isInstalled()) {
- return $this;
- }
-
- try {
- if (isset($_POST['username']) && !$this->validateFormKey()) {
- $this->controller()
- ->redirect(
- $this->controller()->url(),
- true
- );
- }
- if ( (isset($_POST['username']) && empty($_POST['username']))
- || (isset($_POST['password']) && empty($_POST['password']))) {
- $this->addMessage('error', 'Invalid user name or password');
- }
- if (empty($_POST['username']) || empty($_POST['password'])) {
- $this->controller()->setAction('login');
- return $this;
- }
- $user = $this->_session->login($_POST['username'], $_POST['password']);
- $this->_session->refreshAcl();
- if ($this->_checkUserAccess($user)) {
- $bruteForceValidator->doGoodLogin();
- return $this;
- } else {
- $bruteForceValidator->doBadLogin();
- }
- } catch (Exception $e) {
- $this->addMessage('error', $e->getMessage());
- }
-
- $this->controller()
- ->redirect(
- $this->controller()->url('loggedin'),
- true
- );
- }
-
- /**
- * Check is user logged in and permissions
- *
- * @param Mage_Admin_Model_User|null $user
- * @return bool
- */
- protected function _checkUserAccess($user = null)
- {
- if ($user && !$user->getId()) {
- $this->addMessage('error', 'Invalid user name or password');
- $this->controller()->setAction('login');
- } elseif ($this->getUserId() || ($user && $user->getId())) {
- if ($this->_session->isAllowed('all')) {
- return true;
- } else {
- $this->logout();
- $this->addMessage('error', 'Access Denied', true);
- $this->controller()->setAction('login');
- }
- }
- return false;
- }
-
- /**
- * Log Out
- *
- * @return Maged_Model_Session
- */
- public function logout()
- {
- if (!$this->_session) {
- return $this;
- }
- $this->_session->unsUser();
- return $this;
- }
-
- /**
- * Retrieve user
- *
- * @return mixed
- */
- public function getUserId()
- {
- if (($session = $this->_session) && ($user = $session->getUser())) {
- return $user->getId();
- }
- return false;
- }
-
- /**
- * Add Message
- *
- * @param string $type
- * @param string $msg
- * @param string $clear
- * @return Maged_Model_Session
- */
- public function addMessage($type, $msg, $clear = false)
- {
- $msgs = $this->getMessages($clear);
- $msgs[$type][] = $msg;
- $this->set('messages', $msgs);
- return $this;
- }
-
- /**
- * Retrieve messages from cache
- *
- * @param boolean $clear
- * @return mixed
- */
- public function getMessages($clear = true)
- {
- $msgs = $this->get('messages');
- $msgs = $msgs ? $msgs : array();
- if ($clear) {
- unset($_SESSION['messages']);
- }
- return $msgs;
- }
-
- /**
- * Retrieve url to adminhtml
- *
- * @return string
- */
- public function getReturnUrl()
- {
- if (!$this->_session || !$this->_session->isLoggedIn()) {
- return '';
- }
- return Mage::getSingleton('adminhtml/url')->getUrl('adminhtml');
- }
-
- /**
- * Retrieve Session Form Key
- *
- * @return string A 16 bit unique key for forms
- */
- public function getFormKey()
- {
- if (!$this->get('_form_key')) {
- $this->set('_form_key', Mage::helper('core')->getRandomString(16));
- }
- return $this->get('_form_key');
- }
-
- /**
- * Validate Form Key
- *
- * @return bool
- */
- public function validateFormKey()
- {
- if (!($formKey = $_REQUEST['form_key']) || $formKey != $this->getFormKey()) {
- return false;
- }
- return true;
- }
-
- /**
- * Validate key for cache cleaning
- *
- * @return bool
- */
- public function validateCleanCacheKey()
- {
- $result = false;
- $validateKey = $this->get('validate_cache_key');
- if ($validateKey
- && !empty($_REQUEST['validate_cache_key'])
- && $validateKey == $_REQUEST['validate_cache_key']
- ) {
- $result = true;
- }
- $this->delete('validate_cache_key');
-
- return $result;
- }
-}
diff --git a/downloader/Maged/View.php b/downloader/Maged/View.php
deleted file mode 100644
index ddd389d73fb..00000000000
--- a/downloader/Maged/View.php
+++ /dev/null
@@ -1,197 +0,0 @@
-controller()->url($action, $params);
- }
-
- /**
- * Retrieve base url
- *
- * @return string
- */
- public function baseUrl()
- {
- return str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
- }
-
- /**
- * Retrieve url of magento
- *
- * @return string
- */
- public function mageUrl()
- {
- return str_replace('\\', '/', dirname($this->baseUrl()));
- }
-
- /**
- * Include template
- *
- * @param string $name
- * @return string
- */
- public function template($name)
- {
- ob_start();
- include $this->controller()->filepath('template/'.$name);
- return ob_get_clean();
- }
-
- /**
- * Set value for key
- *
- * @param string $key
- * @param mixed $value
- * @return Maged_Controller
- */
- public function set($key, $value)
- {
- $this->_data[$key] = $value;
- return $this;
- }
-
- /**
- * Get value by key
- *
- * @param string $key
- * @return mixed
- */
- public function get($key)
- {
- return isset($this->_data[$key]) ? $this->_data[$key] : null;
- }
-
- /**
- * Translator
- *
- * @param string $string
- * @return string
- */
- public function __($string)
- {
- return $string;
- }
-
- /**
- * Retrieve link for header menu
- *
- * @param mixed $action
- */
- public function getNavLinkParams($action)
- {
- $params = 'href="'.$this->url($action).'"';
- if ($this->controller()->getAction()==$action) {
- $params .= ' class="active"';
- }
- return $params;
- }
-
- /**
- * Retrieve Session Form Key
- *
- * @return string
- */
- public function getFormKey()
- {
- return $this->controller()->getFormKey();
- }
-
- /**
- * Escape html entities
- *
- * @param mixed $data
- * @param array $allowedTags
- * @return mixed
- */
- public function escapeHtml($data, $allowedTags = null)
- {
- if (is_array($data)) {
- $result = array();
- foreach ($data as $item) {
- $result[] = $this->escapeHtml($item);
- }
- } else {
- // process single item
- if (strlen($data)) {
- if (is_array($allowedTags) and !empty($allowedTags)) {
- $allowed = implode('|', $allowedTags);
- $result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data);
- $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8', false);
- $result = preg_replace('/##([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)##/si', '<$1$2$3>', $result);
- } else {
- $result = htmlspecialchars($data, ENT_COMPAT, 'UTF-8', false);
- }
- } else {
- $result = $data;
- }
- }
- return $result;
- }
-}
diff --git a/downloader/config.ini b/downloader/config.ini
deleted file mode 100644
index b2c56fcdc75..00000000000
--- a/downloader/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-root_channel=community
\ No newline at end of file
diff --git a/downloader/favicon.ico b/downloader/favicon.ico
deleted file mode 100644
index 1cb7c771371..00000000000
Binary files a/downloader/favicon.ico and /dev/null differ
diff --git a/downloader/index.php b/downloader/index.php
deleted file mode 100644
index 71ac906de53..00000000000
--- a/downloader/index.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
Whoops, it looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.
';
- exit;
-}
-
-require_once("lib/Mage/Autoload/Simple.php");
-Mage_Autoload_Simple::register();
-
-umask(0);
-Maged_Controller::run();
diff --git a/downloader/js/prototype.js b/downloader/js/prototype.js
deleted file mode 100644
index a3f21ac7909..00000000000
--- a/downloader/js/prototype.js
+++ /dev/null
@@ -1,3277 +0,0 @@
-/* Prototype JavaScript framework, version 1.5.1.1
- * (c) 2005-2007 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
-/*--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.5.1.1',
-
- Browser: {
- IE: !!(window.attachEvent && !window.opera),
- Opera: !!window.opera,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
- },
-
- BrowserFeatures: {
- XPath: !!document.evaluate,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- (document.createElement('div').__proto__ !==
- document.createElement('form').__proto__)
- },
-
- ScriptFragment: '
diff --git a/downloader/template/connect/packages.phtml b/downloader/template/connect/packages.phtml
deleted file mode 100644
index aa5fecb8e4c..00000000000
--- a/downloader/template/connect/packages.phtml
+++ /dev/null
@@ -1,266 +0,0 @@
-
-template('header.phtml') ?>
-get('writable_warning')) echo $this->template('writable.phtml');?>
-
-
Settings
-
-
-
-
Install New Extensions
-
-
-
-
-
-
-
-
-
-
-
Direct package file upload
-
-
-
-
-
-
Manage Existing Extensions
-
- Check for Upgrades
-
-
-get('connect')->getAllInstalledPackages(); $i = 0; $cnt = count($packages); ?>
-get('channel_config');?>
-
-$pkgs): ?>
-
-
-
-
-
-
-
-
-template('connect/iframe.phtml') ?>
-
-
-
- set('messages', array('success'=>array('Procedure completed. Please check the output frame for useful information and refresh the page to see changes.'))) ?>
- template('messages.phtml') ?>
- Refresh
-
-
- set('messages', array('error'=>array('Please check the output frame for errors and refresh the page to retry changes.'))) ?>
- template('messages.phtml') ?>
- Refresh
-
-
-template('footer.phtml') ?>
diff --git a/downloader/template/connect/packages_prepare.phtml b/downloader/template/connect/packages_prepare.phtml
deleted file mode 100644
index 6fd1cee54a3..00000000000
--- a/downloader/template/connect/packages_prepare.phtml
+++ /dev/null
@@ -1,79 +0,0 @@
-
-get('packages');
- $errors = $this->get('errors');
- $cnt = count($packages);
- if($cnt):
-?>
-Extension dependencies
-
-array('Extension key is not valid.'));
- if(!empty($errors) && is_array($errors)) $_errors = $errors;
- $this->set('messages', $_errors)
-?>
-
- template('messages.phtml') ?>
-
-
diff --git a/downloader/template/exception.phtml b/downloader/template/exception.phtml
deleted file mode 100644
index 8e48082daec..00000000000
--- a/downloader/template/exception.phtml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-template($this->controller()->isInstalled() ? 'header.phtml' : 'install/header.phtml') ?>
-
-Exception caught:
-
-get('exception')->getMessage() ?>
-
-Backtrace:
-get('exception')->getTraceAsString() ?>
-
-template($this->controller()->isInstalled() ? 'footer.phtml' : 'install/footer.phtml') ?>
diff --git a/downloader/template/footer.phtml b/downloader/template/footer.phtml
deleted file mode 100644
index cd23565ab2a..00000000000
--- a/downloader/template/footer.phtml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-