Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to run php file with command .for example: php index.php Home index #202

Closed
sajjadef98 opened this issue Mar 15, 2023 · 1 comment
Closed

Comments

@sajjadef98
Copy link

sajjadef98 commented Mar 15, 2023

how to run php file with command in bramus/router .for example in codeigniter : php index.php Home index
Home ---> Controller
index ----> Method

in Controller file

class Home {

    public function index() {
      echo "hi" ;
    }
}

and in router file

$router->get('/','Home@index');

command in public dir php index.php Home index

php index.php Home index
ErrorException {#21
  #message: "Warning: Undefined array key "REQUEST_METHOD""
  #code: 0
  #file: "C:\laragon\www\doc\vendor\bramus\router\src\Bramus\Router\Router.php"
  #line: 225
  #severity: E_WARNING
  trace: {
    C:\laragon\www\doc\vendor\bramus\router\src\Bramus\Router\Router.php:225 { …}
    C:\laragon\www\doc\vendor\bramus\router\src\Bramus\Router\Router.php:277 { …}
    C:\laragon\www\doc\Flare\app\Router.php:22 {
      require_once^
      ›
      › $router->run();
      ›
    }
    C:\laragon\www\doc\Flare\app\config.php:59 { …}
    C:\laragon\www\doc\public\index.php:5 { …}
  }
}
@uvulpos
Copy link
Collaborator

uvulpos commented Jun 10, 2023

this project was not intended to run without serving as a webserver. What you can do is, you can run a php dev-server locally and requests it from there

php -S 0.0.0.0:3000 router.php

@bramus bramus closed this as completed Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants