File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1526,9 +1526,41 @@ function parse_docblock($element_dir, $filename) {
15261526}
15271527//remove installFolder
15281528if ($ removeInstall == 'y ' ) {
1529+ removeFolder ($ path );
1530+ removeFolder ($ base_path .'.tx ' );
1531+ unlink ($ base_path .'README.md ' );
15291532 echo 'Install folder deleted! ' . PHP_EOL . PHP_EOL ;
15301533}
15311534
1535+ /**
1536+ * RemoveFolder
1537+ *
1538+ * @param string $path
1539+ * @return string
1540+ */
1541+ function removeFolder ($ path )
1542+ {
1543+ $ dir = realpath ($ path );
1544+ if (!is_dir ($ dir )) {
1545+ return ;
1546+ }
1547+
1548+ $ it = new RecursiveDirectoryIterator ($ dir );
1549+ $ files = new RecursiveIteratorIterator ($ it ,
1550+ RecursiveIteratorIterator::CHILD_FIRST );
1551+ foreach ($ files as $ file ) {
1552+ if ($ file ->getFilename () === ". " || $ file ->getFilename () === ".. " ) {
1553+ continue ;
1554+ }
1555+ if ($ file ->isDir ()) {
1556+ rmdir ($ file ->getRealPath ());
1557+ } else {
1558+ unlink ($ file ->getRealPath ());
1559+ }
1560+ }
1561+ rmdir ($ dir );
1562+ }
1563+
15321564/**
15331565 * Property Update function
15341566 *
You can’t perform that action at this time.
0 commit comments