I want to override a Zend class (Zend_Date
). In Magento 1, I used to put Date.php
in app/code/community/Zend
and Magento itself used to do the rest. But now, there is no such directory. How can I override that class?
Edit: I installed Magento_SampleNewPage module and it shows
Hello world!
message properly when I go to http://domain.com/newpage
. I edited composer.json
and added my Date.php
to it:
{
"name": "magento/sample-module-newpage",
"description": "A Magento 2 module that creates a new page",
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/framework": "~100.0"
},
"autoload": {
"files": [ "Zend/Date.php" , "registration.php" ],
"psr-4": {
"Magento\\SampleNewPage\\": ""
}
}
}
But still, it doesn't work. When I instantiate a new Zend_Date
, it's from vendor/Magento/zendframework1/library/Zend/Date.php
not my Zend_Date
.