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

Documentation and File placement question #5

Open
pf-tech opened this issue Nov 13, 2022 · 0 comments
Open

Documentation and File placement question #5

pf-tech opened this issue Nov 13, 2022 · 0 comments

Comments

@pf-tech
Copy link

pf-tech commented Nov 13, 2022

Sorry, I'm sure this is a very basic question that everyone but me will know the answer to, but where exactly do all these files go?

1st. namespace PackageLoader <-- root public_html (var/www/project) ? the vendor directory with the composer directory in it? the public folder of the m-v-c pattern that is actually handling the file routing for the site? not sure?

2nd.
// You load the PackageLoader
include DIR.'/PackageLoader.php';

// You load your packages
$loader = new PackageLoader\PackageLoader();
$loader->load(DIR."/vendor/composer");

Is this at the top of all my Controller files? Core files? Module files? Is it only my "composer's autoload.php" file? Where does this go? Is it its own file? Is it actually the same as #3?

3rd.
I'm 99% sure these are the normal calls at the top of a class file call,

// You call the package classes
new CompanyName\PackageName\Machin();
new CompanyName\PackageName\Bidule();
new RoutePlanner\Truc();
new TestNoNamespace();

and can be in any class file, Controller, Module, Core, etc., yes?


When I put the PackageLoader.php in my var/www/package directory where my composer.json file was located, and then changed my composer/autoload.php to be the items in #2, it broke the site, so I was wrong on that assumption. Or maybe I need to then go and update all my class calls on my Controllers?

Sorry for the newbie questions.

Screenshot 2022-11-13 091035

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

No branches or pull requests

1 participant