Преглед на файлове

Make examples scripts executable only via CLI.

This is meant as a basic layer of protection for those cases where the whole
Predis repository is cloned into a path which is publicly exposed by the web
server.

Closes #408
Daniele Alessandri преди 8 години
родител
ревизия
d72f0678ba
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      examples/shared.php

+ 4 - 0
examples/shared.php

@@ -9,6 +9,10 @@
  * file that was distributed with this source code.
  */
 
+if (PHP_SAPI !== 'cli') {
+    die("Example scripts are meant to be executed locally via CLI.");
+}
+
 require __DIR__.'/../autoload.php';
 
 function redis_version($info)