public function spawn($args = array()) { $this->lazyInit(); // vlcpath quotes moved here from adapters try { $pathString = (string) $this->getPipe() . ' | ' . '"' . trim($this->_conf_vlcPath, '"') . '"'; } catch (Exception $e) { // ignore pipe is not setted // just use the normal path $pathString = '"' . trim($this->_conf_vlcPath, '"') . '"'; } if (is_array($args)) { // aggiungo agli argomenti registrati foreach ($args as $arg_k => $arg_v) { $this->registerArg($arg_k, $arg_v); } $vlcArgs = $this->_conf_vlcArgs; // sostituisco alla lista foreach ($this->_registredArgs as $a_k => $a_v) { $vlcArgs = str_replace("{%{$a_k}%}", $a_v, $vlcArgs); } // cancello gli argomenti $this->_registredArgs = array(); // elimino i restanti placeholder $vlcArgs = preg_replace('/{%\\w+%}/', '', $vlcArgs); // invio all'adapter che provvedera' per il resto return $this->adapter->spawn($pathString, $vlcArgs); } elseif (is_string($args)) { // se e' una stringa, la sostituisco a quella delle opzioni return $this->adapter->spawn($pathString, $args); } }
public function __construct($options = array()) { parent::__construct($options); $this->pidFile = $this->_options->get('adapter', new Zend_Config(array()))->get('pidFile', sys_get_temp_dir() . '/vlcLock.pid'); $this->vlcLog = $this->_options->get('adapter', new Zend_Config(array()))->get('log', false); }