This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A - B - C <-- branch develop | |
\ | |
D - E - F <-- branch feature.alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A - B - C <-- branch develop | |
\ | |
Z <-- branch feature.alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My repository: the common ancestor is B. | |
A - B - C <-- branch develop | |
\ | |
D - E - F - G <-- branch feature.alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
gem 'bundler', "~>1.0.10" | |
gem "rails", "2.3.11" | |
gem "mysql" | |
gem "erubis" | |
gem "rake" | |
gem "syntax", "1.0.0" | |
gem "capistrano", "2.6.0" | |
gem "open4", "0.9.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array("name" => "Hagrid", "age" => "36"); | |
$data_string = json_encode($data); | |
$ch = curl_init('http://api.plemi.lan/app_dev.php/demand'); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Wed Dec 21 12:12:28 2011] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Swift_TransportException' with message 'Expected response code 220 but got code "", with message ""' in /srv/api/vendor/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:422\nStack trace:\n#0 /srv/api/vendor/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(315): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('', Array)\n#1 /srv/api/vendor/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(123): Swift_Transport_AbstractSmtpTransport->_readGreeting()\n#2 /srv/api/vendor/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php(57): Swift_Transport_AbstractSmtpTransport->start()\n#3 /srv/api/vendor/swiftmailer/lib/classes/Swift/MemorySpool.php(65): Swift_Transport_SendmailTransport->start()\n#4 /srv/api/vendor/symfony/src/Symfony/Bundle/SwiftmailerBundle/EventListener/EmailSenderListener.php(47): Swift_MemorySpool->flushQueue(Object(Swift_Transport_SendmailTr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Description | |
* | |
* @param hey | |
* | |
* @return pwet | |
* | |
* @Mongo/Hey | |
* @Assert/Url() | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was a quick & dirty benchmark (for my own needs) to compare the method to get a class name in PHP | |
-ReflectionObject->getName(); | |
-get_class(); | |
-ReflectionClass->getName(); | |
It was performed on my local machine : MacBookPro with PHP 5.3.6 | |
You will find the result below and the code used for the 3 tests. | |
ReflectionObject | |
Memory : 750040 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Works in every situations | |
function by_token ($src) { | |
$class = false; | |
$namespace = false; | |
$tokens = token_get_all($src); | |
for ($i = 0, $count = count($tokens); $i < $count; $i++) { | |
$token = $tokens[$i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Atoum asserters | |
$this->assert | |
->integer(150) | |
->isGreaterThan(100) | |
->isLowerThanOrEqualTo(200); | |
// PHPunit asserters | |
$this->assertInternalType('int', 150); |