@@ -10,15 +10,15 @@ |
||
| 10 | 10 | <?php echo \Myth\CLI::write("\tLine Number: {$line}"); ?> |
| 11 | 11 | |
| 12 | 12 | <?php |
| 13 | - if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE) { |
|
| 13 | + if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE) { |
|
| 14 | 14 | |
| 15 | - echo \Myth\CLI::write("\n\tBacktrace"); |
|
| 15 | + echo \Myth\CLI::write("\n\tBacktrace"); |
|
| 16 | 16 | |
| 17 | - foreach (debug_backtrace() as $error) { |
|
| 18 | - if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) { |
|
| 19 | - echo \Myth\CLI::write("\t\t- {$error['function']}() - Line {$error['line']} in {$error['file']}"); |
|
| 20 | - } |
|
| 21 | - } |
|
| 17 | + foreach (debug_backtrace() as $error) { |
|
| 18 | + if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0) { |
|
| 19 | + echo \Myth\CLI::write("\t\t- {$error['function']}() - Line {$error['line']} in {$error['file']}"); |
|
| 20 | + } |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | echo \Myth\CLI::new_line(); |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | <?= $uikit->row([], function() use($uikit) { |
| 7 | 7 | |
| 8 | - echo $uikit->column(['sizes' => ['l'=>6]], function() use($uikit) { ?> |
|
| 8 | + echo $uikit->column(['sizes' => ['l'=>6]], function() use($uikit) { ?> |
|
| 9 | 9 | <h3>What Is Sprint?</h3> |
| 10 | 10 | |
| 11 | 11 | <p>SprintPHP is a souped-up version of <a href="http://codeigniter.com">CodeIgniter <?= CI_VERSION ?></a>. And soon to be the heart and soul |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | - echo $uikit->column(['sizes' => ['l'=>6]], function() use($uikit) { ?> |
|
| 28 | + echo $uikit->column(['sizes' => ['l'=>6]], function() use($uikit) { ?> |
|
| 29 | 29 | <h3>Get To Know Sprint</h3> |
| 30 | 30 | |
| 31 | 31 | <p>The following resources will help you as you explore the power and flexibility that SprintPHP provides. Feel free to dig into source code of the controllers and views |
@@ -39,6 +39,6 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <?php }); |
| 41 | 41 | |
| 42 | - }); ?> |
|
| 42 | + }); ?> |
|
| 43 | 43 | |
| 44 | 44 | </div> |
@@ -1,34 +1,34 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Sprint |
|
| 4 | - * |
|
| 5 | - * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow. |
|
| 6 | - * |
|
| 7 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
| 8 | - * of this software and associated documentation files (the "Software"), to deal |
|
| 9 | - * in the Software without restriction, including without limitation the rights |
|
| 10 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
| 11 | - * copies of the Software, and to permit persons to whom the Software is |
|
| 12 | - * furnished to do so, subject to the following conditions: |
|
| 13 | - * |
|
| 14 | - * The above copyright notice and this permission notice shall be included in |
|
| 15 | - * all copies or substantial portions of the Software. |
|
| 16 | - * |
|
| 17 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
| 18 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
| 19 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
| 20 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
| 21 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
| 22 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
| 23 | - * THE SOFTWARE. |
|
| 24 | - * |
|
| 25 | - * @package Sprint |
|
| 26 | - * @author Lonnie Ezell |
|
| 27 | - * @copyright Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com) |
|
| 28 | - * @license http://opensource.org/licenses/MIT (MIT) |
|
| 29 | - * @link http://sprintphp.com |
|
| 30 | - * @since Version 1.0 |
|
| 31 | - */ |
|
| 3 | + * Sprint |
|
| 4 | + * |
|
| 5 | + * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow. |
|
| 6 | + * |
|
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
|
| 9 | + * in the Software without restriction, including without limitation the rights |
|
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
|
| 12 | + * furnished to do so, subject to the following conditions: |
|
| 13 | + * |
|
| 14 | + * The above copyright notice and this permission notice shall be included in |
|
| 15 | + * all copies or substantial portions of the Software. |
|
| 16 | + * |
|
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
| 23 | + * THE SOFTWARE. |
|
| 24 | + * |
|
| 25 | + * @package Sprint |
|
| 26 | + * @author Lonnie Ezell |
|
| 27 | + * @copyright Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com) |
|
| 28 | + * @license http://opensource.org/licenses/MIT (MIT) |
|
| 29 | + * @link http://sprintphp.com |
|
| 30 | + * @since Version 1.0 |
|
| 31 | + */ |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * BUILD TOOL |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $config['builds'] = [ |
| 12 | 12 | 'release' => 'SprintRelease', |
| 13 | 13 | 'postCreateProject' => 'InitialCleanup', |
| 14 | - 'publishSubTrees' => 'SubTreeSplit' |
|
| 14 | + 'publishSubTrees' => 'SubTreeSplit' |
|
| 15 | 15 | ]; |
| 16 | 16 | |
| 17 | 17 | //-------------------------------------------------------------------- |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($ci=null) |
| 14 | 14 | { |
| 15 | - $this->ci =& $ci; |
|
| 15 | + $this->ci =& $ci; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | //-------------------------------------------------------------------- |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function ensureFolder($path) |
| 59 | 59 | { |
| 60 | - if (is_dir($path)) |
|
| 61 | - { |
|
| 62 | - return true; |
|
| 63 | - } |
|
| 60 | + if (is_dir($path)) |
|
| 61 | + { |
|
| 62 | + return true; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | return mkdir($path, 0777, true); |
| 66 | 66 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function __construct($destination) |
| 19 | 19 | { |
| 20 | - $this->source_path = realpath(BUILDBASE .'../'); |
|
| 20 | + $this->source_path = realpath(BUILDBASE .'../'); |
|
| 21 | 21 | |
| 22 | 22 | if (empty($this->source_path)) |
| 23 | 23 | { |
@@ -12,12 +12,12 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class SubTreeSplit extends BaseBuilder { |
| 14 | 14 | |
| 15 | - public function run() |
|
| 16 | - { |
|
| 15 | + public function run() |
|
| 16 | + { |
|
| 17 | 17 | |
| 18 | - } |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - //-------------------------------------------------------------------- |
|
| 20 | + //-------------------------------------------------------------------- |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -57,29 +57,29 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | $domain = ! empty($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : 'cli'; |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * A simple method to automatically determine the environment that |
|
| 62 | - * the script is running on. Modify to support your needs. |
|
| 63 | - * |
|
| 64 | - * To handle Travis-ci testing, we check for an environment |
|
| 65 | - * variable called TRAVIS which is set in the .travis.yml file. |
|
| 66 | - * This allows a database-specific setup for Travis testing. |
|
| 67 | - */ |
|
| 68 | - if (isset($_ENV['TRAVIS'])) |
|
| 69 | - { |
|
| 70 | - define('ENVIRONMENT', 'travis'); |
|
| 71 | - } |
|
| 72 | - else if (isset($_ENV['TESTING'])) |
|
| 73 | - { |
|
| 74 | - define('ENVIRONMENT', 'testing'); |
|
| 75 | - } |
|
| 76 | - else if (strpos($domain, '.dev') !== false || $domain == 'cli') |
|
| 77 | - { |
|
| 78 | - define('ENVIRONMENT', 'development'); |
|
| 79 | - } |
|
| 80 | - else { |
|
| 81 | - define('ENVIRONMENT', 'production'); |
|
| 82 | - } |
|
| 60 | + /** |
|
| 61 | + * A simple method to automatically determine the environment that |
|
| 62 | + * the script is running on. Modify to support your needs. |
|
| 63 | + * |
|
| 64 | + * To handle Travis-ci testing, we check for an environment |
|
| 65 | + * variable called TRAVIS which is set in the .travis.yml file. |
|
| 66 | + * This allows a database-specific setup for Travis testing. |
|
| 67 | + */ |
|
| 68 | + if (isset($_ENV['TRAVIS'])) |
|
| 69 | + { |
|
| 70 | + define('ENVIRONMENT', 'travis'); |
|
| 71 | + } |
|
| 72 | + else if (isset($_ENV['TESTING'])) |
|
| 73 | + { |
|
| 74 | + define('ENVIRONMENT', 'testing'); |
|
| 75 | + } |
|
| 76 | + else if (strpos($domain, '.dev') !== false || $domain == 'cli') |
|
| 77 | + { |
|
| 78 | + define('ENVIRONMENT', 'development'); |
|
| 79 | + } |
|
| 80 | + else { |
|
| 81 | + define('ENVIRONMENT', 'production'); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | /* |
| 85 | 85 | *--------------------------------------------------------------- |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | switch (ENVIRONMENT) |
| 93 | 93 | { |
| 94 | 94 | case 'development': |
| 95 | - case 'travis': |
|
| 95 | + case 'travis': |
|
| 96 | 96 | case 'testing': |
| 97 | 97 | error_reporting(-1); |
| 98 | 98 | ini_set('display_errors', 1); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * Include the path if the folder is not in the same directory |
| 151 | 151 | * as this file. |
| 152 | 152 | */ |
| 153 | - $myth_folder = 'myth'; |
|
| 153 | + $myth_folder = 'myth'; |
|
| 154 | 154 | |
| 155 | 155 | /* |
| 156 | 156 | *--------------------------------------------------------------- |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | // Name of the "system folder" |
| 268 | 268 | define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); |
| 269 | 269 | |
| 270 | - // Path to the myth folder |
|
| 271 | - define('MYTHPATH', rtrim( str_replace('\\', '/', $myth_folder), '/ ') .'/' ); |
|
| 270 | + // Path to the myth folder |
|
| 271 | + define('MYTHPATH', rtrim( str_replace('\\', '/', $myth_folder), '/ ') .'/' ); |
|
| 272 | 272 | |
| 273 | 273 | // The path to the "application" folder |
| 274 | 274 | if (is_dir($application_folder)) |
@@ -141,8 +141,8 @@ discard block |
||
| 141 | 141 | * @var array |
| 142 | 142 | */ |
| 143 | 143 | protected $codes = array( |
| 144 | - 'created' => 201, |
|
| 145 | - 'deleted' => 200, |
|
| 144 | + 'created' => 201, |
|
| 145 | + 'deleted' => 200, |
|
| 146 | 146 | 'invalid_request' => 400, |
| 147 | 147 | 'unsupported_response_type' => 400, |
| 148 | 148 | 'invalid_scope' => 400, |
@@ -166,32 +166,32 @@ discard block |
||
| 166 | 166 | 'not_implemented' => 501 |
| 167 | 167 | ); |
| 168 | 168 | |
| 169 | - /** |
|
| 170 | - * Convert common browser-sent langauge |
|
| 171 | - * strings to a folder name in the languages folder |
|
| 172 | - * that we want to use. |
|
| 173 | - * |
|
| 174 | - * Primarily used for converting to english when |
|
| 175 | - * viewing the API in a browser. |
|
| 176 | - * |
|
| 177 | - * @var array |
|
| 178 | - */ |
|
| 179 | - protected $lang_map = [ |
|
| 180 | - 'en-us' => 'english', |
|
| 181 | - 'en' => 'english', |
|
| 182 | - 'eng' => 'english', |
|
| 183 | - 'en-au' => 'english', |
|
| 184 | - 'en-nz' => 'english', |
|
| 185 | - 'en-za' => 'english', |
|
| 186 | - 'en-tt' => 'english', |
|
| 187 | - 'en-gb' => 'english', |
|
| 188 | - 'en-ca' => 'english', |
|
| 189 | - 'en-ie' => 'english', |
|
| 190 | - 'en-jm' => 'english', |
|
| 191 | - 'en-bz' => 'english', |
|
| 192 | - ]; |
|
| 193 | - |
|
| 194 | - /** |
|
| 169 | + /** |
|
| 170 | + * Convert common browser-sent langauge |
|
| 171 | + * strings to a folder name in the languages folder |
|
| 172 | + * that we want to use. |
|
| 173 | + * |
|
| 174 | + * Primarily used for converting to english when |
|
| 175 | + * viewing the API in a browser. |
|
| 176 | + * |
|
| 177 | + * @var array |
|
| 178 | + */ |
|
| 179 | + protected $lang_map = [ |
|
| 180 | + 'en-us' => 'english', |
|
| 181 | + 'en' => 'english', |
|
| 182 | + 'eng' => 'english', |
|
| 183 | + 'en-au' => 'english', |
|
| 184 | + 'en-nz' => 'english', |
|
| 185 | + 'en-za' => 'english', |
|
| 186 | + 'en-tt' => 'english', |
|
| 187 | + 'en-gb' => 'english', |
|
| 188 | + 'en-ca' => 'english', |
|
| 189 | + 'en-ie' => 'english', |
|
| 190 | + 'en-jm' => 'english', |
|
| 191 | + 'en-bz' => 'english', |
|
| 192 | + ]; |
|
| 193 | + |
|
| 194 | + /** |
|
| 195 | 195 | * If you wish to override the default authentication |
| 196 | 196 | * library used for authentication, set this to the |
| 197 | 197 | * fully namespaced class name. |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | */ |
| 545 | 545 | public function grabVar($name) |
| 546 | 546 | { |
| 547 | - return array_key_exists($name, $this->vars) ? $this->vars[$name] : false; |
|
| 547 | + return array_key_exists($name, $this->vars) ? $this->vars[$name] : false; |
|
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | //-------------------------------------------------------------------- |
@@ -757,12 +757,12 @@ discard block |
||
| 757 | 757 | // Remove weight and strip space |
| 758 | 758 | list($lang) = explode(';', $lang); |
| 759 | 759 | |
| 760 | - $lang = strtolower(trim($lang)); |
|
| 760 | + $lang = strtolower(trim($lang)); |
|
| 761 | 761 | |
| 762 | - if (array_key_exists($lang, $this->lang_map)) |
|
| 763 | - { |
|
| 764 | - $lang = $this->lang_map[$lang]; |
|
| 765 | - } |
|
| 762 | + if (array_key_exists($lang, $this->lang_map)) |
|
| 763 | + { |
|
| 764 | + $lang = $this->lang_map[$lang]; |
|
| 765 | + } |
|
| 766 | 766 | |
| 767 | 767 | $return_langs[] = $lang; |
| 768 | 768 | } |
@@ -782,10 +782,10 @@ discard block |
||
| 782 | 782 | */ |
| 783 | 783 | public function detectFields() |
| 784 | 784 | { |
| 785 | - if (! array_key_exists('fields', $_GET)) |
|
| 786 | - { |
|
| 787 | - return; |
|
| 788 | - } |
|
| 785 | + if (! array_key_exists('fields', $_GET)) |
|
| 786 | + { |
|
| 787 | + return; |
|
| 788 | + } |
|
| 789 | 789 | |
| 790 | 790 | $fields = explode(',', $_GET['fields']); |
| 791 | 791 | |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | return; |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | - $model = new LogModel(); |
|
| 817 | + $model = new LogModel(); |
|
| 818 | 818 | |
| 819 | 819 | $data = [ |
| 820 | 820 | 'duration' => microtime(true) - $this->start_time, |