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

Command System #14

Open
DanielSiepmann opened this issue Jan 12, 2012 · 2 comments
Open

Command System #14

DanielSiepmann opened this issue Jan 12, 2012 · 2 comments

Comments

@DanielSiepmann
Copy link
Collaborator

Currently all commands are in one folder.
The commands aren't configurable.

Change that.

@ghost ghost assigned DanielSiepmann Jan 12, 2012
@DanielSiepmann
Copy link
Collaborator Author

Take a little look at the mind map (http://layne.dyndns.org/coding/mindmap_ircbot.pdf)

We'll add a manager that will read all available commands and cache them in a file.
If this file exist, he will use this instead of scanning again.

You can add commands or packages (same as modules, just a collection of commands) using the manager.

@DanielSiepmann
Copy link
Collaborator Author

We can use the following to use dynamic namespaces and classes. We need this, because we 'll create namespaces and classnames from the filesystem (http://de3.php.net/manual/en/language.namespaces.dynamic.php):

namespace Test1 {

    class test1 {

        public function getName() {
            return __CLASS__;
        }

    }
}

namespace Test2 {

    class test2 {

        public function getName() {
            return __CLASS__;
        }

    }
}

namespace {
    // Global namespace
    $namespace = 'Test1';
    $classname = 'test1';

    $fullyname = $namespace . $classname;
    $debug = new $fullyname;
    echo $debug->getName();

    $namespace = 'Test2';
    $classname = 'test2';

    $fullyname = $namespace . $classname;
    $debug = new $fullyname;
    echo $debug->getName();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant