@@ -6,6 +6,6 @@ |
||
| 6 | 6 | # Take a look at the PSR-0-compatible class autoloading implementation |
| 7 | 7 | # in the Readme.php file if you want a simple autoloader setup. |
| 8 | 8 | |
| 9 | -require_once dirname(__FILE__) . '/MarkdownInterface.php'; |
|
| 10 | -require_once dirname(__FILE__) . '/Markdown.php'; |
|
| 11 | -require_once dirname(__FILE__) . '/MarkdownExtra.php'; |
|
| 9 | +require_once dirname(__FILE__).'/MarkdownInterface.php'; |
|
| 10 | +require_once dirname(__FILE__).'/Markdown.php'; |
|
| 11 | +require_once dirname(__FILE__).'/MarkdownExtra.php'; |
|
@@ -6,4 +6,4 @@ |
||
| 6 | 6 | # Take a look at the PSR-0-compatible class autoloading implementation |
| 7 | 7 | # in the Readme.php file if you want a simple autoloader setup. |
| 8 | 8 | |
| 9 | -require_once dirname(__FILE__) . '/MarkdownInterface.php'; |
|
| 9 | +require_once dirname(__FILE__).'/MarkdownInterface.php'; |
|
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | # Take a look at the PSR-0-compatible class autoloading implementation |
| 7 | 7 | # in the Readme.php file if you want a simple autoloader setup. |
| 8 | 8 | |
| 9 | -require_once dirname(__FILE__) . '/MarkdownInterface.php'; |
|
| 10 | -require_once dirname(__FILE__) . '/Markdown.php'; |
|
| 9 | +require_once dirname(__FILE__).'/MarkdownInterface.php'; |
|
| 10 | +require_once dirname(__FILE__).'/Markdown.php'; |
|
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | # Install PSR-0-compatible class autoloader |
| 8 | 8 | spl_autoload_register(function($class){ |
| 9 | - require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; |
|
| 9 | + require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; |
|
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | 12 | # Get Markdown class |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | </head> |
| 25 | 25 | <body> |
| 26 | 26 | <?php |
| 27 | - # Put HTML content in the document |
|
| 28 | - echo $html; |
|
| 29 | - ?> |
|
| 27 | + # Put HTML content in the document |
|
| 28 | + echo $html; |
|
| 29 | + ?> |
|
| 30 | 30 | </body> |
| 31 | 31 | </html> |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | # you like. |
| 6 | 6 | |
| 7 | 7 | # Install PSR-0-compatible class autoloader |
| 8 | -spl_autoload_register(function($class){ |
|
| 8 | +spl_autoload_register(function($class) { |
|
| 9 | 9 | require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; |
| 10 | 10 | }); |
| 11 | 11 | |
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload.php @generated by Composer |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/composer' . '/autoload_real.php'; |
|
| 5 | +require_once __DIR__.'/composer'.'/autoload_real.php'; |
|
| 6 | 6 | |
| 7 | 7 | return ComposerAutoloaderInit7b593c329d00694ef3fa74c9b77a3c76::getLoader(); |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function __construct($proc = false) |
| 15 | 15 | { |
| 16 | - if ($proc === false) $proc = new XSLTProcessor(); |
|
| 16 | + if ($proc === false) {
|
|
| 17 | + $proc = new XSLTProcessor(); |
|
| 18 | + } |
|
| 17 | 19 | $this->xsltProcessor = $proc; |
| 18 | 20 | } |
| 19 | 21 | |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** Returns the filename of the file. */ |
| 33 | - public function getName() {return $this->name;} |
|
| 33 | + public function getName() {return $this->name; } |
|
| 34 | 34 | |
| 35 | 35 | /** Returns directory of the file without trailing slash */ |
| 36 | - public function getDirectory() {return $this->fs->dirname($this->name);} |
|
| 36 | + public function getDirectory() {return $this->fs->dirname($this->name); } |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Retrieves the contents of a file |
@@ -81,7 +81,9 @@ discard block |
||
| 81 | 81 | /** Opens file's handle */ |
| 82 | 82 | public function open($mode) |
| 83 | 83 | { |
| 84 | - if ($this->handle) $this->close(); |
|
| 84 | + if ($this->handle) {
|
|
| 85 | + $this->close(); |
|
| 86 | + } |
|
| 85 | 87 | $this->handle = $this->fs->fopen($this->name, $mode); |
| 86 | 88 | return true; |
| 87 | 89 | } |
@@ -89,7 +91,9 @@ discard block |
||
| 89 | 91 | /** Closes file's handle */ |
| 90 | 92 | public function close() |
| 91 | 93 | { |
| 92 | - if (!$this->handle) return false; |
|
| 94 | + if (!$this->handle) {
|
|
| 95 | + return false; |
|
| 96 | + } |
|
| 93 | 97 | $status = $this->fs->fclose($this->handle); |
| 94 | 98 | $this->handle = false; |
| 95 | 99 | return $status; |
@@ -98,42 +102,57 @@ discard block |
||
| 98 | 102 | /** Retrieves a line from an open file, with optional max length $length */ |
| 99 | 103 | public function getLine($length = null) |
| 100 | 104 | { |
| 101 | - if (!$this->handle) $this->open('r'); |
|
| 102 | - if ($length === null) return $this->fs->fgets($this->handle); |
|
| 103 | - else return $this->fs->fgets($this->handle, $length); |
|
| 105 | + if (!$this->handle) {
|
|
| 106 | + $this->open('r');
|
|
| 107 | + } |
|
| 108 | + if ($length === null) {
|
|
| 109 | + return $this->fs->fgets($this->handle); |
|
| 110 | + } else {
|
|
| 111 | + return $this->fs->fgets($this->handle, $length); |
|
| 112 | + } |
|
| 104 | 113 | } |
| 105 | 114 | |
| 106 | 115 | /** Retrieves a character from an open file */ |
| 107 | 116 | public function getChar() |
| 108 | 117 | { |
| 109 | - if (!$this->handle) $this->open('r'); |
|
| 118 | + if (!$this->handle) {
|
|
| 119 | + $this->open('r');
|
|
| 120 | + } |
|
| 110 | 121 | return $this->fs->fgetc($this->handle); |
| 111 | 122 | } |
| 112 | 123 | |
| 113 | 124 | /** Retrieves an $length bytes of data from an open data */ |
| 114 | 125 | public function read($length) |
| 115 | 126 | { |
| 116 | - if (!$this->handle) $this->open('r'); |
|
| 127 | + if (!$this->handle) {
|
|
| 128 | + $this->open('r');
|
|
| 129 | + } |
|
| 117 | 130 | return $this->fs->fread($this->handle, $length); |
| 118 | 131 | } |
| 119 | 132 | |
| 120 | 133 | /** Writes to an open file */ |
| 121 | 134 | public function put($string) |
| 122 | 135 | { |
| 123 | - if (!$this->handle) $this->open('a'); |
|
| 136 | + if (!$this->handle) {
|
|
| 137 | + $this->open('a');
|
|
| 138 | + } |
|
| 124 | 139 | return $this->fs->fwrite($this->handle, $string); |
| 125 | 140 | } |
| 126 | 141 | |
| 127 | 142 | /** Returns TRUE if the end of the file has been reached */ |
| 128 | 143 | public function eof() |
| 129 | 144 | { |
| 130 | - if (!$this->handle) return true; |
|
| 145 | + if (!$this->handle) {
|
|
| 146 | + return true; |
|
| 147 | + } |
|
| 131 | 148 | return $this->fs->feof($this->handle); |
| 132 | 149 | } |
| 133 | 150 | |
| 134 | 151 | public function __destruct() |
| 135 | 152 | { |
| 136 | - if ($this->handle) $this->close(); |
|
| 153 | + if ($this->handle) {
|
|
| 154 | + $this->close(); |
|
| 155 | + } |
|
| 137 | 156 | } |
| 138 | 157 | |
| 139 | 158 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | ) return false; |
| 24 | 24 | // Custom implementations can go here |
| 25 | 25 | // Standard implementation: |
| 26 | - return str_replace('_', '/', $class) . '.php'; |
|
| 26 | + return str_replace('_', '/', $class).'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | } |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | public static function autoload($class) |
| 11 | 11 | { |
| 12 | 12 | $path = HTMLPurifierExtras::getPath($class); |
| 13 | - if (!$path) return false; |
|
| 13 | + if (!$path) {
|
|
| 14 | + return false; |
|
| 15 | + } |
|
| 14 | 16 | require $path; |
| 15 | 17 | return true; |
| 16 | 18 | } |
@@ -20,7 +22,9 @@ discard block |
||
| 20 | 22 | if ( |
| 21 | 23 | strncmp('FSTools', $class, 7) !== 0 && |
| 22 | 24 | strncmp('ConfigDoc', $class, 9) !== 0 |
| 23 | - ) return false; |
|
| 25 | + ) {
|
|
| 26 | + return false; |
|
| 27 | + } |
|
| 24 | 28 | // Custom implementations can go here |
| 25 | 29 | // Standard implementation: |
| 26 | 30 | return str_replace('_', '/', $class) . '.php'; |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $folders = preg_split("#[\\\\/]#", $folder); |
| 41 | 41 | $base = ''; |
| 42 | - for($i = 0, $c = count($folders); $i < $c; $i++) { |
|
| 43 | - if(empty($folders[$i])) { |
|
| 42 | + for ($i = 0, $c = count($folders); $i < $c; $i++) { |
|
| 43 | + if (empty($folders[$i])) { |
|
| 44 | 44 | if (!$i) { |
| 45 | 45 | // special case for root level |
| 46 | 46 | $base .= DIRECTORY_SEPARATOR; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | continue; |
| 49 | 49 | } |
| 50 | 50 | $base .= $folders[$i]; |
| 51 | - if(!is_dir($base)){ |
|
| 51 | + if (!is_dir($base)) { |
|
| 52 | 52 | $this->mkdir($base); |
| 53 | 53 | } |
| 54 | 54 | $base .= DIRECTORY_SEPARATOR; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | // Loop through the folder |
| 74 | 74 | $dir = $this->dir($source); |
| 75 | - while ( false !== ($entry = $dir->read()) ) { |
|
| 75 | + while (false !== ($entry = $dir->read())) { |
|
| 76 | 76 | // Skip pointers |
| 77 | 77 | if ($entry == '.' || $entry == '..') { |
| 78 | 78 | continue; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | continue; |
| 126 | 126 | } |
| 127 | 127 | // Recurse |
| 128 | - $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); |
|
| 128 | + $this->rmdirr($dirname.DIRECTORY_SEPARATOR.$entry); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Clean up |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public static function singleton() |
| 19 | 19 | { |
| 20 | - if (empty(FSTools::$singleton)) FSTools::$singleton = new FSTools(); |
|
| 20 | + if (empty(FSTools::$singleton)) {
|
|
| 21 | + FSTools::$singleton = new FSTools(); |
|
| 22 | + } |
|
| 21 | 23 | return FSTools::$singleton; |
| 22 | 24 | } |
| 23 | 25 | |
@@ -139,9 +141,13 @@ discard block |
||
| 139 | 141 | public function globr($dir, $pattern, $flags = NULL) |
| 140 | 142 | { |
| 141 | 143 | $files = $this->glob("$dir/$pattern", $flags); |
| 142 | - if ($files === false) $files = array(); |
|
| 144 | + if ($files === false) {
|
|
| 145 | + $files = array(); |
|
| 146 | + } |
|
| 143 | 147 | $sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR); |
| 144 | - if ($sub_dirs === false) $sub_dirs = array(); |
|
| 148 | + if ($sub_dirs === false) {
|
|
| 149 | + $sub_dirs = array(); |
|
| 150 | + } |
|
| 145 | 151 | foreach ($sub_dirs as $sub_dir) { |
| 146 | 152 | $sub_files = $this->globr($sub_dir, $pattern, $flags); |
| 147 | 153 | $files = array_merge($files, $sub_files); |