src/Services/PluginManager.php
private function publishRoutes($register)
    {
        if ($register && (isset($this->options['no-routes']) && $this->options['no-routes'] == true)) {
            return;
        }

        if (!file_exists($this->path . '/boot/routes.php')) {
            return;
        }

        // Read enabled packages and add/remove the current plugin.

        $packages = $this->listPackages($register);

        // update manifest

        $dest = '';
        foreach ($packages as $package => $path) {
            $file = base_path($path . '/boot/routes.php');
            if (!file_exists($file)) {
                continue;
            }

            // get content
            $src = trim(file_get_contents($file));

            // strip php tag
            if (substr($src, 0, 5) == '<?php') {
                $src = trim(substr($src, 5));
            }
            if (substr($src, -2) == '?>') {
                $src = trim(substr($src, 0, -2));
            }

            // strip the $router variable if exists
            $src = trim(preg_replace('/\\$router\\s*=\\s*\\\\?Core\\\\Application::router\\(\\);/', '', $src));

            // strip "use Core\Services\Contracts\Router;" if exists
            $src = trim(preg_replace('/use Core\\\\Services\\\\Contracts\\\\Router;/', '', $src));

            // append content to summery file
            if ($dest == '') {
                $dest = PHP_EOL .
                    'use Core\Services\Contracts\Router;' . PHP_EOL
                    . PHP_EOL .
                    '$router = \Core\Application::router();' . PHP_EOL;
            }
            $dest .= PHP_EOL .
                '///////////////////////////////////////////////////////////////////////////////' . PHP_EOL .
                '// ' . $package . PHP_EOL .
                PHP_EOL .
                $src . PHP_EOL;
        }

        $this->saveContent($this->getManifest('routes'), '<?php' . PHP_EOL . $dest);
    }
private function publishRoutes($register)
    {
        if ($register && (isset($this->options['no-routes']) && $this->options['no-routes'] == true)) {
            return;
        }

        if (!file_exists($this->path . '/boot/routes.php')) {
            return;
        }

        // Read enabled packages and add/remove the current plugin.

        $packages = $this->listPackages($register);

        // update manifest

        $dest = '';
        foreach ($packages as $package => $path) {
            $file = base_path($path . '/boot/routes.php');
            if (!file_exists($file)) {
                continue;
            }

            // get content
            $src = trim(file_get_contents($file));

            // strip php tag
            if (substr($src, 0, 5) == '<?php') {
                $src = trim(substr($src, 5));
            }
            if (substr($src, -2) == '?>') {
                $src = trim(substr($src, 0, -2));
            }

            // strip the $router variable if exists
            $src = trim(preg_replace('/\\$router\\s*=\\s*\\\\?Core\\\\Application::router\\(\\);/', '', $src));

            // strip "use Core\Services\Contracts\Router;" if exists
            $src = trim(preg_replace('/use Core\\\\Services\\\\Contracts\\\\Router;/', '', $src));

            // append content to summery file
            if ($dest == '') {
                $dest = PHP_EOL .
                    'use Core\Services\Contracts\Router;' . PHP_EOL
                    . PHP_EOL .
                    '$router = \Core\Application::router();' . PHP_EOL;
            }
            $dest .= PHP_EOL .
                '///////////////////////////////////////////////////////////////////////////////' . PHP_EOL .
                '// ' . $package . PHP_EOL .
                PHP_EOL .
                $src . PHP_EOL;
        }

        $this->saveContent($this->getManifest('routes'), '<?php' . PHP_EOL . $dest);
    }
private function publishRoutes ( $ register ) { if ( $ register && ( isset ( $ this -> options [ 'no-routes' ] ) && $ this -> options [ 'no-routes' ] == true ) ) { return ; } if ( ! file_exists ( $ this -> path . '/boot/routes.php' ) ) { return ; } // Read enabled packages and add/remove the current plugin. $ packages = $ this -> listPackages ( $ register ) ; // update manifest $ dest = '' ; foreach ( $ packages as $ package => $ path ) { $ file = base_path ( $ path . '/boot/routes.php' ) ; if ( ! file_exists ( $ file ) ) { continue ; } // get content $ src = trim ( file_get_contents ( $ file ) ) ; // strip php tag if ( substr ( $ src , 0 , 5 ) == '<?php' ) { $ src = trim ( substr ( $ src , 5 ) ) ; } if ( substr ( $ src , - 2 ) == '?>' ) { $ src = trim ( substr ( $ src , 0 , - 2 ) ) ; } // strip the $router variable if exists $ src = trim ( preg_replace ( '/\\$router\\s*=\\s*\\\\?Core\\\\Application::router\\(\\);/' , '' , $ src ) ) ; // strip "use Core\Services\Contracts\Router;" if exists $ src = trim ( preg_replace ( '/use Core\\\\Services\\\\Contracts\\\\Router;/' , '' , $ src ) ) ; // append content to summery file if ( $ dest == '' ) { $ dest = PHP_EOL . 'use Core\Services\Contracts\Router;' . PHP_EOL . PHP_EOL . '$router = \Core\Application::router();' . PHP_EOL ; } $ dest .= PHP_EOL . '///////////////////////////////////////////////////////////////////////////////' . PHP_EOL . '// ' . $ package . PHP_EOL . PHP_EOL . $ src . PHP_EOL ; } $ this -> saveContent ( $ this -> getManifest ( 'routes' ) , '<?php' . PHP_EOL . $ dest ) ; }
Update manifest "routes.php"

@param bool $register
Update manifest routes . php