| @@ 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 | ||
| @@ 1690-1716 (lines=27) @@ | ||
| 1687 | * @param string $type |
|
| 1688 | * @return string |
|
| 1689 | */ |
|
| 1690 | function removeDocblock($code, $type) { |
|
| 1691 | ||
| 1692 | $cleaned = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $code, 1); |
|
| 1693 | ||
| 1694 | // Procedure taken from plugin.filesource.php |
|
| 1695 | switch($type) { |
|
| 1696 | case 'snippet': |
|
| 1697 | $elm_name = 'snippets'; |
|
| 1698 | $include = 'return require'; |
|
| 1699 | $count = 47; |
|
| 1700 | break; |
|
| 1701 | ||
| 1702 | case 'plugin': |
|
| 1703 | $elm_name = 'plugins'; |
|
| 1704 | $include = 'require'; |
|
| 1705 | $count = 39; |
|
| 1706 | break; |
|
| 1707 | ||
| 1708 | default: |
|
| 1709 | return $cleaned; |
|
| 1710 | }; |
|
| 1711 | if(substr(trim($cleaned),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$elm_name.'/') |
|
| 1712 | return $cleaned; |
|
| 1713 | ||
| 1714 | // fileBinding not found - return code incl docblock |
|
| 1715 | return $code; |
|
| 1716 | } |
|
| 1717 | ||