XXPerez / codeigniter-3-with-xhmvc

Codeigniter 3.1.3 with XHMVC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working loading libraries/drivers with standard controllers

ViVers opened this issue · comments

Hello, now there is problem with loading any library when it go to main controllers not in modules. It donesn't work for drivers and libraries in common and in apps controllers. Standars libraries are working.

My Log (added some point to debug)

INFO - 2016-02-20 11:51:13 --> Config Class Initialized
INFO - 2016-02-20 11:51:13 --> Hooks Class Initialized
DEBUG - 2016-02-20 11:51:13 --> UTF-8 Support Enabled
INFO - 2016-02-20 11:51:13 --> Utf8 Class Initialized
INFO - 2016-02-20 11:51:13 --> URI Class Initialized
DEBUG - 2016-02-20 11:51:13 --> No URI present. Default controller set.
INFO - 2016-02-20 11:51:13 --> Router Class Initialized
INFO - 2016-02-20 11:51:13 --> Output Class Initialized
INFO - 2016-02-20 11:51:13 --> Security Class Initialized
DEBUG - 2016-02-20 11:51:13 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-02-20 11:51:13 --> Input Class Initialized
INFO - 2016-02-20 11:51:13 --> Language Class Initialized
INFO - 2016-02-20 11:51:13 --> Language Class Initialized
INFO - 2016-02-20 11:51:13 --> Config Class Initialized
INFO - 2016-02-20 11:51:13 --> Loader Class Initialized
INFO - 2016-02-20 11:51:13 --> MX Loader started
INFO - 2016-02-20 11:51:13 --> Session: Class initialized using 'files' driver.
INFO - 2016-02-20 11:51:13 --> MX Loader initialized
INFO - 2016-02-20 11:51:13 --> Controller Class Initialized
INFO - 2016-02-20 11:51:13 --> MX Base initialized
ERROR - 2016-02-20 11:51:13 --> Severity: Warning --> ini_set(): A session is active. You cannot change the session module's ini settings at this time C:\wamp\www\xhmvc\core\system304\libraries\Session\Session.php 313
ERROR - 2016-02-20 11:51:13 --> Severity: Notice --> A session had already been started - ignoring session_start() C:\wamp\www\xhmvc\core\system304\libraries\Session\Session.php 140
INFO - 2016-02-20 11:51:13 --> Session: Class initialized using 'files' driver.
INFO - 2016-02-20 11:51:13 --> MX Loader started
INFO - 2016-02-20 11:51:13 --> MX Loader initialized
INFO - 2016-02-20 11:51:13 --> Controller Class Initialized
DEBUG - 2016-02-20 11:51:13 --> File loaded: C:\wamp\www\xhmvc\apps\application\views/welcome_message.php
INFO - 2016-02-20 11:51:13 --> Final output sent to browser
DEBUG - 2016-02-20 11:51:13 --> Total execution time: 0.0656

Dear Joel

Next week I will follow to detect this problems, thanks for your
collaboration
El 20/02/2016 11:54, "JoellSVK" notifications@github.com escribió:

My Log (added some point to debug)

INFO - 2016-02-20 11:51:13 --> Config Class Initialized
INFO - 2016-02-20 11:51:13 --> Hooks Class Initialized
DEBUG - 2016-02-20 11:51:13 --> UTF-8 Support Enabled
INFO - 2016-02-20 11:51:13 --> Utf8 Class Initialized
INFO - 2016-02-20 11:51:13 --> URI Class Initialized
DEBUG - 2016-02-20 11:51:13 --> No URI present. Default controller set.
INFO - 2016-02-20 11:51:13 --> Router Class Initialized
INFO - 2016-02-20 11:51:13 --> Output Class Initialized
INFO - 2016-02-20 11:51:13 --> Security Class Initialized
DEBUG - 2016-02-20 11:51:13 --> Global POST, GET and COOKIE data sanitized
INFO - 2016-02-20 11:51:13 --> Input Class Initialized
INFO - 2016-02-20 11:51:13 --> Language Class Initialized
INFO - 2016-02-20 11:51:13 --> Language Class Initialized
INFO - 2016-02-20 11:51:13 --> Config Class Initialized
INFO - 2016-02-20 11:51:13 --> Loader Class Initialized
INFO - 2016-02-20 11:51:13 --> MX Loader started
INFO - 2016-02-20 11:51:13 --> Session: Class initialized using 'files'
driver.
INFO - 2016-02-20 11:51:13 --> MX Loader initialized
INFO - 2016-02-20 11:51:13 --> Controller Class Initialized
INFO - 2016-02-20 11:51:13 --> MX Base initialized
ERROR - 2016-02-20 11:51:13 --> Severity: Warning --> ini_set(): A session
is active. You cannot change the session module's ini settings at this time
C:\wamp\www\xhmvc\core\system304\libraries\Session\Session.php 313
ERROR - 2016-02-20 11:51:13 --> Severity: Notice --> A session had already
been started - ignoring session_start()
C:\wamp\www\xhmvc\core\system304\libraries\Session\Session.php 140
INFO - 2016-02-20 11:51:13 --> Session: Class initialized using 'files'
driver.
INFO - 2016-02-20 11:51:13 --> MX Loader started
INFO - 2016-02-20 11:51:13 --> MX Loader initialized
INFO - 2016-02-20 11:51:13 --> Controller Class Initialized
DEBUG - 2016-02-20 11:51:13 --> File loaded:
C:\wamp\www\xhmvc\apps\application\views/welcome_message.php
INFO - 2016-02-20 11:51:13 --> Final output sent to browser
DEBUG - 2016-02-20 11:51:13 --> Total execution time: 0.0656


Reply to this email directly or view it on GitHub
#2 (comment)
.

Thank You :) There is problem config, language, controller, MX loader these classes are initialised twice. so this is root of problem...

Helo,

The "ERROR - 2016-02-20 11:51:13 --> Severity: Warning --> ini_set()", has been solved in previous push, no session errors detected now. Try to download a fresh clone, enable session driver in autoload and try again.

I'm looking for the main problem in base controllers...

Session problem is still there (it is from fresh install) try delete all modules and use default controller. This throw problem... also to load custom libraries -> "Message: Class 'CI_Auth' not found" (my custom authentication library)

I found a solution... All controllers, must to extends from MY_Controller, instead of CI_Controller !!

It's is a specification, you can't use HMVC to load something, and CI_loader to other.. because the _ci_classes is no shared between both.

Tell me if all works OK ...

Also, EVER use MY_Model for your models, not CI_Model

Oh jesus i din't realize that.. .Shame on me :D It is habit to consider preinstalled works without any change. It works :)

Also i would like you tu suggest my directory structure...
Apps/application/data/(apps php files)
apps/application/public/(storage for js,css, img)

and to index add define('PUBLICPATH, FCPATH . 'path to public');

there is good encapsualtion of whole app and constant add fast access to directory what can be combinated with helper for resource injection.

Hi,

I ever put the CSS, JS and IMG's that are related to a module, inside the same module es :
/module/mymodule/js
/module/mymodule/css
/module/mymodule/img

Then, use an apache Alias to allow access

http://myproject.local/media/mymodule/js/anyjs.js

In Apache, the media alias is created to have access to the modules folder:

Alias /media "E:/workspace/myproject/apps/base/application/modules"
<Directory "E:/workspace/myproject/apps/base/application/modules">
    Options FollowSymLinks
    AllowOverride All

    DirectoryIndex index.html

    <FilesMatch "\.(.*)$">
            Order Deny,Allow
            Deny From All
    </FilesMatch>

    <FilesMatch "\.(js|css|gif|png|jpg|jpeg|svg|ico|css\.gz|js\.gz)$">
            Order Deny,Allow
            Allow From All
    </FilesMatch>
</Directory>

This allows to have ALL files that owns the module under the same file structure !!

Closing issue