Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing dependencies of magento/framework #3889

Merged
merged 6 commits into from
Jun 30, 2017
Merged

Add missing dependencies of magento/framework #3889

merged 6 commits into from
Jun 30, 2017

Conversation

GordonLesti
Copy link
Contributor

If I require magento/framework in my module, cause I'm using class Magento\Framework\HTTP\PhpEnvironment\Request for example. My unit tests are breaking cause Zend\Http\Header\HeaderInterface is used in Magento\Framework\HTTP\PhpEnvironment\Request, but the class Zend\Http\Header\HeaderInterface can not be found. This forces me to require zendframework/zend-http in my module without using any class from this library.

@@ -20,7 +20,8 @@
"ext-openssl": "*",
"lib-libxml": "*",
"ext-xsl": "*",
"symfony/process": "~2.1"
"symfony/process": "~2.1",
"zendframework/zend-http": "~2.4.6"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no need to prevent updating to 2.5 and more. So better to use ~2.4. If it should be more than 2.4.6 - ~2.4 >=2.4.6

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^2.4.6 can be used as shorthand for >=2.4.6,<3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have taken the requirement from magento/magento2ce composer.json and that is "zendframework/zend-http": "~2.4.6" at the moment.

@vkublytskyi
Copy link

@GordonLesti, thank you for your contribution.

Unfortunately there are another missed dependencies of Magento Framwork that are declared only in root composer.json file. We've created internal ticket MAGETWO-51702 to review and fix dependencies of Magneto Framework.

But if you are interested and may help us with resolving this issue we will be very thankful.

@GordonLesti
Copy link
Contributor Author

Yes, my unit tests just forced me to require zendframework/zend-http without using any class from that library so I have only added zendframework/zend-http at the moment. I check also for other dependencies & will update my contribution as sson as possible.

@GordonLesti
Copy link
Contributor Author

I have now added all not dev dependencies of magento/framework to lib/internal/Magento/Framework/composer.json. For every requirement I have added, I have an example usage in this list.

  • Zend\Code\Generator\MethodGenerator in Magento\Framework\Code\Generator\ClassGenerator
  • Zend\Stdlib\Parameters in Magento\Framework\App\Test\Unit\Request\HttpTest
  • Zend\Mvc\Application in Magento\Framework\Console\Cli
  • Zend\Crypt\Utils in Magento\Framework\Encryption\Helper\Security
  • Zend\Escaper\Escaper in Magento\Framework\Escaper
  • Zend\Stdlib\Glob in Magento\Framework\Filesystem\Glob
  • Zend\Http\Header\HeaderInterface in Magento\Framework\HTTP\PhpEnvironment\Request
  • Zend\Uri\UriFactory in Magento\Framework\HTTP\PhpEnvironment\Request
  • Zend\Validator\Hostname in Magento\Framework\Session\Config\Validator\CookieDomainValidator
  • Psr\Log\LoggerInterface in Magento\Framework\Phrase\Renderer\Inline
  • Cm\RedisSession\Handler\ConfigInterface in Magento\Framework\Session\SaveHandler\Redis
  • Composer\Autoload\ClassLoader in Magento\Framework\Autoload\ClassLoaderWrapper
  • Monolog\Formatter\LineFormatter in Magento\Framework\Logger\Handler\Base
  • Less_Parser in Magento\Framework\Css\PreProcessor\Adapter\Less\Processor
  • CSSmin in Magento\Framework\Code\Minifier\Adapter\Css\CSSmin
  • Symfony\Component\Console\Input\ArrayInput in Magento\Framework\Composer\DependencyChecker
  • JShrink\Minifier in Magento\Framework\Code\Minifier\Adapter\Js\JShrink
  • Magento\Composer\InfoCommand in Magento\Framework\Composer\MagentoComposerApplicationFactory

@GordonLesti GordonLesti changed the title magento/framework should require zendframework/zend-http Add missing dependencies of magento/framework Apr 8, 2016
@vkublytskyi
Copy link

@GordonLesti Thank you for so quick response. We will process your PR

@okorshenko okorshenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label May 5, 2016
@mazhalai
Copy link
Contributor

mazhalai commented May 6, 2016

@GordonLesti please sync with the develop branch and rerun travis builds.

@GordonLesti
Copy link
Contributor Author

@mazhalai develop is merged & travis builds

@vkorotun vkorotun added Infrastructure bugfix and removed Application Framework Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Aug 4, 2016
@GordonLesti GordonLesti reopened this Jan 8, 2017
@vrann
Copy link
Contributor

vrann commented Mar 25, 2017

@GordonLesti sorry for asking to do it again, but can you please merge with the latest develop?

@vrann vrann assigned vrann and unassigned BaDos and mazhalai Mar 25, 2017
@GordonLesti
Copy link
Contributor Author

@vrann no problem, will merge develop tomorrow and ping you again.

@GordonLesti
Copy link
Contributor Author

GordonLesti commented Mar 28, 2017

Hello @vrann
What have I done since last merge of develop branch.

  • Merged develop again
  • Ordered third party dependencies in alphabetical order
  • Checked again if all example of code dependencies from my comment above are persist
  • Updated versions of dependencies with the versions from composer.json of magento/magento2ce

What I have not done, or what may should be done in an other future PR

  • Check for new code dependencies that aren't mentioned yet in composer.json of magento/framework

@okorshenko okorshenko self-assigned this Jun 30, 2017
@magento-team magento-team merged commit e12db94 into magento:develop Jun 30, 2017
@GordonLesti GordonLesti deleted the require_zend_http branch July 1, 2017 08:46
magento-engcom-team pushed a commit that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.