Skip to content

Instantly share code, notes, and snippets.

@stof
stof / ccm system.log
Created April 2, 2015 23:29
Behat output for the Datastax driver suite, full SSL feature
INFO [main] 2015-04-02 23:21:40,949 CassandraDaemon.java:95 - Hostname: vagrant-ubuntu-trusty-32
INFO [main] 2015-04-02 23:21:40,971 YamlConfigurationLoader.java:92 - Loading settings from file:/home/vagrant/.ccm/php-driver-test-cluster/node1/conf/cassandra.yaml
INFO [main] 2015-04-02 23:21:41,055 YamlConfigurationLoader.java:135 - Node configuration:[authenticator=AllowAllAuthenticator; authorizer=AllowAllAuthorizer; auto_bootstrap=false; auto_snapshot=true; batch_size_warn_threshold_in_kb=5; batchlog_replay_throttle_in_kb=1024; cas_contention_timeout_in_ms=10000; client_encryption_options=<REDACTED>; cluster_name=php-driver-test-cluster; column_index_size_in_kb=64; commit_failure_policy=stop; commitlog_directory=/home/vagrant/.ccm/php-driver-test-cluster/node1/commitlogs; commitlog_segment_size_in_mb=32; commitlog_sync=periodic; commitlog_sync_period_in_ms=10000; compaction_throughput_mb_per_sec=0; concurrent_compactors=1; concurrent_counter_writes=32; concurrent_reads=2; concurrent_writes=2; counter_cac
@stof
stof / gist:873cb799447f388c8bcc
Created April 2, 2015 23:13
Behat output for the Datastax driver suite
Feature: SSL encryption
PHP Driver supports SSL encryption.
Scenario: Connecting with basic SSL encryption # features/ssl_encryption.feature:26
php-driver | [ERROR] Connect error 'connection refused' on host 127.0.0.1 (src/connection.cpp:407)
php-driver | [ERROR] Host 127.0.0.1 had the following error on startup: 'Unable to connect' (src/connection.cpp:643)
php-driver | [WARN] Lost connection on host 127.0.0.1 (src/control_connection.cpp:208)
php-driver | [ERROR] Connect error 'connection refused' on host 127.0.0.1 (src/connection.cpp:407)
php-driver | [ERROR] Host 127.0.0.1 had the following error on startup: 'Unable to connect' (src/connection.cpp:643)
@stof
stof / logs
Last active September 23, 2017 15:01
ElasticSearch error when using the html_strip char filter
# Remove old data
curl -XDELETE "http://localhost:9200/test"
# Create index with settings
curl -XPOST "http://localhost:9200/test" -d '
{
"settings": {
"index": {
"analysis": {
"analyzer": {
@stof
stof / FeatureContext.php
Created December 29, 2014 08:44
Accessing other contexts in Behat 3
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
class FeatureContext implements Context {
private $subContext;
/** @BeforeScenario */
public function gatherContexts(BeforeScenarioScope $scope)
@stof
stof / ConditionalValidationGroup.php
Created September 10, 2014 12:03
Conditional validation group based on the state of the entity
<?php
namespace Incenteev\WebBundle\Validator;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*/
@stof
stof / gist:50b09b01dd30bc4e3f8d
Created September 2, 2014 19:43
Travis API bug report
[
{
"id": 4202,
"slug": "Behat/Behat",
"description": "BDD framework for PHP 5.3+",
"last_build_id": 34174174,
"last_build_number": "1061",
"last_build_status": 0,
"last_build_result": 0,
@stof
stof / gist:9512094
Created March 12, 2014 17:39
PHP configuration
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
ereg
fileinfo
@stof
stof / ExtraKeysExtension.php
Created January 23, 2014 09:09
Allowing extra keys in forms by removing them from the submitted data
<?php
namespace Acme\DemoBundle\Form;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
class ExtraKeysExtension extends AbstractTypeExtension
{
public function buildForm(FormBuilderInterface $builder, array $options)
@stof
stof / gist:7157964
Created October 25, 2013 16:55
Fix for the error handler of the Symfony Xml decoding
diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
index 137f2fc..dbc0a27 100644
--- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
+++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
@@ -76,6 +76,10 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
libxml_use_internal_errors($internalErrors);
libxml_disable_entity_loader($disableEntities);
+ if ($error = libxml_get_last_error()) {
+ throw new UnexpectedValueException($error->message);
@stof
stof / gist:5485843
Created April 30, 2013 00:24
phpspec failures on windows
PhpSpec\CodeGenerator\GeneratorManager
13 ✔ uses registered generators to generate code (53ms)
25 ✔ chooses generator by priority
44 ✔ throws exception if no generator found
PhpSpec\CodeGenerator\Generator\ClassGenerator
20 ✔ is a generator