हैलो मैं अपनी खुद की लाइब्रेरी कक्षाओं से भरे सिलेक्स माइक्रो फ्रेमवर्क का उपयोग करने की कोशिश कर रहा हूं और इसलिए मैं 2 लोडर के साथ फंस गया हूं जिसके परिणामस्वरूप लोडर कक्षाएं लोड नहीं कर सकता .. क्या कोई है इस त्रुटि को प्राप्त किए बिना इन 2 लोडरों का एक साथ उपयोग करने का तरीका?एकाधिक ऑटोलोडर का उपयोग कर php
लोडर कि मैं तुम्हें नीचे पा सकते हैं का उपयोग करें:
<?php
/*
* Loader
*/
function my_autoloader($className)
{
// haal de base dir op.
$base = dirname(__FILE__);
// het pad ophalen
$path = $className;
// alle paden samenvoegen tot waar ik zijn moet en de phpfile eraan plakken.
$file = $base . "/lib/" . $path . '.php';
// als file bestaat haal op anders error
if (file_exists($file))
{
require $file;
}
else
{
error_log('Class "' . $className . '" could not be autoloaded');
throw new Exception('Class "' . $className . '" could not be autoloaded from: ' . $file);
}
}
spl_autoload_register('my_autoloader');
?>
लोडर कि का उपयोग करता है Silex
(ढांचे से ही) विक्रेता निर्देशिका में है और यह कैसे मेरी फाइल पेड़ की तरह लग रहा है :
अरे जिसने चाल की है! धन्यवाद :) जब संभव हो तो अपने उत्तर को सही के रूप में स्वीकार करेंगे (4 मिनट जो है) – Reshad