Skip to content

Instantly share code, notes, and snippets.

@frodosghost
frodosghost / BasePage.php
Created April 13, 2012 06:16
BasePage setup for Doctrine2 Table Inheritance. Shows Content from same bundle and FrontPage from a separate Bundle.
<?php
namespace Manhattan\Bundle\ContentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Manhattan\Bundle\ContentBundle\Entity\BasePage
*
* @ORM\Table(name="base_page")
@frodosghost
frodosghost / phing_install_error
Created January 11, 2012 01:57
Phing Pear Package Install Error
WARNING: "pear/PEAR_PackageFileManager" is deprecated in favor of "pear/PEAR_PackageFileManager2"
Did not download optional dependencies: phing/phingdocs, pear/VersionControl_SVN, pear/VersionControl_Git, pear/PhpDocumentor, pecl/Xdebug, pear/PEAR_PackageFileManager, pear/Services_Amazon_S3, pear/HTTP_Request2, pdepend/PHP_Depend, phpmd/PHP_PMD, phpunit/phpcpd, docblox/DocBlox, pear/PHP_CodeSniffer, use --alldeps to download automatically
phing/phing can optionally use package "phing/phingdocs" (version >= 2.4.9)
phing/phing can optionally use package "pear/VersionControl_SVN" (version >= 0.4.0)
phing/phing can optionally use package "pear/VersionControl_Git" (version >= 0.4.3)
phing/phing requires package "phpunit/PHPUnit" (version >= 3.6.0), installed version is 3.5.13
phing/phing requires package "phpunit/PHP_CodeCoverage" (version >= 1.1.0), installed version is 1.0.4
phing/phing can optionally use package "pear/PhpDocumentor" (version >= 1.4.0)
phing/phing can optionally use package "pecl/Xdebug" (versio
@frodosghost
frodosghost / flash_message_usage.php
Created May 23, 2011 12:52 — forked from BaylorRae/flash_messages.php
Flash Messages for PHP
<?php
/**
* Usage Examples
*/
$flash_message = FlashMessage::getInstance();
$flash_message->set('notice', 'This is a notice message');
$flash_message->flash('This is a flash message');
?>
<?php if ($flash_message->has('notice')) : ?>
@frodosghost
frodosghost / prototype_extend.js
Created May 16, 2011 11:55
Extending Ajax Request object for aborting
/**
* Extend the Ajax.Request object to add function to abort() current Ajax Request
*
* @source http://blog.pothoven.net/2007/12/aborting-ajax-requests-for-prototypejs.html
*/
Object.extend(Ajax.Request.prototype, {
abort: function() {
// prevent and state change callbacks from being issued
this.transport.onreadystatechange = Prototype.emptyFunction;
// abort the XHR