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

ExcludeFiles [READY CODE] #32

Open
Pok4 opened this issue Nov 7, 2023 · 3 comments
Open

ExcludeFiles [READY CODE] #32

Pok4 opened this issue Nov 7, 2023 · 3 comments

Comments

@Pok4
Copy link

Pok4 commented Nov 7, 2023

Ok, i find a way to fix my things in #31
Sorry for my english is not good at all...

Ok, open RobotLoader.php and find:
private array $excludeDirs = [];
after this line add:
private array $excludeFiles = [];

find:

public function excludeDirectory(string ...$paths): static
{
	$this->excludeDirs = array_merge($this->excludeDirs, $paths);
	return $this;
}

after this add:

public function excludeFiles($files)
{
	$this->excludeFiles = $files;
	return $this;
}

find:
exclude($this->ignoreDirs);
make it like this:
exclude($this->ignoreDirs)->exclude($this->excludeFiles);

After that you can use:
$loader->excludeFiles(['sql.php','en.php','es.php','bg.php','fr.php','ru.php','migrate.php']);

excludeDirs is working normal with this addon (i tested it).
Can you commit the changes ? :)

@Pok4
Copy link
Author

Pok4 commented Dec 3, 2024

We are in the end of 2024 and i'm still using the autoloader in my includes/ folder of my cms with this modifications above.
Can you add in next version something like that to exclude specific file names?
I want to delete this file and update the library from github with modifications..

@eydun
Copy link

eydun commented Dec 4, 2024

There is a standalone version of robot-loader, you can use and modify for your project.

#22

@Pok4
Copy link
Author

Pok4 commented Dec 4, 2024

yes, but i'm not prefer this version, because i'm using nette email library and other stuff, that depends on other nette libraries, so i need modifications on main version...

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

2 participants