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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
/** | |
* php fsockopen上传,如果使用https,必须先开启ssl才能使用 | |
* @param str $url 要上传的url | |
* @param array $files 上传的文件参数 数组格式 | |
* array( | |
* 0=> array( | |
* "name" => "图片0.jpg", //显示的文件名 | |
* "type" => "image/jpeg", //文件mime | |
* "savepath" => "D:/www/uploadfile/201305", //文件所在的目录 |
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
(define-macro (doc func-name) | |
(let ((func-name (string func-name))) | |
(set 'f (read-file {/e:/newlisp/newlisp_manual.html})) | |
(set 'r (regex (string "<a name=\"" func-name "\"></a>") f)) | |
(set 'n0 (r 1)) | |
(set 'n1 ((regex "<a name=" f 0 (+ n0 (r 2))) 1)) | |
(set 'html-text (slice f n0 (- n1 n0))) | |
(replace "<.*?>" html-text "" 0) | |
(replace "<" html-text "<") | |
(replace ">" html-text ">") |
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 seq($width, $lastNum, $inc) | |
{ | |
$num = $lastNum; | |
if($inc==true) { | |
if($lastNum+$width>10) {return false;} | |
} else { | |
if($lastNum-$width<0) {return false;} | |
} | |
$num = 0; |
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 | |
$evtManager = new \Phalcon\Events\Manager(); | |
$logger = new \Phalcon\Logger\Adapter\File($configs->database->$nodeName->logger . date("Ymd")); | |
$evtManager->attach('db', function($event, $connection) use ($logger) { | |
if ($event->getType() == 'beforeQuery') { | |
$variables = $connection->getSqlVariables(); | |
if (count($variables)) { | |
$logger->log($connection->getSQLStatement() . "; Bind parameters: ". join(", ", $variables), \Phalcon\Logger::INFO); | |
} else { | |
$logger->log($connection->getSQLStatement(), \Phalcon\Logger::INFO); |
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 apt-get install libxml2-dev | |
sudo apt-get install libssl-dev | |
sudo apt-get install libcurl4-openssl-dev | |
sudo apt-get install libjpeg8-dev | |
sudo apt-get install libpng12-dev | |
sudo apt-get install libfreetype6-dev | |
sudo apt-get install libicu-dev | |
sudo apt-get install libmcrypt-dev | |
sudo apt-get install libltdl-dev |
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 | |
/* binlog_task.php --- | |
* | |
* Filename: binlog_task.php | |
* Description: | |
* Author: Gu Weigang * Maintainer: | |
* Created: Mon Nov 25 14:22:33 2013 (+0800) | |
* Version: | |
* Last-Updated: Mon Nov 25 14:42:36 2013 (+0800) | |
* By: Gu Weigang |
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 | |
/* BinlogEvent.php --- | |
* | |
* Filename: BinlogEvent.php | |
* Description: | |
* Author: Gu Weigang * Maintainer: | |
* Created: Fri Nov 8 20:16:59 2013 (+0800) | |
* Version: 117777 | |
* Last-Updated: Tue Nov 19 15:05:08 2013 (+0800) | |
* By: Gu Weigang |
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 | |
/* Message.php --- | |
* | |
* Filename: Message.php | |
* Description: | |
* Author: Gu Weigang * Maintainer: | |
* Created: Sun Nov 10 15:22:06 2013 (+0800) | |
* Version: 117442 | |
* Last-Updated: Wed Nov 13 20:47:38 2013 (+0800) | |
* By: Gu Weigang |
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 | |
/* DefaultEvent.php --- | |
* | |
* Filename: DefaultEvent.php | |
* Description: | |
* Author: Gu Weigang * Maintainer: | |
* Created: Fri Nov 8 16:34:55 2013 (+0800) | |
* Version: 116900 | |
* Last-Updated: Wed Nov 13 16:46:24 2013 (+0800) | |
* By: Gu Weigang |
OlderNewer