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 | |
// | |
//Yes you can run Composer with a little PHP wrapper. All of the Composer source code is available in the Phar file, so it can be extracted and then you can run it after setting up an InputInterface to replace Composer expecting the commands to be passed in via the command line. | |
// | |
//If you setup your directory structure like this: | |
// | |
//./project | |
//./project/composer.json | |
//./project/composer.lock | |
//./project/webroot/composerExtractor.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
function emitCSV(array $fields, $delimiter = ',', $enclosure = '"', $mysql_null = false) { | |
$delimiter_esc = preg_quote($delimiter, '/'); | |
$enclosure_esc = preg_quote($enclosure, '/'); | |
$output = array(); | |
foreach ($fields as $field) { | |
if ($field === null && $mysql_null) { | |
$output[] = 'NULL'; | |
continue; | |
} |
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 | |
trait Auto{ | |
function auto($args) { |
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
<html> | |
<body> | |
<iframe src='frame1.php' width='200px' height='400px'></iframe> | |
<iframe src='frame2.php' width='200px' height='400px' ></iframe> | |
</body> |
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 | |
#m: minute of the day, from 0 to 59 | |
#h: hour of the day, from 0 to 23 | |
#dom: day of month, from 1 to 31 | |
#Month | |
#dow: day of week, from 1 to 7 | |
#user: user your cron job should run as | |
#command: command or script that should run |
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 Maker { | |
function make($className) { | |
return new $className; | |
} | |
} |
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
function getClassName($namespaceClass) { | |
$lastSlashPosition = mb_strrpos($namespaceClass, '\\'); | |
if ($lastSlashPosition !== false) { | |
return mb_substr($namespaceClass, $lastSlashPosition + 1); | |
} | |
return $namespaceClass; | |
} |
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 | |
function createTimerProxyXMySQLiStatementFactory(\Intahwebz\Timer $timer) { | |
$closure = function ($statement, $queryString, $logger) use ($timer) { | |
$object = new \Intahwebz\DB\TimerProxyXMySQLiStatement( | |
$statement, $queryString, $logger, $timer | |
); | |
return $object; |
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
function getOffsetTime(timezoneString){ | |
var start = timezoneString.indexOf("("); | |
var end = timezoneString.indexOf(")"); | |
var length = end - start - 1; | |
var offsetString = timezoneString.substr(start + 1, length); | |
return offsetString; | |
} |