Comments (2)
If you're looking towards method cleanup in general, can I also add that I would like to see fURL as instantiable and able to modify (as it can with the current URL) a particular URL...
I'm not sure how you would go about cleanly maintaining backwards compatibility and not have more confusing methods, but it would be nice if I could create a URL object with any URL I want and use replaceInQueryString() and removeFromQueryString() or equivalents.
from flourish-classes.
Also, if the plan would be to have parts, might I suggest piggybacking the PHP parse_url constants?
fURL::get('http://www.example.com:8080/whatever/test?q=answer')->parse(PHP_URL_PORT);
fURL::get('http://www.example.com:8080/whatever/test?q=answer')->replaceInQuery('q', 'new_answer');
Similar to fDate() these objects could be immutable, so the methods always return new instances with differing internal states... the __toString() could always return the full URL, calling fURL::get() without a parameter would create an fURL object of the current URL. Idea being, if I pass fURL::get() to a method that takes a string, the __toString() method should be invoked, maintaining some if not all backwards compatibility.
Oh, and lastly, any ORM registered URL columns for validation, etc, could return fURL objects. Could even keep things consistent with a prepare() method, perhaps that could replaced %tokens with values. $url->prepare('%s%d%p/%r?%q') [scheme, domain, port, request, query]
from flourish-classes.
Related Issues (20)
- fCache unserialize error
- fEmail exec shell_exec check doesn't make sense
- fActiveRecord silently overrides some column defaults on insert HOT 1
- loadHTMLBody Issues
- fResult doesn't unescape integer and float types.
- parseResponse in fMailbox.php dies when the mail subject includes {123456} HOT 3
- Any way to add non database "fields" to fActiveRecord?
- Creating functions and procedures
- Send email as Content-Transfer-Encoding: 8bit
- fEmail: Validate error at UTF-8 encoded recipient
- Double quotes in Email subject are not fecthed HOT 1
- PostgreSQL fActiveRecord::populate sets auto_increment field to 0 as default
- Microsoft Outlook Web Access and certain attachments (Content-ID)
- fMailbox.php doesn't always split the references in to an array as expected
- listMessages() returned empty array due to trailing whitespace in IMAP response HOT 1
- Type: fConnectivityException Message
- Is the project dead? HOT 8
- Can you advice me how to catch all errors and print them nicely using the flourish fCore? HOT 3
- Command Line Script HOT 1
- Database table have the specified column but script stop working
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 flourish-classes.