Welcome Guest, Not a member yet? Register   Sign In
Bug? Vendor Routes are loaded before Filters
#10

(This post was last modified: 05-24-2021, 02:43 PM by stopz.)

(05-24-2021, 04:33 AM)MGatner Wrote: If you workaround is something appropriate for a core solution then I encourage you to submit it as a Pull Request! Our team relies on the community for work like this, because we are too small to handle everything ourselves.

I would love to contribute to CodeIgniter, in fact it's one of my dreams. I was following good coding practises whilest working around this bug thus i did not touch CI core files- thus right now i have nothing to contribute to CI core.

What i did here on my end is: to have a private function in controller which i'm calling on each public endpoint for a case of early return. Quick and dirty- will do while next update is on it's way.

Shortly in this year i will get some spare time but then i will need some advice/help or welcome-guidance from someone already working with CI core to get me started.

This project is huge and i think focusing me into some narrow slice of it (a branch) would be the best approach. Example: If i am right and Factories::<component> by instanciating new object does not take into account for incoming $arguments at system/Config/Factories.php:120 then there's a huge potential of taking even more out of this technique:

Take an array of 1000 Entities who each have to access a Class Table but all of them are using only 10 different Tables. Thus each Entity would call a table Facotry with constructor parameters to construct that table class.

Now at the moment we're constructing 1000 table classes couse we can't use getShared in order to have different constructor arguments. Understandably we could sort our entities by table's they require and work around this mess to optimize it, but i would rather rely on underlying framework (and the best is CI) to do the heavy lifting for me by hashing

PHP Code:
$argument_hash crc32b(serialize($arguments)); 

and concatinating it to

PHP Code:
self::$instances[$options['component']][$class $argument_hash] = new $class(...$arguments); 

So each time i request a getShared Factory with identical construction arguments i actually get the correct instance of it Smile
Reply


Messages In This Thread
RE: Bug? Vendor Routes are loaded before Filters - by stopz - 05-24-2021, 02:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB