Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"application" to "app" directory doc and comments and welcome_message clean up #1629

Merged
merged 1 commit into from
Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Config/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct()
* to their location on the file system. These are used by the
* Autoloader to locate files the first time they have been instantiated.
*
* The '/application' and '/system' directories are already mapped for
* The '/app' and '/system' directories are already mapped for
* you. You may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work.
Expand Down
8 changes: 4 additions & 4 deletions app/Config/Paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Holds the paths that are used by the system to
* locate the main directories, application, system, etc.
* locate the main directories, app, system, etc.
* Modifying these allows you to re-structure your application,
* share a system folder between multiple applications, and more.
*
Expand Down Expand Up @@ -45,7 +45,7 @@ class Paths
* This variable must contain the name of your "writable" directory.
* The writable directory allows you to group all directories that
* need write permission to a single place that can be tucked away
* for maximum security, keeping it out of the application and/or
* for maximum security, keeping it out of the app and/or
* system directories.
*/
public $writableDirectory = __DIR__ . '/../../writable';
Expand All @@ -58,7 +58,7 @@ class Paths
* This variable must contain the name of your "tests" directory.
* The writable directory allows you to group all directories that
* need write permission to a single place that can be tucked away
* for maximum security, keeping it out of the application and/or
* for maximum security, keeping it out of the app and/or
* system directories.
*/
public $testsDirectory = __DIR__ . '/../../tests';
Expand All @@ -70,7 +70,7 @@ class Paths
*
* This variable must contain the name of the directory that
* contains the view files used by your application. By
* default this is in `application/Views`. This value
* default this is in `app/Views`. This value
* is used when no value is provided to `Services::renderer()`.
*/
public $viewDirectory = __DIR__ . '/../../app/Views';
Expand Down
4 changes: 2 additions & 2 deletions app/Views/welcome_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@

<pre>
<code>
application/Views/welcome_message.php
app/Views/welcome_message.php
</code>
</pre>

<p>The corresponding controller for this page is found at:</p>

<pre>
<code>
application/Controllers/Home.php
app/Controllers/Home.php
</code>
</pre>

Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/concepts/autoloader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ beginning of the framework's execution.
Configuration
=============

Initial configuration is done in **/application/Config/Autoload.php**. This file contains two primary
Initial configuration is done in **/app/Config/Autoload.php**. This file contains two primary
arrays: one for the classmap, and one for PSR4-compatible namespaces.

Namespaces
Expand All @@ -52,7 +52,7 @@ have a trailing slash.

By default, the application folder is namespace to the ``App`` namespace. While you are not forced to namespace the controllers,
libraries, or models in the application directory, if you do, they will be found under the ``App`` namespace.
You may change this namespace by editing the **/application/Config/Constants.php** file and setting the
You may change this namespace by editing the **/app/Config/Constants.php** file and setting the
new namespace value under the ``APP_NAMESPACE`` setting::

define('APP_NAMESPACE', 'App');
Expand Down Expand Up @@ -80,7 +80,7 @@ Legacy Support
==============

If neither of the above methods find the class, and the class is not namespaced, the autoloader will look in the
**/application/Libraries** and **/application/Models** directories to attempt to locate the files. This provides
**/app/Libraries** and **/app/Models** directories to attempt to locate the files. This provides
a measure to help ease the transition from previous versions.

There are no configuration options for legacy support.
2 changes: 1 addition & 1 deletion user_guide_src/source/extending/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Events are always enabled, and are available globally.
Defining an Event
=================

Most events are defined within the **application/Config/Events.php** file. You can subscribe an action to an event with
Most events are defined within the **app/Config/Events.php** file. You can subscribe an action to an event with
the Events class' ``on()`` method. The first parameter is the name of the event to subscribe to. The second parameter is
a callable that will be run when that event is triggered::

Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/general/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ you. Once the tag is in place, your pages will begin being cached.
your output, you have to manually delete your cache files.

.. note:: Before the cache files can be written you must set the cache
engine up by editing **application/Config/Cache.php**.
engine up by editing **app/Config/Cache.php**.

Deleting Caches
===============
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/general/common_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Miscellaneous Functions
:returns: TRUE if was logged succesfully or FALSE if there was a problem logging it
:rtype: bool

Logs a message using the Log Handlers defined in **application/Config/Logger.php**.
Logs a message using the Log Handlers defined in **app/Config/Logger.php**.

Level can be one of the following values: **emergency**, **alert**, **critical**, **error**, **warning**,
**notice**, **info**, or **debug**.
Expand Down
10 changes: 5 additions & 5 deletions user_guide_src/source/general/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ are public, so you access the settings like any other property::
$mailpath = $config->mailpath;

If no namespace is provided, it will look for the files in all available namespaces that have
been defined, as well as **/application/Config/**. All of the configuration files
been defined, as well as **/app/Config/**. All of the configuration files
that ship with CodeIgniter are namespaced with ``Config``. Using this namespace in your
application will provide the best performance since it knows exactly what directory to find the
files in and doesn't have to scan several locations in the filesystem to get there.

You can locate the configuration files any place on your server by using a different namespace.
This allows you to pull configuration files on the production server to a folder that is not in
the web-accessible space at all, while keeping it under **/application** for ease of access during development.
the web-accessible space at all, while keeping it under **/app** for ease of access during development.

Creating Configuration Files
============================

If you need to create a new configuration file you would create a new file at your desired location,
**/application/Config** by default. Then create the class and fill it with public properties that
**/app/Config** by default. Then create the class and fill it with public properties that
represent your settings::

namespace Config;
namespace Config;
use CodeIgniter\Config\BaseConfig;

class App extends BaseConfig
Expand Down Expand Up @@ -96,7 +96,7 @@ the environment. This will work in any environment. These variables are then ava
$s3_bucket = $_ENV['S3_BUCKET'];
$s3_bucket = $_SERVER['S3_BUCKET'];

.. note:: If you are using Apache, then the CI_ENVIRONMENT can be set at the top of
.. note:: If you are using Apache, then the CI_ENVIRONMENT can be set at the top of
``public/.htaccess``, which comes with a commented line to do that. Change the
environment setting to the one you want to use, and uncomment that line.

Expand Down
14 changes: 7 additions & 7 deletions user_guide_src/source/general/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ in your :doc:`controller </incoming/controllers>` and
:doc:`views </outgoing/views>`.

Helpers are typically stored in your **system/Helpers**, or
**application/Helpers directory**. CodeIgniter will look first in your
**application/Helpers directory**. If the directory does not exist or the
**app/Helpers directory**. CodeIgniter will look first in your
**app/Helpers directory**. If the directory does not exist or the
specified helper is not located there CI will instead look in your
global *system/Helpers/* directory.

Expand Down Expand Up @@ -64,7 +64,7 @@ it.
Loading from Non-standard Locations
-----------------------------------

Helpers can be loaded from directories outside of **application/Helpers** and
Helpers can be loaded from directories outside of **app/Helpers** and
**system/Helpers**, as long as that path can be found through a namespace that
has been setup within the PSR-4 section of the :doc:`Autoloader config file <../concepts/autoloader>`.
You would prefix the name of the Helper with the namespace that it can be located
Expand Down Expand Up @@ -100,7 +100,7 @@ URI to the controller/method you wish to link to.
"Extending" Helpers
===================

To "extend" Helpers, create a file in your **application/Helpers/** folder
To "extend" Helpers, create a file in your **app/Helpers/** folder
with an identical name to the existing Helper.

If all you need to do is add some functionality to an existing helper -
Expand All @@ -114,7 +114,7 @@ your version. In this case it's better to simply "extend" the Helper.
add to or or to replace the functions a Helper provides.

For example, to extend the native **Array Helper** you'll create a file
named **application/Helpers/array_helper.php**, and add or override
named **app/Helpers/array_helper.php**, and add or override
functions::

// any_in_array() is not in the Array Helper, so it defines a new function
Expand All @@ -140,12 +140,12 @@ functions::
return array_pop($array);
}

The **helper()** method will scan through all PSR-4 namespaces defined in **application/Config/Autoload.php**
The **helper()** method will scan through all PSR-4 namespaces defined in **app/Config/Autoload.php**
and load in ALL matching helpers of the same name. This allows any module's helpers
to be loaded, as well as any helpers you've created specifically for this application. The load order
is as follows:

1. application/Helpers - Files loaded here are always loaded first.
1. app/Helpers - Files loaded here are always loaded first.
2. {namespace}/Helpers - All namespaces are looped through in the order they are defined.
3. system/Helpers - The base file is loaded last

Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/general/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Configuration
=============

You can modify which levels are actually logged, as well as assign different Loggers to handle different levels, within
the ``/application/Config/Logger.php`` configuration file.
the ``/app/Config/Logger.php`` configuration file.

The ``threshold`` value of the config file determines which levels are logged across your application. If any levels
are requested to be logged by the application, but the threshold doesn't allow them to log currently, they will be
Expand Down Expand Up @@ -142,8 +142,8 @@ You can use any other logger that you might like as long as it extends from eith
that you can easily drop in use for any PSR3-compatible logger, or create your own.

You must ensure that the third-party logger can be found by the system, by adding it to either
the ``/application/Config/Autoload.php`` configuration file, or through another autoloader,
like Composer. Next, you should modify ``/application/Config/Services.php`` to point the ``logger``
the ``/app/Config/Autoload.php`` configuration file, or through another autoloader,
like Composer. Next, you should modify ``/app/Config/Services.php`` to point the ``logger``
alias to your new class name.

Now, any call that is done through the ``log_message()`` function will use your library instead.
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/general/managing_apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Renaming the Application Directory
==================================

If you would like to rename your application directory you may do so
as long as you open **application/Config/Paths.php** file and set its name using
as long as you open **app/Config/Paths.php** file and set its name using
the ``$applicationDirectory`` variable::

$applicationDirectory = 'application';
Expand Down
8 changes: 4 additions & 4 deletions user_guide_src/source/general/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Namespaces

The core element of the modules functionality comes from the :doc:`PSR4-compatible autoloading </concepts/autoloader>`
that CodeIgniter uses. While any code can use the PSR4 autoloader and namespaces, the only way to take full advantage of
modules is to namespace your code and add it to **application/Config/Autoload.php**, in the ``psr4`` section.
modules is to namespace your code and add it to **app/Config/Autoload.php**, in the ``psr4`` section.

For example, let's say we want to keep a simple blog module that we can re-use between applications. We might create
folder with our company name, Acme, to store all of our modules within. We will put it right alongside our **application**
Expand All @@ -30,7 +30,7 @@ directory in the main project root::
/tests
/writable

Open **application/Config/Autoload.php** and add the **Acme** namespace to the ``psr4`` array property::
Open **app/Config/Autoload.php** and add the **Acme** namespace to the ``psr4`` array property::

public $psr4 = [
'Acme' => ROOTPATH.'acme'
Expand Down Expand Up @@ -74,7 +74,7 @@ file types, including:
- :doc:`Route files </incoming/routing>`
- :doc:`Services </concepts/services>`

This is configured in the file **application/Config/Modules.php**.
This is configured in the file **app/Config/Modules.php**.

The auto-discovery system works by scanning any psr4 namespaces that have been defined within **Config/Autoload.php**
for familiar directories/files.
Expand Down Expand Up @@ -116,7 +116,7 @@ the **Modules** config file, described above.
Controllers
===========

Controllers outside of the main **application/Controllers** directory cannot be automatically routed by URI detection,
Controllers outside of the main **app/Controllers** directory cannot be automatically routed by URI detection,
but must be specified within the Routes file itself::

// Routes.php
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/helpers/cookie_helper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following functions are available:
detailed description of its use, as this function acts very
similarly to ``IncomingRequest::getCookie()``, except it will also prepend
the ``$cookiePrefix`` that you might've set in your
*application/Config/App.php* file.
*app/Config/App.php* file.

.. php:function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]])

Expand Down
16 changes: 8 additions & 8 deletions user_guide_src/source/incoming/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ and put the following code in it::
namespace App\Controllers;
use CodeIgniter\Controller;

class Blog extends Controller
class Blog extends Controller
{
public function index()
{
echo 'Hello World!';
}
}

Then save the file to your **/application/Controllers/** directory.
Then save the file to your **/app/Controllers/** directory.

.. important:: The file must be called 'Blog.php', with a capital 'B'.

Expand Down Expand Up @@ -91,7 +91,7 @@ Let's try it. Add a new method to your controller::
namespace App\Controllers;
use CodeIgniter\Controller;

class Blog extends Controller
class Blog extends Controller
{

public function index()
Expand Down Expand Up @@ -126,7 +126,7 @@ Your method will be passed URI segments 3 and 4 ("sandals" and "123")::
namespace App\Controllers;
use CodeIgniter\Controller;

class Products extends Controller
class Products extends Controller
{

public function shoes($sandals, $id)
Expand All @@ -145,7 +145,7 @@ Defining a Default Controller

CodeIgniter can be told to load a default controller when a URI is not
present, as will be the case when only your site root URL is requested.
To specify a default controller, open your **application/Config/Routes.php**
To specify a default controller, open your **app/Config/Routes.php**
file and set this variable::

$routes->setDefaultController('Blog');
Expand Down Expand Up @@ -228,7 +228,7 @@ If you are building a large application you might want to hierarchically
organize or structure your controllers into sub-directories. CodeIgniter
permits you to do this.

Simply create sub-directories under the main *application/Controllers/*
Simply create sub-directories under the main *app/Controllers/*
one and place your controller classes within them.

.. note:: When using this feature the first segment of your URI must
Expand All @@ -244,7 +244,7 @@ one and place your controller classes within them.
Each of your sub-directories may contain a default controller which will be
called if the URL contains *only* the sub-directory. Simply put a controller
in there that matches the name of your 'default_controller' as specified in
your *application/Config/Routes.php* file.
your *app/Config/Routes.php* file.

CodeIgniter also permits you to remap your URIs using its :doc:`URI Routing <routing>` feature.

Expand Down Expand Up @@ -301,7 +301,7 @@ inside the controller::
namespace App\Controllers;
use CodeIgniter\Controller;

class MyController extends Controller
class MyController extends Controller
{
protected $helpers = ['url', 'form'];
}
Expand Down
10 changes: 5 additions & 5 deletions user_guide_src/source/incoming/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ and power. Some common examples of tasks that might be performed with filters ar
Creating a Filter
*****************

Filters are simple classes that implement ``CodeIgniter\Filters\FilterInterface``.
They contain two methods: ``before()`` and ``after()`` which hold the code that
will run before and after the controller respectively. Your class must contain both methods
Filters are simple classes that implement ``CodeIgniter\Filters\FilterInterface``.
They contain two methods: ``before()`` and ``after()`` which hold the code that
will run before and after the controller respectively. Your class must contain both methods
but may leave the methods empty if they are not needed. A skeleton filter class looks like::

<?php namespace App\Filters;
Expand Down Expand Up @@ -69,7 +69,7 @@ This is typically used to peform redirects, like in this example::
}

If a Response instance is returned, the Response will be sent back to the client and script execution will stop.
This can be useful for implementing rate limiting for API's. See **application/Filters/Throttle.php** for an
This can be useful for implementing rate limiting for API's. See **app/Filters/Throttle.php** for an
example.

After Filters
Expand All @@ -84,7 +84,7 @@ the final output, or even to filter the final output with a bad words filter.
Configuring Filters
===================

Once you've created your filters, you need to configure when they get run. This is done in ``application/Config/Filters.php``.
Once you've created your filters, you need to configure when they get run. This is done in ``app/Config/Filters.php``.
This file contains four properties that allow you to configure exactly when the filters run.

$aliases
Expand Down
Loading