Welcome Guest, Not a member yet? Register   Sign In
Codeigniter METHOD ??? -error ?
#11

[eluser]sarah fox[/eluser]
C:\home\sites\SITE-NAME\application\controllers\home.php = Yes

Tomorrow, I may just remove / rename the directories - & re-install Apache / CI from scratch



& may install my own "debug" class (If i'm bothered..) ) - To tell us (me) more information.. - But thats long-term not short-term Smile
#12

[eluser]sarah fox[/eluser]
Ok.. - COOL tool.

I used the PHP 'backtrace' command - (didn't know of it before) - Though I've figured it goes from bottom-up..

Here is the backtrace

I guess I'll re-install Smarty...

Quote:#0 include() called at [C:\usr\local\lib\codeigniter\current\system\libraries\Exceptions.php:127]
#1 CI_Exceptions->show_error(An Error Was Encountered, Unable to load the requested class: Smarty_parser, error_general, 500) called at [C:\usr\local\lib\codeigniter\current\system\codeigniter\Common.php:238]
#2 show_error(Unable to load the requested class: Smarty_parser) called at [C:\usr\local\lib\codeigniter\current\system\libraries\Loader.php:764]
#3 CI_Loader->_ci_load_class(smarty_parser, , ) called at [C:\usr\local\lib\codeigniter\current\system\libraries\Loader.php:96]
#4 CI_Loader->library(smarty_parser) called at [C:\usr\local\lib\codeigniter\current\system\libraries\Loader.php:999]
#5 CI_Loader->_ci_autoloader() called at [C:\usr\local\lib\codeigniter\current\system\libraries\Controller.php:83]
#6 Controller->_ci_initialize() called at [C:\usr\local\lib\codeigniter\current\system\libraries\Controller.php:43]
#7 Controller->Controller() called at [C:\home\sites\WEBSITE\application\controllers\home.php:11]
#8 Home->Home() called at [C:\usr\local\lib\codeigniter\current\system\codeigniter\CodeIgniter.php:201]
#9 require_once(C:\usr\local\lib\codeigniter\current\system\codeigniter\CodeIgniter.php) called at [C:\home\sites\WEBSITE\index.php:143]
#13

[eluser]sarah fox[/eluser]
IDENTIFIED ERROR FILE :- C:\usr\local\lib\codeigniter\current\system\libraries\Loader.php

I'm getting close, & I've also identified a flaw in the order / process of the Loader.php file..

First of, My output (I added a LOT of log_message lines Smile )

Quote:DEBUG - 2010-10-09 18:58:40 --> Config Class Initialized
DEBUG - 2010-10-09 18:58:40 --> Hooks Class Initialized
DEBUG - 2010-10-09 18:58:40 --> URI Class Initialized
DEBUG - 2010-10-09 18:58:40 --> No URI present. Default controller set.
DEBUG - 2010-10-09 18:58:40 --> Router Class Initialized
DEBUG - 2010-10-09 18:58:40 --> Output Class Initialized
DEBUG - 2010-10-09 18:58:40 --> Input Class Initialized
DEBUG - 2010-10-09 18:58:40 --> Global POST and COOKIE data sanitized
DEBUG - 2010-10-09 18:58:40 --> Language Class Initialized
DEBUG - 2010-10-09 18:58:40 --> Loader Class Initialized - View path /home/sites/SITENAME/application/views/
DEBUG - 2010-10-09 18:58:40 --> Helper loaded: url_helper
DEBUG - 2010-10-09 18:58:40 --> Helper loaded: my_headermessage_helper
DEBUG - 2010-10-09 19:03:52 --> loader.php - Library function - Library 'smarty_parser'
DEBUG - 2010-10-09 19:03:52 --> loader.php - Library function - Not array - library - 'smarty_parser'
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - class=smarty_parser
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - class 2 'smarty_parser'
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - Upper/Lower array 'Smarty_parser'
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - SUBCLASS NOW '/home/sites/SITENAME/application/libraries/MY_Smarty_parser.php'
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - File Exists '/home/sites/SITENAME/application/libraries/MY_Smarty_parser.php'
DEBUG - 2010-10-09 19:03:52 --> loader.php - _ci_load_class function - NOT File Exists 3 '/usr/local/lib/codeigniter/current/system/libraries/Smarty_parser.php'
ERROR - 2010-10-09 19:03:52 --> Unable to load the requested class: Smarty_parser

In this function - function _ci_load_class of Loader.php - I'll quote a bit..


Quote: // We'll test for both lowercase and capitalized versions of the file name
foreach (array(ucfirst($class), strtolower($class)) as $class)
{


log_message('debug', "loader.php - _ci_load_class function - Upper/Lower array '$class' ");


$subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.EXT;

log_message('debug', "loader.php - _ci_load_class function - SUBCLASS NOW '$subclass' ");


// Is this a class extension request?
if (file_exists($subclass))
{


log_message('debug', "loader.php - _ci_load_class function - File Exists '$subclass' ");

$baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT;
if ( ! file_exists($baseclass))
{
log_message('debug', "loader.php - _ci_load_class function - NOT File Exists 3 '$baseclass' ");
log_message('error', "Unable to load the requested class: ".$class);
show_error("Unable to load the requested class: ".$class);
}

The thing is - it HAS found file :- /home/sites/SITENAME/application/libraries/MY_Smarty_parser.php
But then /usr/local/lib/codeigniter/current/system/libraries/Smarty_parser.php is NOT found.


Why test for both of them if its going to fail on the 2nd one anyway ?? Shouldn't Codeigniter just test the 2nd one first & get it over with ?

(I'll copy it over & try again )
#14

[eluser]WanWizard[/eluser]
I think you are digging yourself in to the point where the pit is to deep to get out of.

Stick to the way Codeigniter works, and don't try to come up with strange setups, and then wonder why it doesn't work. Do not touch anything in system. Do not install anything there.

How you should install Smarty:
- create a directory called 'smarty' in application/libraries. Install Smarty in there.
- create a library called 'smarty_parser' in application/libraries:
Code:
<?php
require_once 'smarty/Smarty.php';

class Smarty_parser extends Smarty
{
    // do your thing here
}

- load it like a normal library and you're in business.




Theme © iAndrew 2016 - Forum software by © MyBB