Skip to content

Instantly share code, notes, and snippets.

View guweigang's full-sized avatar

南無假行僧 guweigang

View GitHub Profile
<?php
use
Phalcon\Mvc\Model,
Phalcon\Mvc\Model\Message,
Phalcon\Db\RawValue;
/**
* 基础 Model 实现
*
#!/bin/bash
# mysql 自动备份
TIMESTAMP=$(date +"%Y%m%d")
BACKUP_DIR="/usr/local/mysql/backup"
MYSQL_USER="root"
MYSQL=/usr/local/mysql/bin/mysql
MYSQL_PASSWORD="root"
MYSQLDUMP=/usr/local/mysql/bin/mysqldump
package main
import (
"io"
"log"
"net"
"bytes"
"bufio"
"strings"
"time"
<?php
namespace NCFGroup\Common\Library;
/**
* AES对称加密封装 (包括base64)
* 算法: AES128位
* 模式: ECB
* 填充: PKCS5Padding
*/
@guweigang
guweigang / bullsoft_php.h
Created May 20, 2015 09:08
bullsoft header file for php-ext
#ifndef BULLSOFT_PHP_H
#define BULLSOFT_PHP_H
#ifndef PHP_FE_END
#define PHP_FE_END { NULL, NULL, NULL, 0, 0 }
#endif
#ifndef ZEND_MOD_END
#define ZEND_MOD_END { NULL, NULL, NULL, 0 }
#endif
<?php
$redirect_stdout = false;
$workers = [];
$worker_num = 8;
//swoole_process::daemon(0, 1);
for($i = 0; $i < $worker_num; $i++)
{
$process = new swoole_process('child_async', $redirect_stdout);
$pid = $process->start();
<?php
public function createPdf()
{
$this->view->disable();
$userId = $this->request->getPost('bbb');
$rez['rez'] = Users::findFirstById($userId)
$html = $this->view->getRender('reports', 'pdf_report', $rez);
<?php
ini_set("memory_limit", "4G");
/**
* @param string $input
*/
function invoke($input)
{
$bootstrap = new \PhalconPlus\Bootstrap(dirname(dirname(__DIR__)));
$di = new \Phalcon\DI\FactoryDefault\CLI();
<?php
/**
* 微信PHP-SDK
* 服务器端必须要有 CURL 支持
* 2015年7月修正版本
* @author 、小陈叔叔 <[email protected]>
* https://coding.net/u/cjango/p/wechat_sdk/git
* 7月10日,完善红包功能,
*/
namespace Tools;

The info you need:

  • PHP 5.2 was never supported by Phalcon.
  • Phalcon 1.3.x is compatible with PHP 5.3.9 or higher.
  • Phalcon 2.0.x is compatible with PHP 5.3.21 or higher. However it's recommended run it at least in 5.4.22.
  • Phalcon 2.1.x will be only PHP >= 5.4.22 compatible.
  • Phalcon should work fine with any MySQL >= 4.1.x