avenirer / codeigniter-matches-cli

Codeigniter Matches is a PHP CLI script that allows you to write controllers, models and views faster.
64 stars 35 forks source link

config file uri_protocol config variable issue #3

Closed tapankumar closed 10 years ago

tapankumar commented 10 years ago

As per docs, we should put below line under config.php after $config['uri_protocol'] = 'AUTO';

$config['uri_protocol'] = isset($_SERVER['REQUEST_URI']) ? 'PATH_INFO' : 'CLI';

However after generating model, view,controller with matches command "php index.php matches create app blog", i am not able to access generated method via web links like http://localhost/ci3new/blog

If i change config like below $config['uri_protocol'] = isset($_SERVER['REQUEST_URI']) ? 'AUTO' : 'CLI';

It works perfectly fine.

Note: I am on windows 8 64 bit, Apache and using below .htaccess under my new codeigniter project (Testing only).

RewriteEngine On RewriteBase /ci3new/ ``` RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] ```

avenirer commented 10 years ago

Thank you for being the first one who put an issue on the table. And thank you for taking time to see where the "problem" was. But as many developers said before me: "This is not an bug, it's a feature". The script is not meant to be accessible from the browser. Is a php CLI script. This means you can access it only from the command line.

Go to the instructions if you want to know how to access the script from command line (http://avenirer.github.io/codeigniter-matches-cli/).

You can also try the Codeigniter manual (https://ellislab.com/codeigniter/user-guide/general/cli.html).

If you are still in the dark, try this great tutorial from which my project started: https://www.daniweb.com/web-development/php/code/477847/codeigniter-cli-trainer-script-creates-simple-application