Comments (7)
This constant is useless, I'm voting to remove it.
from codeigniter4.
I agree with @narfbg. In the 10 or so years that I've been working with CI, I don't think I've ever found a need for that. And it's handled by the $systemFolder variable if you want to change it.
from codeigniter4.
It's been removed.
from codeigniter4.
I think that the same remove can be made and on other constants. Path Class is a lot better choice to register and handle paths..
from codeigniter4.
I don't see a path class being beneficial here. The way CI has always done it is simple, by creating constants for paths that are constant. They're available sitewide. And they use less resources than a class would.
from codeigniter4.
I can't give any 100% important reason to have class instead of just constants.
But at least what I understand from OOP developement, hard coded constants are not really beautiful solution.
Instead all over the code to check if file_exists(SOMEPATH. 'folder/file') and to require it..
You can just use 1 already loaded resource to get the existing path of the file which you need and if it doesn't you will get proper exception/error (not existing no permissions and etc)..
Of course this has something to do and with the Loaders..
from codeigniter4.
Like anything else, OOP design can be taken to extremes it really doesn't need to be.
In this case, you're right, that's more to do with a loader, or some other class. But if you go the route of creating OOP wrappers for all of PHP's non-OOP functions, things get a little crazy. :) In this case, your example, while a valid function (not necessarily requiring an entire class, but could be ...) would replace if file_exists
calls with try/catch blocks
throughout the code, which can harm performance, and isn't anymore beautiful when all you want to do is see if file exists
....
I'm not saying your class idea doesn't have certain appeals for different situations, but for this one, I think it's overkill and complicates things instead of simplifies them.
from codeigniter4.
Related Issues (20)
- Bug: [DatetimeCast] Invalid parameter: nullable HOT 3
- Bug: CLI class, method promptByMultipleKeys() - default $input is of wrong type HOT 1
- Bug: No DBPrefix or backticks inside SQL functions in QueryBuilder HOT 16
- Bug: Can not header reponse as file image HOT 2
- Bug: [View Cells] Too few arguments to function App\Cells\MyClass::myMethod(), 0 passed in HOT 3
- Bug: CodeIgniter\Controller::validateData will throw error if first paramter is not an empty array for file upload validation HOT 4
- Bug: language fallback doesn't kick in if message if empty HOT 5
- Bug: Session FileDriver unlink No such file or directory HOT 1
- feat: Command `lang:find` behavior with parameters
- Bug: Credit card validation does not work with multiple card HOT 1
- Bug: postgre can not connect to database error HOT 12
- `Model::paginate()` behavior when `$page` exceeds the last page HOT 12
- Bug: CodeIgniter v4.5.1 When I connect Postgres Database I Received Error HOT 4
- Bug: [Error] Call to undefined method Config\Mimes::__set_state() at ROOTPATH/writable/cache/FactoriesCache_config HOT 7
- Bug: [DebugBar] Flush a session flash-data when redirect by "Refresh" method HOT 2
- Add required_if validation rules
- Bug: Entity Standalone Class initialization error HOT 2
- Bug: How can I know which browser name is the request from?
- Bug: How can I know which browser name is the request from? HOT 14
- Bug: storing validation rules in Config/Validation causes error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter4.