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

Class 'Config\App' not found #12

Closed
exbit opened this issue Feb 28, 2016 · 10 comments
Closed

Class 'Config\App' not found #12

exbit opened this issue Feb 28, 2016 · 10 comments

Comments

@exbit
Copy link

exbit commented Feb 28, 2016

Error

Class 'Config\App' not found

BASEPATH/CodeIgniter.php at line 163

155
156 Hooks::trigger('pre_system');
157
158 //--------------------------------------------------------------------
159 // Get our Request and Response objects
160 //--------------------------------------------------------------------
161
162 $config = new \Config\App();
163
164 $request = is_cli()
165 ? Services::clirequest($config)
166 : Services::request($config);
167 $request->setProtocolVersion($_SERVER['SERVER_PROTOCOL']);
168 $response = Services::response();
169

@benedmunds
Copy link
Collaborator

v3 is not functional yet. Please use v2.

@exbit
Copy link
Author

exbit commented Feb 28, 2016

Which version is it?

@benedmunds
Copy link
Collaborator

ha my bad, I replied to the wrong project

@lonnieezell
Copy link
Member

First - you realize this hasn't been released, yet, right? Which means I can't support it a whole lot right now. :)

Additional details are always helpful, though:

  • how fresh is the code you're trying to install?
  • What OS are you running?
  • Have you tried debugging it at all yourself and, if so, what did you find?

@exbit
Copy link
Author

exbit commented Feb 29, 2016

latest revision - 852d49f
W10-x64+php-7.0.4RC1-Win32-VC14-x64+httpd-2.4.18-win64-VC14
if before
$config = new \Config\App();
add
require_once APPPATH.'Config/App.php';
is displayed
404 - File Not Found
Sorry! Cannot seem to find the page you were looking for.

@sv3tli0
Copy link
Contributor

sv3tli0 commented Feb 29, 2016

Interesting why there is a namespace "Config" and with that classes as Config/App ..
It should be Appnamespace/Config/App.

Those configurations are part of the application and I don't see what point may exist of having them under different namespace ?

One big minus will be if there exists and is used some namespace which is really common word as "Config" . I have met a few times problems related to same namespaces usage in a project and required library loaded with Composer..

How ever.. this is a build in progress so there is no big point of such discussions 👍

@lonnieezell
Copy link
Member

@exbit - The autoloader should take care of finding that file for you. Strange that it's not, though I haven't run any tests on Windows yet, as I'm on a Mac. I guess it's finally time to upgrade Parallels so I can run some tests on Windows. :) Any chance you can step through the code with XDebug and see why it's not finding it in the autoloader until I have time to get a working Windows rig setup here again?

@sv3tli0 There is the possibility of a namespace collision, using something simple like Config, true, although I don't know that I've ever seen that one show up. It was done to make it possible to change the App namespace and yet still allow system to know how to find the config files. Seems I tried using the constant and didn't have any luck in system files, but will have to investigate again.

@exbit exbit mentioned this issue Mar 16, 2016
@lonnieezell
Copy link
Member

@exbit - did you find a solution for this other than simply requiring the file explicitly? I've finally got a setup up and running where I can start to explore it on Windows. Need to get xdebug installed and step through the code, but I'm out of time for today.

@exbit
Copy link
Author

exbit commented Mar 17, 2016

While no solution found, Timeline: Bootstrap
Routing Timer
Controller Timer
Controller Constructor
View: welcome_message.php - not to goes

index.php
require './vendor/autoload.php';

CodeIgniter.php
require APPPATH.'Config/App.php';
require APPPATH.'Config/Logger.php';

I think the problem is in the paths to the files

@lonnieezell
Copy link
Member

I believe I found it. Filename sanitizer in Autoloader was doing too good of a job.

Sosko added a commit to Sosko/CodeIgniter4 that referenced this issue Sep 24, 2020
If thy table haven't primary key, and i pass $returnID = false, than the ci4 throw this error:
```
CRITICAL - 2020-09-24 00:47:00 --> pg_query(): Query failed: ERROR:  lastval is not yet defined in this session
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'pg_query(): Que...', '/var/www/ci4/sy...', 196, Array)
codeigniter4#1 /var/www/ci4/system/Database/Postgre/Connection.php(196): pg_query(Resource id codeigniter4#9, 'SELECT LASTVAL(...')
codeigniter4#2 /var/www/ci4/system/Database/BaseConnection.php(741): CodeIgniter\Database\Postgre\Connection->execute('SELECT LASTVAL(...')
codeigniter4#3 /var/www/ci4/system/Database/BaseConnection.php(669): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT LASTVAL(...')
codeigniter4#4 /var/www/ci4/system/Database/Postgre/Connection.php(519): CodeIgniter\Database\BaseConnection->query('SELECT LASTVAL(...')
codeigniter4#5 /var/www/ci4/system/Model.php(887): CodeIgniter\Database\Postgre\Connection->insertID()
codeigniter4#6 /var/www/ci4/app/Models/MyModel.php(46): CodeIgniter\Model->insert(Array, false)
codeigniter4#7 /var/www/ci4/app/Controllers/MyController.php(113): App\Models\MyModel->new_connection('1', '1')
codeigniter4#8 /var/www/ci4/app/Controllers/MyController.php(54): App\Controllers\MyController->do_create_connection()
codeigniter4#9 /var/www/ci4/system/CodeIgniter.php(918): App\Controllers\MyController->create_connection()
codeigniter4#10 /var/www/ci4/system/CodeIgniter.php(404): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\MyController))
codeigniter4#11 /var/www/ci4/system/CodeIgniter.php(312): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
codeigniter4#12 /var/www/ci4/public/index.php(45): CodeIgniter\CodeIgniter->run()
codeigniter4#13 {main}
CRITICAL - 2020-09-24 00:47:00 --> Uncaught CodeIgniter\Format\Exceptions\FormatException: Failed to parse json string, error: "Type is not supported". in /var/www/ci4/system/Format/Exceptions/FormatException.php:9
Stack trace:
#0 /var/www/ci4/system/Format/JSONFormatter.php(71): CodeIgniter\Format\Exceptions\FormatException::forInvalidJSON('Type is not sup...')
codeigniter4#1 /var/www/ci4/system/API/ResponseTrait.php(414): CodeIgniter\Format\JSONFormatter->format(Array)
codeigniter4#2 /var/www/ci4/system/API/ResponseTrait.php(134): CodeIgniter\Debug\Exceptions->format(Array)
codeigniter4#3 /var/www/ci4/system/Debug/Exceptions.php(168): CodeIgniter\Debug\Exceptions->respond(Array, 500)
codeigniter4#4 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
codeigniter4#5 {main}
  thrown
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
codeigniter4#1 {main}
```
This will skip to getting inserted ID
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

4 participants