Giter VIP home page Giter VIP logo

simple-autoloader-for-wordpress's People

Contributors

clifgriffin avatar drewapicture avatar pixolin avatar tommcfarlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

simple-autoloader-for-wordpress's Issues

README inconsistencies

Getting Started states:

Add include_once 'lib/autoload.php' to your main plugin file.

but Adding The Autoloader states

Then, at the top of your plugin file add the following: require_once 'lib/autoload.php';

So is include_once or require_once recommended?

Multiple autoloaders

Maybe I need to do some more homework but I was under the impression that once you register an autoloader all class requests will attempt to be processed. Yet, currently, there are no tests for (more of less) "is this a class we know about or not?"

For example, in the autoloader mentioned in the other issue (by @carlalexander) on line 26 he checks for:

if (0 !== strpos($class, 'CommentIQ')) {
return
}

https://github.com/postmatic/elevated-comments/blob/master/src/CommentIQ/Autoloader.php

Once you have more than one autoloader is something like this necessary?

On the same note, prior to doing the require wouldn't it be wise to check that the file exists? Just to be safe?

Good stuff either way. Thanks for sharing.

Demo plugin

I'm a little struggling with namespaces and autoloaders, is it possible to get a demo plugin in the docs?

Add interface support

We've implemented a slightly modified version of this autoloader in a theme and needed interface support.

Incoming PR leverages a naming convention (I know, ick) that supports both prefixing and suffixing depending on developer preference, Interface_Foo or Foo_Interface.

Namespace / Directory layout

Posting here by your request:

I'm thinking through a plugin namespace/directory layout using your new autoloader.

Typically I'd have my bootstrap file load the main plugin class, and the admin plugin class (in the admin context).

Any thoughts on where you'd put the main plugin class?

It's obvious for things like Models and Controllers, and maybe this is indicative that I'm putting too much on a God-class but I'd love your ideas.

Thanks in advance!

Missing file_exists() check

https://tommcfarlin.com/namespaces-and-autoloading-2017/ actually says,

Note that this code is not checking to see if the file exists. Though I recommend it, it’s been left out for the sake of length and because, in our example, we know the file does exist.

:)

I didn't submit a PR because your article says there are a few options for what to do if it doesn't exist and I didn't want to waste time writing one if you preferred another.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.