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
When using this composer.json file the following error message appears: | |
[RuntimeException] | |
Could not load package zendframework/zendframework in http://packages.zendframework.com: [UnexpectedValueException] Could not parse version constraint develop | |
[UnexpectedValueException] | |
Could not parse version constraint develop | |
{ | |
"repositories": [ | |
{ |
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
; http://ja.scribd.com/doc/88689/ApcFacebook | |
; Slam Defenses & TTL | |
apc.slam_defense=0 | |
apc.write_lock=0 | |
apc.file_update_protection=2 | |
apc.ttl=0 | |
apc.user_ttl=0 | |
apc.gc_ttl=3600 | |
; Filters | |
apc.max_file_size=1M |
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
$rm = function ($dir) use (&$rm) { | |
foreach(glob($dir . '/*') as $file) { | |
is_dir($file) ? $rm($file) : unlink($file); | |
rmdir($file); | |
} | |
}; | |
// delete | |
$rm('./tmp'); |
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
sudo port sync | |
sudo port selfupdate | |
sudo port clean –dist outdated | |
sudo port upgrade outdated | |
sudo port -u uninstall |
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
sudo port install ImageMagick | |
pecl download imagick-beta | |
tar xvzf imagick-3.1.0RC2.tgz | |
cd imagick-3.1.0RC2 | |
phpize | |
./configure --with-imagick=/opt/local | |
make | |
sudo make install |
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 | |
$shortHash = function ($data, $algo = 'CRC32') { | |
return strtr(rtrim(base64_encode(pack('H*', $algo($data))), '='), '+/', '-_'); | |
}; | |
$a = 'hello'; | |
echo $a; | |
echo md5($a) . PHP_EOL; // hello5d41402abc4b2a76b9719d911017c592 | |
echo CRC32($a) . PHP_EOL; // 907060870 |
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
# | |
# Use name-based virtual hosting. | |
# | |
NameVirtualHost *:80 | |
# | |
# VirtualHost example: | |
# Almost any Apache directive may go into a VirtualHost container. | |
# The first VirtualHost section is used for all requests that do not | |
# match a ServerName or ServerAlias in any <VirtualHost> block. |
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 A | |
{ | |
public function __toString() | |
{ | |
try { | |
resource(); | |
} catch (Exception $e) { | |
return ''; | |
} |
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
application: bear-sunday | |
version: 1 | |
runtime: php | |
api_version: 1 | |
handlers: | |
- url: /.* | |
script: BEAR.Package/apps/Helloworld/public/basic.php |
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
class MockMethod_ray000000003b0690510000000023341af3 extends Ray\Aop\Mock\MockMethod | |
{ | |
private $___initialized = false; | |
public $bind; | |
public function returnSame($a) | |
{ | |
if ($this->___initialized || !isset($this->bind[__FUNCTION__])) { | |
return call_user_func_array('parent::' . __FUNCTION__, func_get_args()); | |
} | |
$this->___initialized = true; |