Skip to content

Commit

Permalink
Fix php syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Aug 31, 2014
1 parent cafbb76 commit 1f4543d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 5 additions & 3 deletions cms/application/classes/kohana.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ public static function modules(array $modules = NULL)
{
$modules = parent::modules($modules);

foreach (array(CMSPATH, DOCROOT) as $path) {
if (!in_array($path, Kohana::$_paths)) {
foreach (array(CMSPATH, DOCROOT) as $path)
{
if (!in_array($path, Kohana::$_paths))
{
array_unshift(Kohana::$_paths, $path);
}
}

return $modules;
}
}
15 changes: 12 additions & 3 deletions cms/modules/kodicms/classes/kodicms/http/exception/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ class KodiCMS_HTTP_Exception_404 extends Kohana_HTTP_Exception_404
public function get_response()
{
$ext = pathinfo(Request::current()->url(), PATHINFO_EXTENSION);
if ($ext && !($mimetype = File::mime_by_ext($ext))) $mimetype = 'application/octet-stream';
if ($mimetype) {

$mimetype = FALSE;
if ($ext AND ! ($mimetype = File::mime_by_ext($ext)))
{
$mimetype = 'application/octet-stream';
}

if ($mimetype)
{
return Response::factory()
->headers('content-type', $mimetype)
->status(404);
} else {
}
else
{
return parent::get_response();
}
}
Expand Down
8 changes: 4 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*
* @see http://php.net/manual/en/features.commandline.webserver.php
**/
if (php_sapi_name() == "cli-server" &&
($_SERVER['REQUEST_URI'] != '/') &&
if (php_sapi_name() == "cli-server" AND ( $_SERVER['REQUEST_URI'] != '/') AND
file_exists(__DIR__ . DIRECTORY_SEPARATOR . $_SERVER['REQUEST_URI'])
) {
return false; // serve the requested resource as-is.
)
{
return FALSE; // serve the requested resource as-is.
}

$cms = 'cms' . DIRECTORY_SEPARATOR;
Expand Down

0 comments on commit 1f4543d

Please sign in to comment.