Move around/add PHP_SAPI check, making find-entries happier.
authorPlatonides <platonides@gmail.com>
Wed, 20 Feb 2013 23:50:27 +0000 (00:50 +0100)
committerPlatonides <platonides@gmail.com>
Wed, 20 Feb 2013 23:50:27 +0000 (00:50 +0100)
Change-Id: Ic166066a543c4a5c0958351fdfe5f984e8d443d7

includes/normal/Utf8Test.php
includes/normal/UtfNormalBench.php
includes/normal/UtfNormalMemStress.php
includes/normal/UtfNormalTest.php
maintenance/Maintenance.php
maintenance/language/generateNormalizerData.php
maintenance/language/validate.php

index 904a27f..c5c1be5 100644 (file)
 
 /** */
 
+if ( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 require_once 'UtfNormalDefines.php';
 require_once 'UtfNormalUtil.php';
 require_once 'UtfNormal.php';
@@ -34,9 +38,6 @@ mb_internal_encoding( "utf-8" );
 
 $verbose = false;
 #$verbose = true;
-if( PHP_SAPI != 'cli' ) {
-       die( "Run me from the command line please.\n" );
-}
 
 $in = fopen( "UTF-8-test.txt", "rt" );
 if( !$in ) {
index 392ba2b..89de929 100644 (file)
  * @ingroup UtfNormal
  */
 
+if( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 if( isset( $_SERVER['argv'] ) && in_array( '--icu', $_SERVER['argv'] ) ) {
        dl( 'php_utfnormal.so' );
 }
@@ -34,10 +38,6 @@ require_once 'UtfNormal.php';
 
 define( 'BENCH_CYCLES', 5 );
 
-if( PHP_SAPI != 'cli' ) {
-       die( "Run me from the command line please.\n" );
-}
-
 $testfiles = array(
        'testdata/washington.txt' => 'English text',
        'testdata/berlin.txt' => 'German text',
index 257e105..9732d76 100644 (file)
  * @ingroup UtfNormal
  */
 
+if( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 if( isset( $_SERVER['argv'] ) && in_array( '--icu', $_SERVER['argv'] ) ) {
        dl( 'php_utfnormal.so' );
 }
@@ -38,10 +42,6 @@ define( 'BENCH_CYCLES', 1 );
 define( 'BIGSIZE', 1024 * 1024 * 10); // 10m
 ini_set('memory_limit', BIGSIZE + 120 * 1024 * 1024);
 
-if( PHP_SAPI != 'cli' ) {
-       die( "Run me from the command line please.\n" );
-}
-
 $testfiles = array(
        'testdata/washington.txt' => 'English text',
        'testdata/berlin.txt' => 'German text',
index 22e6471..661e53f 100644 (file)
  * @ingroup UtfNormal
  */
 
+if( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 $verbose = true;
 #define( 'PRETTY_UTF8', true );
 
@@ -54,10 +58,6 @@ require_once 'UtfNormalDefines.php';
 require_once 'UtfNormalUtil.php';
 require_once 'UtfNormal.php';
 
-if( PHP_SAPI != 'cli' ) {
-       die( "Run me from the command line please.\n" );
-}
-
 $in = fopen("NormalizationTest.txt", "rt");
 if( !$in ) {
        print "Couldn't open NormalizationTest.txt -- can't run tests.\n";
index b2bbf9b..aab7bb3 100644 (file)
  * @defgroup Maintenance Maintenance
  */
 
+if( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 // Make sure we're on PHP5.3.2 or better
 if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
        // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
index 33163d4..c03162c 100644 (file)
  * @ingroup MaintenanceLanguage
  */
 
-require_once( __DIR__ . '/../Maintenance.php' );
-
 require_once( __DIR__ . '/../../includes/normal/UtfNormalUtil.php' );
 
+require_once( __DIR__ . '/../Maintenance.php' );
+
 /**
  * Generates normalizer data files for Arabic and Malayalam.
  * For NFC see includes/normal.
index 751e744..4f00496 100644 (file)
  * @ingroup MaintenanceLanguage
  */
 
+if ( PHP_SAPI != 'cli' ) {
+       die( "Run me from the command line please.\n" );
+}
+
 if ( !isset( $argv[1] ) ) {
        print "Usage: php {$argv[0]} <filename>\n";
        exit( 1 );