Jelajahi Sumber

create_example.php: added a `#!`-line and moved to `bin` directory

Mogria 14 tahun lalu
induk
melakukan
5bf3ee0000
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      bin/create_example.php

+ 4 - 3
create_example.php → bin/create_example.php

@@ -1,9 +1,10 @@
+#!/usr/bin/env php
 <?php
 
 /**
  * A commandline script to create an example and the needed files
  * use like this:
- * $ php create_example.php my_new_example
+ * $ bin/create_example.php my_new_example
  *
  * and the folder my_new_example will be created in the examples/ folder containing 3 files
  *
@@ -11,7 +12,7 @@
 
 // some constants
 define('USAGE', <<<USAGE
-USAGE: php {$argv[0]} example_name
+USAGE: {$argv[0]} example_name
 
 This creates a new example and the corresponding files in the examples/ directory
 
@@ -19,7 +20,7 @@ USAGE
 );
 
 define('DS', DIRECTORY_SEPARATOR);
-define('EXAMPLE_PATH', dirname(__FILE__) . DS . "examples");
+define('EXAMPLE_PATH', realpath(dirname(__FILE__) . DS . ".." . DS . "examples"));
 
 
 /**