I cant run codeigniter-restserver

746 Views Asked by At

im trying to run codeigniter-restserver. Here what i've done;

i installed latest codeigniter to my localhost. then in the root directory of clean installed codeigniter i runned

composer require chriskacerguis/codeigniter-restserver

the vendor directory is created and it is look like this;

-rw-r--r--   1 xx  staff  178 Mar 13 12:18 autoload.php
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 bin
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 chriskacerguis
drwxr-xr-x  11 xx  staff  352 Mar 13 12:18 composer
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 doctrine
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 mikey179
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 myclabs
drwxr-xr-x   5 xx  staff  160 Mar 13 12:18 phpdocumentor
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 phpspec
drwxr-xr-x   9 xx  staff  288 Mar 13 12:18 phpunit
drwxr-xr-x  12 xx  staff  384 Mar 13 12:18 sebastian
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 symfony
drwxr-xr-x   3 xx  staff   96 Mar 13 12:18 webmozart

i changed in the application/config/config.php line to;

$config['composer_autoload'] = TRUE;

and my new controller file looks like (application/controller/Rest.php);

<?php
use Restserver\Libraries\REST_Controller;

defined('BASEPATH') OR exit('No direct script access allowed');

class Rest extends REST_Controller {

    public function index_get() {

        echo json_encode(['wtf', 'igo']);

    }

}

when i try to reach http://mylocaltestdomainish.test/rest/

The configuration file rest.php does not exist.

i dont know why but, codeigniter-restserver is seeking rest.php in my /application/config/ directory instead of /vendor/chriskacerguis/codeigniter-restserver/application/config. if i copy rest.php in my config directory, than it says "i cant found Format.php" or something like this.

What i missing here? thanks for your advices.

0

There are 0 best solutions below