Przeglądaj źródła

move all scripts into one location

- standardize includes, namings
- made migrate executable
- updated ConfigurationCombinationsTest generator to work with current persistance API
El RIDO 3 lat temu
rodzic
commit
62bb68344c
5 zmienionych plików z 13 dodań i 7 usunięć
  1. 2 0
      .gitattributes
  2. 6 2
      bin/configuration-test-generator
  3. 0 0
      bin/icon-test
  4. 5 4
      bin/migrate
  5. 0 1
      tst/phpunit.xml

+ 2 - 0
.gitattributes

@@ -1,3 +1,5 @@
+bin/configuration-test-generator export-ignore
+bin/icon-test export-ignore
 doc/ export-ignore
 tst/ export-ignore
 img/browserstack.svg export-ignore

+ 6 - 2
tst/ConfigurationTestGenerator.php → bin/configuration-test-generator

@@ -9,7 +9,9 @@
  * DANGER: Too many options/settings and too high max iteration setting may trigger
  *         a fork bomb. Please save your work before executing this script.
  */
-include 'Bootstrap.php';
+
+define('PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
+include PATH . 'tst' . DIRECTORY_SEPARATOR . 'Bootstrap.php';
 
 $vd  = array('view', 'delete');
 $vcd = array('view', 'create', 'delete');
@@ -392,7 +394,7 @@ class ConfigurationTestGenerator
             }
         }
         $code .= '}' . PHP_EOL;
-        file_put_contents('ConfigurationCombinationsTest.php', $code);
+        file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'tst' . DIRECTORY_SEPARATOR . 'ConfigurationCombinationsTest.php', $code);
     }
 
     /**
@@ -428,6 +430,8 @@ class ConfigurationCombinationsTest extends PHPUnit_Framework_TestCase
         Helper::confBackup();
         $this->_path  = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'privatebin_data';
         $this->_model = new Filesystem(array('dir' => $this->_path));
+        ServerSalt::setStore($this->_model);
+        TrafficLimiter::setStore($this->_model);
         $this->reset();
     }
 

+ 0 - 0
tst/IconTest → bin/icon-test


+ 5 - 4
bin/migrate.php → bin/migrate

@@ -1,7 +1,8 @@
+#!/usr/bin/env php
 <?php
 
 // change this, if your php files and data is outside of your webservers document root
-define('PATH', '..' . DIRECTORY_SEPARATOR);
+define('PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
 
 define('PUBLIC_PATH', __DIR__ . DIRECTORY_SEPARATOR);
 require PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
@@ -171,9 +172,9 @@ function helpexit ()
     print("migrate.php - Copy data between PrivateBin backends
 
 Usage:
-  php migrate.php [--delete-after] [--delete-during] [-f] [-n] [-v] srcconfdir
-                  [<dstconfdir>]
-  php migrate.php [-h]
+  migrate [--delete-after] [--delete-during] [-f] [-n] [-v] srcconfdir
+          [<dstconfdir>]
+  migrate [-h]
 
 Options:
   --delete-after   delete data from source after all pastes and comments have

+ 0 - 1
tst/phpunit.xml

@@ -1,7 +1,6 @@
 <phpunit bootstrap="Bootstrap.php" colors="true">
 	<testsuite name="PrivateBin Test Suite">
 		<directory suffix=".php">./</directory>
-		<exclude>ConfigurationTestGenerator.php</exclude>
 	</testsuite>
 	<filter>
 		<whitelist>