Exemple #1
0
 public function autoloadXml($path)
 {
     // TODO: This method is called too frequently. It should only be called when something is actually missing from in-memory
     // otherwise we are wasting cycles and string comparisons
     $paths = (array) $path;
     foreach ($paths as $path) {
         foreach (Kohana::config('freeswitch.filemap') as $key => $options) {
             if (isset($options['filename'])) {
                 if (strpos($path, $options['query']) !== FALSE) {
                     // See if this is already in memory
                     if (!isset($this->sectionsUsed[$key])) {
                         $this->sectionsUsed[$key] = TRUE;
                         Kohana::log('debug', 'FreeSWITCH -> For query ' . $path . ' we\'re loading ' . $options['filename']);
                         Telephony::load($options);
                     }
                 }
             }
         }
     }
 }