public function onAppDownloadedMergeBinService(Downloaded $event)
    {
        $old_file = $this->root_dir.'AnimeDB';
        if (!$this->fs->exists($old_file)) { // old name
            $old_file = $this->root_dir.'bin/service';
        }
        $new_file = $event->getPath().'/AnimeDB';
        if (is_readable($new_file) && md5_file($old_file) != md5_file($new_file)) {
            $old_body = file_get_contents($old_file);
            $new_body = $tmp_body = file_get_contents($new_file);

            $new_body = $this->copyParam($old_body, $new_body, 'addr=\'%s\'', self::DEFAULT_ADDRESS);
            $new_body = $this->copyParam($old_body, $new_body, 'port=%s'.PHP_EOL, self::DEFAULT_PORT);
            $new_body = $this->copyParam($old_body, $new_body, 'path=%s'.PHP_EOL, self::DEFAULT_PATH);

            if ($new_body != $tmp_body) {
                file_put_contents($new_file, $new_body);
            }
        }
    }
public function onAppDownloadedMergeBinService(Downloaded $event)
    {
        $old_file = $this->root_dir.'AnimeDB';
        if (!$this->fs->exists($old_file)) { // old name
            $old_file = $this->root_dir.'bin/service';
        }
        $new_file = $event->getPath().'/AnimeDB';
        if (is_readable($new_file) && md5_file($old_file) != md5_file($new_file)) {
            $old_body = file_get_contents($old_file);
            $new_body = $tmp_body = file_get_contents($new_file);

            $new_body = $this->copyParam($old_body, $new_body, 'addr=\'%s\'', self::DEFAULT_ADDRESS);
            $new_body = $this->copyParam($old_body, $new_body, 'port=%s'.PHP_EOL, self::DEFAULT_PORT);
            $new_body = $this->copyParam($old_body, $new_body, 'path=%s'.PHP_EOL, self::DEFAULT_PATH);

            if ($new_body != $tmp_body) {
                file_put_contents($new_file, $new_body);
            }
        }
    }
public function onAppDownloadedMergeBinService ( Downloaded $ event ) { $ old_file = $ this -> root_dir . 'AnimeDB' ; if ( ! $ this -> fs -> exists ( $ old_file ) ) { // old name $ old_file = $ this -> root_dir . 'bin/service' ; } $ new_file = $ event -> getPath ( ) . '/AnimeDB' ; if ( is_readable ( $ new_file ) && md5_file ( $ old_file ) != md5_file ( $ new_file ) ) { $ old_body = file_get_contents ( $ old_file ) ; $ new_body = $ tmp_body = file_get_contents ( $ new_file ) ; $ new_body = $ this -> copyParam ( $ old_body , $ new_body , 'addr=\'%s\'' , self :: DEFAULT_ADDRESS ) ; $ new_body = $ this -> copyParam ( $ old_body , $ new_body , 'port=%s' . PHP_EOL , self :: DEFAULT_PORT ) ; $ new_body = $ this -> copyParam ( $ old_body , $ new_body , 'path=%s' . PHP_EOL , self :: DEFAULT_PATH ) ; if ( $ new_body != $ tmp_body ) { file_put_contents ( $ new_file , $ new_body ) ; } } }
Merge bin AnimeDB commands.

@param Downloaded $event
Merge bin AnimeDB commands .