Welcome Guest, Not a member yet? Register   Sign In
FileCollection and addDirectory
#1

Hello,
I was trying to use the FileCollection class that is documented at https://codeigniter.com/user_guide/libra...ollections but I can't get it to work and I don't know if the problem is me or the documentation Big Grin
I just did something stupid like this in a class that extends a BaseCommand.

PHP Code:
$Scripts = new \CodeIgniter\HTTP\Files\FileCollection([]);
 
$Scripts->addDirectory(APPPATH.'Database/sqlUpdates');
$Scripts->retainPattern('*.sql');
CLI::write(count($Scripts)." found in the App/Database/sqlUpdates folder"); 


Nothing too fancy. and pretty similar to the example given.
Running this I get:

Code:
Call to undefined method CodeIgniter\HTTP\Files\FileCollection::addDirectory()

which frankly seems reasonable since I have nothing called "addDirectory" (neither retainPattern) in my entire source tree.

I feel like I'm missing something obvious, can someone give me an hint?

Thanks.
Reply


Messages In This Thread
FileCollection and addDirectory - by skeyby - 01-23-2022, 07:25 AM
RE: FileCollection and addDirectory - by iRedds - 01-23-2022, 01:13 PM
RE: FileCollection and addDirectory - by skeyby - 01-23-2022, 01:31 PM
RE: FileCollection and addDirectory - by skeyby - 01-23-2022, 01:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB