Are there any more generic tools that can "compile" or basically merge multiple PHP files into a single file based on includes and autoloading classes? I'm thinking of something similar to Doctrine's compiling functionality or the compiling that many of the major JS frameworks do for "production" sites to lighten the file size and improv...
I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in .NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. The final consumer will be a PHP site so I need to make it consumable in PHP.
I got stumped when ...
So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year)
so if my array is
$a = ([0]=>"1980-04-14", [1]=>"2007-06-08",
[2]=>"2008-12-25", [3]=>"1978-11-03")
I'd like to sort it so it is ar...
I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have Googled for a while and cannot find any straightforward information. I followed this tutorial for a while, but I am having a hell of a time getting this to work. Does anyone know how to do this? Is there a...
What is the easiest way to encode a PHP string for output to a Javascript variable?
I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a Javascript variable.
Normally, I would just construct my Javascript in a PHP file, ala:
<script>
var myvar = "<?php echo $myVarValue;?>";
</s...
Is it possible to connect PHP to a SQL Server Compact Edition database? What would be the best driver?
...
I have a PHP web application on an intranet that can extract the IP and host name of the current user on that page, but I was wondering if there is a way to get/extract their Active Directory/Windows username as well. Is this possible?
...
I'm having trouble with my php code not indenting correctly...
I would like my code to look like this
if (foo)
{
print "i am indented";
}
but it always looks like this:
if (foo)
{
print "i am not indented correctly";
}
I tired googling for similar things and tried adding the following to my .emacs, but it didn't work a...
If I'm deep in a nest of loops I'm wondering which of these is more efficient:
if (!isset($array[$key])) $array[$key] = $val;
or
$array[$key] = $val;
The second form is much more desirable as far as readable code goes. In reality the names are longer and the array is multidimensional. So the first form ends up looking pretty gnarly...
Ok, I'm using the term "Progressive Enhancement" kind of loosely here but basically I have a Flash-based website that supports deep linking and loads content dynamically - what I'd like to do is provide alternate content (text) for those either not having Flash and for search engine bots. So, for a user with flash they would navigate to:...
The HttpRequestPool class provides a solution. Many thanks to those who pointed this out.
A brief tutorial can be found at: http://www.phptutorial.info/?HttpRequestPool-construct
Problem
I'd like to make concurrent/parallel/simultaneous HTTP requests in PHP. I'd like to avoid consecutive requests as:
a set of requests will take...
Hi All,
I'm getting an unexpected T_CONCAT_EQUAL error on a line of the following form:
$arg1 .= "arg2".$arg3."arg4";
I'm using PHP5. I could simply go an do the following:
$arg1 = $arg1."arg2".$arg3."arg4";
but I'd like to know whats going wrong in the first place. Any ideas?
Thanks,
sweeney
...
Hi, this code always returns 0 in PHP 5.2.5 for microseconds:
<?php
$dt = new DateTime();
echo $dt->format("Y-m-d\TH:i:s.u") . "\n";
?>
Output:
[root@www1 ~]$ php date_test.php
2008-10-03T20:31:26.000000
[root@www1 ~]$ php date_test.php
2008-10-03T20:31:27.000000
[root@www1 ~]$ php date_test.php
2008-10-03T20:31:27.000000
[root@www1 ...
When I run my php page, I get this error and do not know what's wrong, can anyone help? If anyone needs more infomation, I'll post the whole code.
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in
H:\Program Files\EasyPHP 2.0b1\www\test\info.php on line 16
<?PHP
$user_name = "root";
$passw...
What should happen when I call $user->get_email_address()?
Option 1: Pull the email address from the database on demand
public function get_email_address() {
if (!$this->email_address) {
$this->read_from_database('email_address');
}
return $this->email_address;
}
Option 2: Pull the email address (and the other User a...
There's another post on SO relating to .NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on Capistrano, but am curious what else is out there. Aside from the obvious reasons, I'm also looking to add some scripting so that the SVN rev number gets added in there ...
I'm having problems when trying to mock objects with __get and __set methods (using simpletest).
Writing mock responses for __get doesn't smell right - the tests seem too tightly tied to implementation. Any recommendations for testing, or should I just avoid the magic methods completely ?
...
I have an API that is dependent on certain state information between requests. As an easy first version of the code, I am simply using PHP session's to store the state information instead of something more advanced (APC, memcache, DB). Throughout my initial testing in a web browser, everything worked perfectly. However, it seems that whe...
I'm looking for a good inflection (or well, a library that can turn plural into singular and vice verse - which a kind of inflection) library for PHP, it could be a part of some current framework or a stand alone library the only requirement I have is that it's compatible with the MIT license.
...
Possible Duplicate:
Any good PHP IDE, preferably free or cheap?
I want to know if there's an IDE for PHP like Visual Web Developer for .net?
Thanks mates
...