Skip to content

Instantly share code, notes, and snippets.

@zircote
zircote / build.xml
Created July 13, 2012 00:01
Ant file for php CI/Dev
<?xml version="1.0" encoding="UTF-8"?>
<project name="Project Name" default="build" basedir=".">
<property environment="env"/>
<!--<property name="env.APPLICATION_ENV" value="development"/>-->
<property name="source" value="."/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
@zircote
zircote / OAuth2\ZendDb.php
Created July 12, 2012 20:39
An example of using Zend_Db_Adapter_* as the storage connector for OAuth2 library at https://github.com/zircote/oauth2-php
<?php
/**
* @category Cautela
* @package Auth
* @subpackage OAuth2
*/
namespace Auth\OAuth2;
use OAuth2\Grant\GrantCodeInterface;
use OAuth2\RefreshTokensInterface;
use Zend_Db_Adapter_Abstract;
@zircote
zircote / deployment-descriptor-1.0.xsd
Created July 12, 2012 20:31
Zend Server/Cluster Manager Deployment XSD schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.zend.com/server/deployment-descriptor/1.0"
targetNamespace="http://www.zend.com/server/deployment-descriptor/1.0"
elementFormDefault="qualified">
<xs:element name="package">
<xs:annotation>
<xs:documentation></xs:documentation>
</xs:annotation>
<xs:complexType>
@zircote
zircote / commandline.sh
Created July 8, 2012 17:31
Swagger-PHP example output from tests/fixtures/*
$ ./bin/swagger -p tests/fixtures/ -f
/usr/local/zend/apache2/htdocs/Swagger-PHP/resources.json created
/usr/local/zend/apache2/htdocs/Swagger-PHP//leadresponder.json created
$
@zircote
zircote / composer.json
Created May 19, 2012 02:28
Example Composer utlizing Zend Framework 1.11.9 via SVN
{
"name": "zircote/Org",
"type": "library",
"version": "0.2.0",
"time" : "2012-04-21",
"description": "New world API Order",
"keywords": ["api"],
"homepage": "http://github.com/zircote/Org/",
"repositories": [
{
@zircote
zircote / Zend_Application_Resource_Mongo.php
Created May 11, 2012 13:19
A Mongo Zend Application Resource
<?php
/**
*
* @category Zend
* @package Zend_Application
* @subpackage Resource
*/
/**
* @see Zend_Application_Resource_ResourceAbstract
@zircote
zircote / index.php
Created April 28, 2012 11:51
Bootstrapping Zend Framework 1.x with composer namespaces
<?php
/**
* Bootstrap the App in an annonymous function preserving global namespace.
*/
call_user_func(function(){
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/../application'));
@zircote
zircote / controller.php
Created April 20, 2012 01:27
Proposed Swagger-PHP annotations change
<?php
/**
* @license http://www.apache.org/licenses/LICENSE-2.0
* Copyright [2012] [Robert Allen]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@zircote
zircote / amqp_queue.c.patch
Created April 18, 2012 13:33
Addresses a memory leak to AMQPQueue::get
Index: amqp_queue.c
===================================================================
--- amqp_queue.c (revision 325290)
+++ amqp_queue.c (working copy)
@@ -204,6 +204,7 @@
AMQP_SET_BOOL_PROPERTY(envelope->is_redelivery, delivery->redelivered);
} else if (frame.payload.method.id == AMQP_BASIC_GET_EMPTY_METHOD) {
/* We did a get and there were no messages */
+ zval_dtor(envelopeZval);
return AMQP_READ_NO_MESSAGES;
@zircote
zircote / AMQP.php
Created April 17, 2012 22:02
AQMP PECL Autocomplete file.
<?php
/**
*
*/
/**
* Passing in this constant as a flag will forcefully disable all other flags.
* Use this if you want to temporarily disable the amqp.auto_ack ini setting.
* @var integer
*/
define('AMQP_NOPARAM');