@@ -20,8 +20,8 @@ |
||
| 20 | 20 | * @package Phile\Plugin\Phile\ParserMarkdown |
| 21 | 21 | */ |
| 22 | 22 | class Plugin extends AbstractPlugin { |
| 23 | - const HANDLER_ERROR_LOG = 'error_log'; |
|
| 24 | - const HANDLER_DEVELOPMENT = 'development'; |
|
| 23 | + const HANDLER_ERROR_LOG = 'error_log'; |
|
| 24 | + const HANDLER_DEVELOPMENT = 'development'; |
|
| 25 | 25 | |
| 26 | 26 | protected $events = ['plugins_loaded' => 'onPluginsLoaded']; |
| 27 | 27 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | // you can access this plugins' config in $this->settings |
| 48 | 48 | $settings = $this->settings; |
| 49 | 49 | |
| 50 | - $content = $data['content']; |
|
| 50 | + $content = $data['content']; |
|
| 51 | 51 | $content = $this->printPhpAsMarkdown($settings) . $content; |
| 52 | 52 | |
| 53 | 53 | $page = $data['page']; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function accept() { |
| 18 | 18 | /** @var \SplFileInfo $this */ |
| 19 | - return (preg_match('/^[^\.]{1}.*'.CONTENT_EXT.'/', $this->getFilename()) > 0); |
|
| 19 | + return (preg_match('/^[^\.]{1}.*' . CONTENT_EXT . '/', $this->getFilename()) > 0); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | \ No newline at end of file |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | // for php unit testings, we need to check if constant is defined |
| 76 | 76 | // before setting them, because there is a bug in PHPUnit which |
| 77 | 77 | // init our bootstrap multiple times. |
| 78 | - defined('PHILE_VERSION') or define('PHILE_VERSION', '1.6.0'); |
|
| 79 | - defined('PHILE_CLI_MODE') or define('PHILE_CLI_MODE', (php_sapi_name() == "cli") ? true : false); |
|
| 80 | - defined('ROOT_DIR') or define('ROOT_DIR', realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); |
|
| 81 | - defined('CONTENT_DIR') or define('CONTENT_DIR', ROOT_DIR . 'content' . DIRECTORY_SEPARATOR); |
|
| 82 | - defined('CONTENT_EXT') or define('CONTENT_EXT', '.md'); |
|
| 83 | - defined('LIB_DIR') or define('LIB_DIR', ROOT_DIR . 'lib' . DIRECTORY_SEPARATOR); |
|
| 84 | - defined('PLUGINS_DIR') or define('PLUGINS_DIR', ROOT_DIR . 'plugins' . DIRECTORY_SEPARATOR); |
|
| 85 | - defined('THEMES_DIR') or define('THEMES_DIR', ROOT_DIR . 'themes' . DIRECTORY_SEPARATOR); |
|
| 86 | - defined('CACHE_DIR') or define('CACHE_DIR', LIB_DIR . 'cache' . DIRECTORY_SEPARATOR); |
|
| 78 | + defined('PHILE_VERSION') or define('PHILE_VERSION', '1.6.0'); |
|
| 79 | + defined('PHILE_CLI_MODE') or define('PHILE_CLI_MODE', (php_sapi_name() == "cli") ? true : false); |
|
| 80 | + defined('ROOT_DIR') or define('ROOT_DIR', realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR); |
|
| 81 | + defined('CONTENT_DIR') or define('CONTENT_DIR', ROOT_DIR . 'content' . DIRECTORY_SEPARATOR); |
|
| 82 | + defined('CONTENT_EXT') or define('CONTENT_EXT', '.md'); |
|
| 83 | + defined('LIB_DIR') or define('LIB_DIR', ROOT_DIR . 'lib' . DIRECTORY_SEPARATOR); |
|
| 84 | + defined('PLUGINS_DIR') or define('PLUGINS_DIR', ROOT_DIR . 'plugins' . DIRECTORY_SEPARATOR); |
|
| 85 | + defined('THEMES_DIR') or define('THEMES_DIR', ROOT_DIR . 'themes' . DIRECTORY_SEPARATOR); |
|
| 86 | + defined('CACHE_DIR') or define('CACHE_DIR', LIB_DIR . 'cache' . DIRECTORY_SEPARATOR); |
|
| 87 | 87 | defined('STORAGE_DIR') or define('STORAGE_DIR', LIB_DIR . 'datastorage' . DIRECTORY_SEPARATOR); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | protected function initializeAutoloader() { |
| 94 | 94 | spl_autoload_extensions(".php"); |
| 95 | 95 | // load phile core |
| 96 | - spl_autoload_register(function ($className) { |
|
| 96 | + spl_autoload_register(function($className) { |
|
| 97 | 97 | $fileName = LIB_DIR . str_replace("\\", DIRECTORY_SEPARATOR, $className) . '.php'; |
| 98 | 98 | if (file_exists($fileName)) { |
| 99 | 99 | require_once $fileName; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | public function offsetSet($offset, $value) { |
| 70 | 70 | $this->load(); |
| 71 | - $this->pages[$offset] = $value; |
|
| 71 | + $this->pages[$offset] = $value; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function offsetUnset($offset) { |