Skip to content

Instantly share code, notes, and snippets.

View kriswallsmith's full-sized avatar

Kris Wallsmith kriswallsmith

View GitHub Profile
<?php
public function preDelete($event)
{
if ($this->getNode()->hasChildren())
{
if ($this->getNode()->isRoot())
{
// turn the first child into the root
$this->getNode()->getFirstChild()->getNode()->makeRoot();
<?php
class SplClassLoader
{
protected
$includePath = null,
$namespace = null,
$extension = '.php',
$namespaceSeparator = '\\';
<?php
class MyForm extends sfForm
{
public function configure()
{
$subForm = new sfForm();
$subValidators = array();
$replace = new sfValidatorSchema(null, array('allow_extra_fields' => true, 'filter_extra_fields' => false));
#!/bin/bash
svn propset svn:eol-style native classes/propel/engine/EngineException.php
svn propset svn:eol-style native classes/propel/engine/GeneratorConfig.php
svn propset svn:eol-style native classes/propel/engine/behavior/AlternativeCodingStandardsBehavior.php
svn propset svn:eol-style native classes/propel/engine/behavior/SoftDeleteBehavior.php
svn propset svn:eol-style native classes/propel/engine/behavior/TimestampableBehavior.php
svn propset svn:eol-style native classes/propel/engine/builder/DataModelBuilder.php
svn propset svn:eol-style native classes/propel/engine/builder/om/ClassTools.php
svn propset svn:eol-style native classes/propel/engine/builder/om/OMBuilder.php
#!/bin/bash
svn propset svn:eol-style native Propel.php
svn propset svn:eol-style native PropelException.php
svn propset svn:eol-style native adapter/DBAdapter.php
svn propset svn:eol-style native adapter/DBMSSQL.php
svn propset svn:eol-style native adapter/DBMySQL.php
svn propset svn:eol-style native adapter/DBNone.php
svn propset svn:eol-style native adapter/DBOracle.php
svn propset svn:eol-style native adapter/DBPostgres.php
<?php
// copy schema files to tmp directory and apply default behaviors there
$tmpDir = sys_get_temp_dir().'sf_propel_plugin/phingproj_'.time().'_'.rand(11111, 99999);
$this->getFilesystem()->mkdirs($tmpDir);
$this->getFilesystem()->copy(sfConfig::get('sf_config_dir').'/propel.ini', $tmpDir.'/propel.ini');
$buildProperties = new Properties();
$buildProperties->load(new PhingFile($tmpDir.'/propel.ini'));
<?php
protected function addDefaultBehaviors(SimpleXMLElement $table, $behaviors = array(), Properties $buildProperties)
{
$behaviors = array_merge($behaviors, $this->getBehaviors($table));
if ($buildProperties->getProperty('propel.builder.addBehaviors') && !in_array('symfony_behaviors', $behaviors))
{
$this->addBehavior($table, 'symfony_behaviors');
}
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
/**
* Validates the response.
*
* @return sfTestFunctionalBase|sfTester
*/
public function isValid()
{
if (preg_match('/(x|ht)ml/i', $this->response->getContentType(), $matches))
<?php
static protected function removeIncludePath($file)
{
$includePaths = explode(PATH_SEPARATOR, get_include_path());
foreach ($includePaths as $includePath)
{
// ignore relative or invalid include paths
if (0 === strpos($includePath, '.') || false === $includePath = realpath($includePath))