// @crypticツ how about
class CdnResolver
{
private $httpClient;
private $cdnUrls;
public function __construct(HttpClient $httpClient)
{
$this->httpClient = $httpClient;
$this->locations = new SplObjectStorage;
}
public function addCdnUrl(Url $url)
{
$this->cdnUrls->attach($url);
}
public function resolve()
{
foreach ($this->cdnUrls as $cdnUrl) {
$response = $this->httpClient->head($cdnUrl);
@crypticツ yeah, dont mind it. It's what happens when you let someone with OO brain damage rewrite a pragmatic working function. Basically, the main thing in your function that needs fixing is that you dont set stream_context_set_default back to use GET, which means all your further calls to the http stream wrapper will use HEAD requests. So that's a bug.
@Gordon is there a quick way to do that without repeating the same thing with HEAD changed to GET or a way to just set the stream context for just that one use.
$a is a string that holds the value "2".
Strings in PHP can be indexed to access their characters using square brackets. For example:
$a = "abcde";
echo $a[3]; // This will print 'd'
When the index is a string, PHP tries to parse it as an integer. If the string is not a number, parsing will...
@crypticツ $default = stream_context_set_default($default_opts); and when you are done, you just use $default (which is the old context) and set it back
As part of an HUD I'm designing, I'd like to use this symbol: 🏥
Since my site serves files in Windows-1252, any characters outside the 0-255 range are represented as &#x____;, with appropriate hex digits filling in the blank. In this case: 🏥
However, when testing this out I noticed that...
I think I will pimp my HTML 2 Wordpress theme and create an image filter that is rasterizing images to 16 colors or 256 colors fixed palette when uploaded.
It is not only enough to properly encode the charset information inside your HTML document, but on the other hand, the browser must be able to use the right encoding (check the settings) and it must be able to display it. In the following example, the browser is properly configured, it is just th...
I am stuck in an issue , i have multiple check boxes against each user , I need to update database based on the selection of these check box . i want to know how do i store this info in database . Do i use Switch for each like below switch ($msg_id) { case "1":
SQL Query to update for 1 break; case "2": SQL Query to update for 2 break; case "3": SQL Query to update for 3 break;
}
What would be DB table structure for this
in above scenario , msg_id is the primary key of message table
Item 1: Please don't use the mysql extension for PHP. Its old, its insecure, it is also deprecated. USe mysqli, pdo, or other modern extention. 2 : The SQL command your looking for is 'UPDATE'. 3 : I am here...but Im also at work :)
@tereško i seriously don get why would you say that , i had some doubt and wish to clarify with expert help . i accept that i am a newbee to this site but that does not mean i cant use it
@MadaraUchiha i feel Unity is counter-productive development wise (you have to move your mouse to the left and wait 1 whole second!!! inacceptable.), maybe useful for entertainment/slaking => therefore went with XFCE
it's handy, if you have a typical Setup, like the Browser on the left, the terminal on the right... it's not only the terminal, just type [MOD4(Windoskey)] + [Enter] and run any progam.
It's lightweight like fluxbox, but with gnome/unity you have the best of both worlds.
@MadaraUchiha If you want to have more than one window open and don't like overlapping windows, a tiling WM assists like a LayoutManager for windows, but also makes it easy to move windows to another workspace and switching workspaces.
@MadaraUchiha on Ubuntu you have only apt-get install awesome, but then it' doesn't look good as unity, you have to Setup a Session for Gnome (described here: keramida.wordpress.com/2012/10/18/awesome-wm-in-ubuntu-12-04 ), after that you have the best of both worlds.
well , it's one of the slowest , when the update will break something , you will have to reinstall it (because you will have no clue how to fix anything) and on subjective note - i hate unity
> We now have a target date of the weekend of 4th/5th May for the release. We have checked with core teams, and this seems to be acceptable for everyone. This means we are able to begin the final preparations for a release of Debian 7.0 - "Wheezy".
> To reduce the complexity of both the TCP/IP stack and the web server, the web server does not parse incoming requests. Instead, it uses the TCP port number of the incoming connection to distinguish between different pages or pictures.
isnt having a compiler/interpreter for a language, written in the language, one of the core requirements for declaring a language as stable/standard/mature