Skip to content

Commit

Permalink
docs(system): remove the SYSPATH definition check
Browse files Browse the repository at this point in the history
  • Loading branch information
kilofox committed Aug 5, 2023
1 parent a4f560a commit e4ef873
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion system/guide/kohana/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The default Kohana classes, and many extensions, use this definition so that alm

For instance, if you wanted to create method that sets encrypted cookies using the [Encrypt] class, you would create a file at `APPPATH/classes/Cookie.php` that extends Kohana_Cookie, and adds your functions:

<?php defined('SYSPATH') OR die('No direct script access.');
<?php

class Cookie extends Kohana_Cookie
{
Expand Down
8 changes: 4 additions & 4 deletions system/guide/kohana/files/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Configuration files are used to store any kind of configuration needed for a module, class, or anything else you want. They are plain PHP files, stored in the `config/` directory, which return an associative array:

<?php defined('SYSPATH') OR die('No direct script access.');
<?php

return [
'setting' => 'value',
Expand All @@ -24,7 +24,7 @@ For example, if we wanted to change or add to an entry in the inflector configur

// config/inflector.php

<?php defined('SYSPATH') OR die('No direct script access.');
<?php

return [
'irregular' => [
Expand All @@ -40,7 +40,7 @@ Let's say we want a config file to store and easily change things like the title

// config/site.php

<?php defined('SYSPATH') OR die('No direct script access.');
<?php

return [
'title' => 'Our Shiny Website',
Expand All @@ -53,7 +53,7 @@ Let's say we want an archive of versions of some software. We could use config f

// config/versions.php

<?php defined('SYSPATH') OR die('No direct script access.');
<?php

return [
'1.0.0' => [
Expand Down
6 changes: 3 additions & 3 deletions system/guide/kohana/tutorials/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ First off we have to make a controller that Kohana can use to handle a request.

Create the file `application/classes/Controller/Hello.php` in your application folder and fill it out like so:

<?php defined('SYSPATH') OR die('No Direct Script Access');
<?php

Class Controller_Hello extends Controller
{
Expand All @@ -22,7 +22,7 @@ Create the file `application/classes/Controller/Hello.php` in your application f

Lets see what's going on here:

`<?php defined('SYSPATH') OR die('No Direct Script Access');`
`<?php`
: You should recognize the first tag as an opening php tag (if you don't you should probably [learn php](http://php.net)). What follows is a small check that makes sure that this file is being included by Kohana. It stops people from accessing files directly from the url.

`Class Controller_Hello extends Controller`
Expand All @@ -49,7 +49,7 @@ The proper way to code with an MVC framework is to use _views_ to handle the pre

Lets change our original controller slightly:

<?php defined('SYSPATH') OR die('No Direct Script Access');
<?php

Class Controller_Hello extends Controller_Template
{
Expand Down

0 comments on commit e4ef873

Please sign in to comment.