You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your commands live within the web root, prevent them from being run outside the CLI:
1070
+
1071
+
```php
1072
+
// Prevent this script from being run outside of a CLI context
1073
+
if (PHP_SAPI !== 'cli') {
1074
+
exit;
1075
+
}
1076
+
```
1077
+
1078
+
Note:
1079
+
1080
+
Modern frameworks keep most app code out of the web root, but if you're writing commands that will live under the web root **be sure that they can't be executed by a web request!**
1081
+
1082
+
----
1083
+
1079
1084
### Swanson on Commands
1080
1085
1081
1086

0 commit comments