If you ever stumble upon the situation where you have to mock a Doctrine Record (Doctrine 1) and you have to change the behavior of a getter
you’ll see that the obvious way is not the way to go.
My first attempt was to just mock the getter method as shown in the PHPUnit [...]
After having some troubles installing an up to date version of PHPUnit in OpenSuse 11.4 (Packages from the repository are 3.4.x the current version is 3.6.x).
I found found a solution that worked for me on stackoverflow.com.
Here’s a short snippet with all commands needed assuming php5-pear is allready installed.
Just a quick note on accessing BLOB values with Propel-ORM
Propel returns Properties stored as BLOB in MySQL as Stream-Resource.
Reading the data can be easily done with PHP’s function stream_get_contents() the pitfall here is the object-pooling Propel does.
A Stream-Resource can only by read once [...]
Here’s a short code snippet that gives you status information of the sql server.
<?php $info = Doctrine_Manager::connection() ->getDbh() ->getAttribute(PDO::ATTR_SERVER_INFO) ; echo $info; ?>
output will be something like this:
Uptime: 18756 Threads: 1 Questions: 402157 Slow queries: 0 Opens: 903 Flush tables: 1 Open tables: 64 Queries per second avg: 21.441
If you want to redirect all Requests of a vhost to another host mod_proxy comes in handy.
<VirtualHost *:80> ServerName example.com ProxyPass / http://somewhereelse.com/ ProxyPassReverse / http://somewhereelse.com/ </VirtualHost>
Things to take care of Use trailing slashes Use ProxyPass AND ProxyPassReverse
This directive lets Apache adjust the URL in the Location, Content-Location and URI headers [...]
Today I’m going to write about on how to setup a solid standard minecraft server using OpenSuse 11.4.
Prerequisites
First of all you need java 1.6 installed. In my Experience it’s best to install the java-1_6_0-sun package.
sudo zypper in java-1_6_0-sun
After that you’ll have to download the minecraft server software.
Configuration [...]
Just a short code-snippet if you want to convert a SimpleXmlElement Object to an Array.
The fastest way to do this is to just cast the Object into an Array like this:
$xml = ‘ <files> <file author="gries grieson"><title>gries way to do stuff</title></file> <file author="griesella grieson"><title>griesellas guide</title></file> <file author="grieslibear grieson"><title>grieslibears food</title></file> </files> ‘; $xml = [...]
Heute zeige ich euch wie sich die Youtube Data API einsetzen lässt um Favoriten eines Youtube Accounts zu erhalten und zu verändern, mit Hilfe der .net Library von Google.
Sämtliche Erklärungen gehen davon aus das Visual Studio 2008 oder höher verwendet wird. Ich werde später noch eventuelle Eigenheiten die sich bei Verwendung von [...]
Themen

