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 | |
$path = '/some/dir'; | |
$dir = new RecursiveDirectoryIterator($path); | |
$iterator = new RecursiveIteratorIterator($dir); | |
foreach ($iterator as $entry) { | |
print($entry->getRealPath() . PHP_EOL); | |
} |
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 | |
class article { | |
private $title; | |
public function __construct($title) { | |
$this->title = $title; | |
} | |
protected function getTitle() { | |
return $this->title; |
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 | |
class metadatacache implements Imbo\EventManager\ListenerInterface { | |
private $memcached; | |
public function __construct() { | |
$this->memcached = new Memcached(); | |
$this->memcached->addServer('localhost', 11211); | |
} | |
public function getEvents() { |
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 | |
class Bar { | |
public function run() { | |
// do something | |
} | |
public function exec() { | |
// do something | |
} | |
} |
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
file_get_contents($url, null, stream_context_create(array( | |
'http' => array( | |
'method' => 'PUT', | |
'content' => json_encode(array('foo' => 'bar')), | |
'header' => 'Content-type: application/x-www-form-urlencoded', | |
) | |
))); |
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 | |
$host = 'https://imbo-ssl.example.com'; | |
$publicKey = '<public key>'; | |
$privateKey = '<private key>'; | |
$driver = new ImboClient\Driver\Curl(array( | |
'sslVerifyPeer' => false, | |
)); | |
$client = new ImboClient\Client($host, $publicKey, $privateKey, $driver); | |
$client->addImage('/some/image.jpg'); |
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 | |
namespace Imbo\EventListener; | |
use Imbo\Exception\RuntimeException, | |
Imbo\EventManager\EventInterface; | |
/** | |
* Image transformation storage | |
* | |
* Event listener that stores (transformed) images to disk. By using this listener Imbo will only |
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
#!/bin/bash | |
# Script used to setup elasticsearch. Can be run as a regular user (needs sudo) | |
ES_USER="elasticsearch" | |
ES_GROUP="$ES_USER" | |
ES_HOME="/usr/local/share/elasticsearch" | |
ES_CLUSTER="clustername" | |
ES_DATA_PATH="/var/data/elasticsearch" | |
ES_LOG_PATH="/var/log/elasticsearch" | |
ES_HEAP_SIZE=1024 |
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
#!/bin/bash | |
curl -XPOST 'http://localhost:9200/blog/posts/_search' -d '{ | |
"query": { | |
"filtered": { | |
"query": { | |
"query_string": { | |
"query":"php zend framework", | |
"default_operator": "OR", | |
"fields": ["title", "content"] | |
} |
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
#!/usr/bin/env perl | |
# Parameters supported: | |
# | |
# config | |
# autoconf | |
# | |
# Magic markers: | |
#%# family=auto | |
#%# capabilities=autoconf |
OlderNewer