ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Codeigniter Hook Based Plugin System

March 08, 2011 10:09pm

Subscribe [8]
  • #16 / Aug 17, 2011 1:06am

    Timothy_

    100 posts

    Hello,

    I have tracked down the line where your library is crashing.

    Its line 184

    // If the file was included
    @include_once $this->plugins_dir.$name."/".$name.".php";

    I echoed $this->plugins_dir.$name.”/”.$name.”.php”; and the paths seems fine.

    I appreciate that you are probably very busy, however it would be great if you could give me an indication if you are likely to pursue this in the near future.

    Thanks,

    Tim

  • #17 / Aug 17, 2011 1:08am

    Timothy_

    100 posts

    Hello,

    I also tested on a clean version of CI 2.0.2 on PHP Version 5.3.5.

    Same 500 internal server error so I don’t think this is just my problem.

    Thanks,

    Tim

  • #18 / Aug 17, 2011 8:11pm

    Vheissu

    278 posts

    Out of curisosity are you loading a plugin you’ve made yourself or a plugin that came with the library? The library expects a filename of the same name as it’s parent folder in lowercase to be there. So if you have a plugin called ‘news’ (that’s the folder name) then a file called ‘news.php’ is expected inside of that folder.

    Looks like it could be trying to load a plugin file that isn’t correct. Case of the name is very important.

  • #19 / Aug 17, 2011 11:19pm

    Timothy_

    100 posts

    Hello,

    I haven’t gotten to the stage of creating plugins as it’s very difficult to ignore a 500 internal server error whenever I include your library.

    I am using the two examples you have included.

    plugins -> helloworld -> helloworld.php
    plugins -> cimarkdown -> cimarkdown.php
    plugins -> cimarkdown -> markdown.php

    I have tried on two seperate OS’s, Ubuntu and Snow leopard. I have tried two different versions of PHP 5.3.3 and PHP 5.3.5 and I have tried with a completely new downloaded version of CI 2.0.2

    As I mentioned I echoed out the paths before the include statement and they are fine and match the files perfectly.

    I havent changed your file structure, I copied and pasted all the files very carefully.

    Thanks,

    Tim

  • #20 / Aug 19, 2011 3:25am

    Timothy_

    100 posts

    Hello Vheissu,

    Which version of PHP and CI are you running?

    Thanks,

    Tim

  • #21 / Aug 20, 2011 2:42am

    Vheissu

    278 posts

    This is very pecuilar. I wonder if it’s some kind of paths issue. I am using the latest copy of XAMPP so the following;

    Apache 2.2.17
    MySQL 5.5.8
    PHP 5.3.5

    I know Windows and UNIX paths are different, this could perhaps be the reason. Need to fire up my Mac Mini and have a look, this is friggen troubling, haha.

  • #22 / Aug 20, 2011 8:50am

    NeoArc

    164 posts

    Hi. Sometimes you have to use DIRECTORY_SEPARATOR in windows.

  • #23 / Aug 20, 2011 8:37pm

    Vheissu

    278 posts

    I was using the constant FCPATH to set the default path, but found it to be unreliable. So now I’m using APPPATH and replacing the /application port of it and it seems to work. Would love for people to test though. Also did some optimisation on queries to stop unnecessary overhead.

    For the paths issue, I’ve forced it by default to use forward slashes as they seem to work on NIX file systems and Windows file systems.

  • #24 / Aug 22, 2011 8:21pm

    Timothy_

    100 posts

    Hello Vheissu,

    It seems you have fixed the issue I posted relating to the paths, however I am still getting a 500 internal server error.

    This time something different happens though. The entire server hangs for about 10 seconds before the crash.

    It happens when Line 195 is called

    do_action('install_' . $name);

    I am on Snow Leopard
    PHP 5.3.5

    Thanks,

    Tim

  • #25 / Aug 28, 2011 6:20pm

    Timothy_

    100 posts

    Hi Vheissu,

    How are things?

    I’m still trying to find a resolution to my latest problem with this library.

    When I comment out the following function starting on line 576 the library starts working again.

    function do_action($name, $arguments = "")
    {
        return Plugins::instance()->do_action($name, $arguments);
    }

    I hope you are still keen to help me out with this because I’m really keen to use this library.

    Thanks,

    Tim

  • #26 / Aug 31, 2011 10:19pm

    Timothy_

    100 posts

    Hello,

    Is anyone else able to confirm that this a problem? Or alternatively confirm that this library is working perfectly?

    Can anyone else recommend a plugin library for codeigniter?

    Any help would be appreciated.

    Thanks,

    Tim

  • #27 / Mar 12, 2012 3:28pm

    Min2liz

    1 posts

    Hi Timothy,

    I have some issue with this library. Just downloaded fresh CI 2.1.0, added your library, import plugin.sql and get lots of error’s:

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Object of class Welcome could not be converted to int
    
    Filename: libraries/Plugins.php
    
    Line Number: 60
    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Trying to get property of non-object
    
    Filename: libraries/Plugins.php
    
    Line Number: 62
    Fatal error: Call to a member function database() on a non-object in \application\libraries\Plugins.php on line 62

    Here is autoload:

    $autoload['libraries'] = array('database','plugins');
  • #28 / Nov 07, 2012 8:09am

    @MaxG

    14 posts

    I have the same Error like Timothy

  • #29 / Nov 08, 2012 12:30am

    umefarooq

    690 posts

    hi guys in php 5.3 and later variable passing by reference is deprecated that why getting error just change code at line 60 will work

    $this->_ci &= get_instance();

    to

    $this->_ci = get_instance();
  • #30 / Nov 08, 2012 8:46am

    @MaxG

    14 posts

    Heyo,

    The Error comes just, if i activate the plugin or the plugin isnt in the DB.

    Greets

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases