Coder Social home page Coder Social logo

pablo-sg-pacheco / wp-namespace-autoloader Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 10.0 93 KB

A PHP autoloader class that follows the WordPress coding standards applying PSR-4 specification

PHP 100.00%
namespace wordpress wp-namespace-autoloader psr-4 autoloader

wp-namespace-autoloader's People

Contributors

brianhenryie avatar hemmesdev avatar pablo-sg-pacheco avatar szepeviktor 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

Watchers

 avatar  avatar  avatar

wp-namespace-autoloader's Issues

PHPUnit Code Coverage

I tried this on a project but my PHPUnit code coverage began reporting 0% code coverage. Once I used require_once for each class, it began working again. Is there a sample project I can follow so I know I have it configured correctly.

Please tag releases

Currently Composer errors out

Could not find a version of package pablo-sg-pacheco/wp-namespace-autoloader matching your minimum-stability (stable).

Can we arrange our classes in multiple directories?

In the classes_dir parameter, we have to specify the directory where our classes are located which we want to use for autoloading. For example, you said that if the classes are in the 'src' directory we have to specify 'src', and if the classes are in the root directory, nothing needs to be set.

My question is if we have split our classes into different directories, for example:
In root_dirctory/admin/includes (it holds admin classes) and root_directory/public/includes (it holds public classes)

In the above scenario, what do we have to specify in the classes_dir parameter? Should we leave it empty or should we write the name of both directories that holds our classes like:

'namespace_prefix' => 'My_Project',
'classes_dir' => [ 'admin', 'public' ]

Looking forward to your instructions on it.

A little request

Hi, first of all thank you for this class.

I need to know if you can use it to manage multiple directories.

In practice a coding similar to the following:

includes/my_classes and admin/includes/my__other_classes and public/includes/my_other_classes

and so on

Thanks in advance
Adriano

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.