@@ -15,6 +15,6 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function configure() |
| 17 | 17 | { |
| 18 | - $this->bind('BEAR\Sunday\Extension\WebResponse\ResponseInterface')->to(__NAMESPACE__ . '\HttpFoundation'); |
|
| 18 | + $this->bind('BEAR\Sunday\Extension\WebResponse\ResponseInterface')->to(__NAMESPACE__.'\HttpFoundation'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | $enable = extension_loaded('xhprof') && (PHP_SAPI !== 'cli'); |
| 16 | -if (! $enable) { |
|
| 16 | +if (!$enable) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -22,15 +22,15 @@ discard block |
||
| 22 | 22 | // start |
| 23 | 23 | xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY); |
| 24 | 24 | |
| 25 | -if (! ini_get('xhprof.output_dir')) { |
|
| 25 | +if (!ini_get('xhprof.output_dir')) { |
|
| 26 | 26 | ini_set('xhprof.output_dir', '/tmp'); |
| 27 | 27 | } |
| 28 | 28 | // stop |
| 29 | 29 | register_shutdown_function( |
| 30 | - function () { |
|
| 30 | + function() { |
|
| 31 | 31 | $xhprof = xhprof_disable(); |
| 32 | 32 | if (!$xhprof) { |
| 33 | - error_log('xhprof failed in ' . __FILE__ ); |
|
| 33 | + error_log('xhprof failed in '.__FILE__); |
|
| 34 | 34 | return; |
| 35 | 35 | } |
| 36 | 36 | $id = (new XHProfRuns_Default)->save_run($xhprof, 'sunday'); |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | 'xdebug' => extension_loaded('Xdebug') ? phpversion('Xdebug') : 'n/a', |
| 12 | 12 | 'xhprof' => extension_loaded('xhprof') ? phpversion('xhprof') : 'n/a' |
| 13 | 13 | ]; |
| 14 | - $versionView= ''; |
|
| 14 | + $versionView = ''; |
|
| 15 | 15 | foreach ($versions as $ext => $version) { |
| 16 | 16 | $versionView .= "<li><b>{$ext}</b>: {$version}</li>"; |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | view: { |
| 21 | - $contentsForLayout =<<<EOT |
|
| 21 | + $contentsForLayout = <<<EOT |
|
| 22 | 22 | |
| 23 | 23 | <div class="well"> |
| 24 | 24 | <ul> |
@@ -40,6 +40,6 @@ discard block |
||
| 40 | 40 | </ul> |
| 41 | 41 | </div> |
| 42 | 42 | EOT; |
| 43 | - echo include __DIR__ . '/layout.php'; |
|
| 43 | + echo include __DIR__.'/layout.php'; |
|
| 44 | 44 | } |
| 45 | 45 | |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | // All files |
| 19 | 19 | foreach ($files as $file) { |
| 20 | 20 | $ext = preg_replace('/^.*\./', '', $file); |
| 21 | - $shortFileName = str_replace(dirname($file) . DIRECTORY_SEPARATOR, '', $file); |
|
| 22 | - $html .= "<li class=\"file ext_$ext\"><a href=\"#\" alt=\"{$file}\" rel=\"" . htmlspecialchars($file); |
|
| 23 | - $html .= "\">" . htmlspecialchars($shortFileName) . "</a></li>"; |
|
| 21 | + $shortFileName = str_replace(dirname($file).DIRECTORY_SEPARATOR, '', $file); |
|
| 22 | + $html .= "<li class=\"file ext_$ext\"><a href=\"#\" alt=\"{$file}\" rel=\"".htmlspecialchars($file); |
|
| 23 | + $html .= "\">".htmlspecialchars($shortFileName)."</a></li>"; |
|
| 24 | 24 | } |
| 25 | -$html .= "</ul>"; |
|
| 25 | +$html .= "</ul>"; |
|
| 26 | 26 | |
| 27 | 27 | echo $html; |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use BEAR\Ace\Editor; |
| 4 | 4 | |
| 5 | -if (! isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { |
|
| 5 | +if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { |
|
| 6 | 6 | throw new \BadMethodCallException; |
| 7 | 7 | } |
| 8 | 8 | |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | $modDate = date(DATE_RFC822, time($path)); |
| 5 | 5 | $ownerInfo['name'] = ''; |
| 6 | 6 | $isWritable = is_writable($path); |
| 7 | -$save = $isWritable ? '<a href="#" id="save" style="color:blue" onClick="save(\'' . $path . '\')" >save</a><br />' : '<span style="color:red">Read Only</span>'; |
|
| 7 | +$save = $isWritable ? '<a href="#" id="save" style="color:blue" onClick="save(\''.$path.'\')" >save</a><br />' : '<span style="color:red">Read Only</span>'; |
|
| 8 | 8 | $info = pathinfo($path); |
| 9 | 9 | if (isset($info['extension'])) { |
| 10 | 10 | $ext = $info['extension']; |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | //$tree->tree('#container_id1', $files['page'], '<span class=\"tree_label\">Page</span>'); |
| 10 | 10 | //$tree->tree('#container_id2', $files['ro'], '<span class=\"tree_label\">Resource</span>'); |
| 11 | 11 | //$tree->tree('#container_id3', $files['view'], '<span class=\"tree_label\">View template</span>'); |
| 12 | -$tree->tree('#container_id', '/' , '<span class=\"tree_label\">Project</span>'); |
|
| 13 | -$initialOpeningFile =$root . '/'; |
|
| 12 | +$tree->tree('#container_id', '/', '<span class=\"tree_label\">Project</span>'); |
|
| 13 | +$initialOpeningFile = $root.'/'; |
|
| 14 | 14 | $js = $tree->getJsCode($initialOpeningFile); |
| 15 | 15 | |
| 16 | 16 | echo $js; |
@@ -15,22 +15,22 @@ |
||
| 15 | 15 | // |
| 16 | 16 | |
| 17 | 17 | $dir = $_POST['dir']; |
| 18 | -if( file_exists($_POST['dir']) ) { |
|
| 18 | +if (file_exists($_POST['dir'])) { |
|
| 19 | 19 | $files = scandir($_POST['dir']); |
| 20 | 20 | natcasesort($files); |
| 21 | - if( count($files) > 2 ) { /* The 2 accounts for . and .. */ |
|
| 21 | + if (count($files) > 2) { /* The 2 accounts for . and .. */ |
|
| 22 | 22 | echo "<ul class=\"tree\" style=\"display: none;\">"; |
| 23 | 23 | // All dirs |
| 24 | - foreach( $files as $file ) { |
|
| 25 | - if( file_exists($_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($_POST['dir'] . $file) ) { |
|
| 26 | - echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>"; |
|
| 24 | + foreach ($files as $file) { |
|
| 25 | + if (file_exists($_POST['dir'].$file) && $file != '.' && $file != '..' && is_dir($_POST['dir'].$file)) { |
|
| 26 | + echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"".htmlentities($_POST['dir'].$file)."/\">".htmlentities($file)."</a></li>"; |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | // All files |
| 30 | - foreach( $files as $file ) { |
|
| 31 | - if( file_exists($_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($_POST['dir'] . $file) ) { |
|
| 30 | + foreach ($files as $file) { |
|
| 31 | + if (file_exists($_POST['dir'].$file) && $file != '.' && $file != '..' && !is_dir($_POST['dir'].$file)) { |
|
| 32 | 32 | $ext = preg_replace('/^.*\./', '', $file); |
| 33 | - echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>"; |
|
| 33 | + echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"".htmlentities($_POST['dir'].$file)."\">".htmlentities($file)."</a></li>"; |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | echo "</ul>"; |
@@ -11,24 +11,24 @@ |
||
| 11 | 11 | |
| 12 | 12 | // All dirs |
| 13 | 13 | foreach ($files as $file) { |
| 14 | - if (file_exists($dir . $file) && $file != '.' && $file != '..' && is_dir($dir . $file)) { |
|
| 14 | + if (file_exists($dir.$file) && $file != '.' && $file != '..' && is_dir($dir.$file)) { |
|
| 15 | 15 | if ((substr($file, 0, 1) !== '.') && (substr($file, 0, 2) !== '__')) { |
| 16 | 16 | $html .= "<li class=\"directory collapsed\"><a onclick=\"folder_select('"; |
| 17 | - $html .= htmlspecialchars($dir . $file) . "');\" href=\"#\" rel=\"" . htmlspecialchars( |
|
| 18 | - $dir . $file |
|
| 19 | - ) . "/\">"; |
|
| 20 | - $html .= htmlspecialchars($file) . "</a></li>"; |
|
| 17 | + $html .= htmlspecialchars($dir.$file)."');\" href=\"#\" rel=\"".htmlspecialchars( |
|
| 18 | + $dir.$file |
|
| 19 | + )."/\">"; |
|
| 20 | + $html .= htmlspecialchars($file)."</a></li>"; |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // All files |
| 26 | 26 | foreach ($files as $file) { |
| 27 | - if (file_exists($dir . $file) && $file != '.' && $file != '..' && !is_dir($dir . $file)) { |
|
| 27 | + if (file_exists($dir.$file) && $file != '.' && $file != '..' && !is_dir($dir.$file)) { |
|
| 28 | 28 | $ext = preg_replace('/^.*\./', '', $file); |
| 29 | 29 | if (substr($file, 0, 1) !== '.') { |
| 30 | - $html .= "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlspecialchars($dir . $file); |
|
| 31 | - $html .= "\">" . htmlspecialchars($file) . '</a></li>'; |
|
| 30 | + $html .= "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"".htmlspecialchars($dir.$file); |
|
| 31 | + $html .= "\">".htmlspecialchars($file).'</a></li>'; |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | } |