app/etc/di.xml: এতে নতুন আইটেম যুক্ত করুন stategiesList:
<virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
<arguments>
<argument name="strategiesList" xsi:type="array">
<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
<item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
/* ++ */ <item name="asset" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
</argument>
</arguments>
</virtualType>
ধরে pub/staticনিই যে আপনি বিকাশকারী মোডে আছেন কেবলমাত্র সামগ্রীগুলি মুছুন এবং ব্রাউজারে আপনার পৃষ্ঠায় যান - ম্যাজেন্টো স্থির সামগ্রীটিকে পুনরায় তৈরি করবে।
ম্যাজেন্টো ২.১.৪ এ আমার জন্য কাজ করেছেন (স্টাইল-এম.এস.এসএস উত্পন্ন হয়েছে এবং অন্যান্য ফাইলগুলি সংযুক্ত হয়েছে)।
সমস্ত যাদু এর মধ্যে ঘটে vendor/magento/framework/App/View/Asset/MaterializationStrategy/Factory.php:
public function create(Asset\LocalInterface $asset)
{
if (empty($this->strategiesList)) {
$this->strategiesList[] = $this->objectManager->get(self::DEFAULT_STRATEGY);
}
foreach ($this->strategiesList as $strategy) {
if ($strategy->isSupported($asset)) {
return $strategy;
}
}
throw new \LogicException('No materialization strategy is supported');
}
ম্যাজেন্টো কেবল stategiesListআইটেমগুলির মধ্য দিয়ে লুপ করে এবং প্রথম অবস্থা ব্যবহার করে যা সম্পদ সমর্থন করে।
কীভাবে এটি উত্পাদন মোডে কাজ করবেন?
দাবি অস্বীকার: এই হ্যাকটিতে মূল ফাইল সম্পাদনা রয়েছে। হুঁশিয়ার।
সমস্ত ম্যাজেন্টো ২.১.৪ এ পরীক্ষা করা হয়েছে
- স্ট্যাটিক ফাইলগুলি থেকে সংস্করণ নম্বরটি সরিয়ে দিন
Stores > Configuration > Advanced > Developer > Static Files Settings > No
সম্পাদনা করুন vendor/magento/framework/App/StaticResource.phpএবং launchফাংশনটি এর মতো দেখায়:
public function launch()
{
// disabling profiling when retrieving static resource
\Magento\Framework\Profiler::reset();
$appMode = $this->state->getMode();
/*if ($appMode == \Magento\Framework\App\State::MODE_PRODUCTION) {
$this->response->setHttpResponseCode(404);
} else {*/
$path = $this->request->get('resource');
$params = $this->parsePath($path);
$this->state->setAreaCode($params['area']);
$this->objectManager->configure($this->configLoader->load($params['area']));
$file = $params['file'];
unset($params['file']);
$asset = $this->assetRepo->createAsset($file, $params);
$this->response->setFilePath($asset->getSourceFile());
$this->publisher->publish($asset);
/*}*/
return $this->response;
}
সামগ্রীগুলি মুছুন pub/staticএবং একটি ব্রাউজারে আপনার স্টোর ইউআরএল দেখুন।