| @@ 1638-1664 (lines=27) @@ | ||
| 1635 | * @param string $type |
|
| 1636 | * @return string |
|
| 1637 | */ |
|
| 1638 | function removeDocblock($code, $type) { |
|
| 1639 | ||
| 1640 | $cleaned = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $code, 1); |
|
| 1641 | ||
| 1642 | // Procedure taken from plugin.filesource.php |
|
| 1643 | switch($type) { |
|
| 1644 | case 'snippet': |
|
| 1645 | $elm_name = 'snippets'; |
|
| 1646 | $include = 'return require'; |
|
| 1647 | $count = 47; |
|
| 1648 | break; |
|
| 1649 | ||
| 1650 | case 'plugin': |
|
| 1651 | $elm_name = 'plugins'; |
|
| 1652 | $include = 'require'; |
|
| 1653 | $count = 39; |
|
| 1654 | break; |
|
| 1655 | ||
| 1656 | default: |
|
| 1657 | return $cleaned; |
|
| 1658 | }; |
|
| 1659 | if(substr(trim($cleaned),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$elm_name.'/') |
|
| 1660 | return $cleaned; |
|
| 1661 | ||
| 1662 | // fileBinding not found - return code incl docblock |
|
| 1663 | return $code; |
|
| 1664 | } |
|
| 1665 | ||
| @@ 914-940 (lines=27) @@ | ||
| 911 | * @param string $type |
|
| 912 | * @return string |
|
| 913 | */ |
|
| 914 | function removeDocblock($code, $type) { |
|
| 915 | ||
| 916 | $cleaned = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $code, 1); |
|
| 917 | ||
| 918 | // Procedure taken from plugin.filesource.php |
|
| 919 | switch($type) { |
|
| 920 | case 'snippet': |
|
| 921 | $elm_name = 'snippets'; |
|
| 922 | $include = 'return require'; |
|
| 923 | $count = 47; |
|
| 924 | break; |
|
| 925 | ||
| 926 | case 'plugin': |
|
| 927 | $elm_name = 'plugins'; |
|
| 928 | $include = 'require'; |
|
| 929 | $count = 39; |
|
| 930 | break; |
|
| 931 | ||
| 932 | default: |
|
| 933 | return $cleaned; |
|
| 934 | }; |
|
| 935 | if(substr(trim($cleaned),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$elm_name.'/') |
|
| 936 | return $cleaned; |
|
| 937 | ||
| 938 | // fileBinding not found - return code incl docblock |
|
| 939 | return $code; |
|
| 940 | } |
|
| 941 | ||