Skip to content

Instantly share code, notes, and snippets.

View adamlundrigan's full-sized avatar

Adam Lundrigan adamlundrigan

View GitHub Profile
@adamlundrigan
adamlundrigan / README.md
Created April 13, 2012 18:13
Having problems running Git command via a Phing exectask in a Git post-receive hook

Problem

Running git command through a Phing ExecTask:

<exec command="git remote rm origin" dir="${build.src}" checkreturn="false" />

This works when phing build.setup is executed directly from command prompt. However, the same process fails when run from a Git post-receive hook with this message:

@adamlundrigan
adamlundrigan / my_script.php
Created November 29, 2011 12:35
Extending MODx
<?php
require_once '/path/to/modx/config.core.php';
require_once MODX_CORE_PATH.'model/modx/modx.class.php';
$modx = new modx();
$modx->initialize('web');
// Load document by ID, set longtitle, save it
$doc = $modx->getObject('modDocument', array('id'=>1));
$doc->set('longtitle', 'foo');
@adamlundrigan
adamlundrigan / Description
Created November 18, 2011 19:55
Regenerate classmaps of all non-git-submodule modules in a ZF2 project
Place in `bin` folder within your ZF2 project, at the same level as your `modules` folder. From your project folder, run:
```
bash bin/regen_classmaps
```
You could also place your `bin` folder in your shell PATH variable, and then just type `regen_classmaps`