From aed146f606b9892471ebb4fac9aa91b3835e9b02 Mon Sep 17 00:00:00 2001 From: fvromera <32909196+fvromera@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:05:32 +0200 Subject: [PATCH 1/5] Update loader.md --- en/loader.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/loader.md b/en/loader.md index 0c9f69f4f404..eab65334cbf6 100644 --- a/en/loader.md +++ b/en/loader.md @@ -206,7 +206,7 @@ If you need to check what classes are registered in the autoloader, you can use ``` ## Classes -Another way to let [Phalcon\Loader][loader] know where your classes are components/classes are located, so that the autoloader can load them properly, is by using `registerClasses()`. +Another way to let [Phalcon\Loader][loader] know where your components/classes are located, so that the autoloader can load them properly, is by using `registerClasses()`. The method accepts an array, where the key is the namespaced class and the value is the location of the file that contains the class. As expected, this is the fastest way to autoload a class, since the autoloader does not need to do file scans or stats to find the files references. @@ -262,7 +262,7 @@ $loader->registerClasses( $loader->register(); ``` -The above example merges the second declaration of `registerNamespaces()` with the previous one. +The above example merges the second declaration of `registerClasses()` with the previous one. If you need to check what classes are registered in the autoloader, you can use the `getClasses()` getter, which returns the array of the registered classes. For the example above, `getClasses()` returns: From 2092cc6bfaae408a04203923e01d452ace5456dc Mon Sep 17 00:00:00 2001 From: fvromera <32909196+fvromera@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:13:19 +0200 Subject: [PATCH 2/5] Update loader.md --- en/loader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/loader.md b/en/loader.md index eab65334cbf6..8d657b97552d 100644 --- a/en/loader.md +++ b/en/loader.md @@ -298,7 +298,7 @@ $loader->registerFiles( $loader->register(); ``` -These files are automatically loaded when the `register()` method is called.. +These files are automatically loaded when the `register()` method is called. The `registerFiles()` method also accepts a second parameter `merge`. By default it is `false`. You can however set it to `true` when having multiple calls to `registerFiles()` so that the file definitions are merged. From 73043b4b3dd823f2961c255545c0e346b73abe73 Mon Sep 17 00:00:00 2001 From: fvromera <32909196+fvromera@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:49:19 +0200 Subject: [PATCH 3/5] Update loader.md --- en/loader.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/loader.md b/en/loader.md index 8d657b97552d..b35882708d84 100644 --- a/en/loader.md +++ b/en/loader.md @@ -195,7 +195,7 @@ $loader->register(); The above example merges the second declaration of `registerNamespaces()` with the previous one. -If you need to check what classes are registered in the autoloader, you can use the `getNamespaces()` getter, which returns the array of the registered namespaces. For the example above, `getNamespaces()` returns: +If you need to check what namespaces are registered in the autoloader, you can use the `getNamespaces()` getter, which returns the array of the registered namespaces. For the example above, `getNamespaces()` returns: ```php [ @@ -327,7 +327,7 @@ $loader->register(); The above example merges the second declaration of `registerFiles()` with the previous one. -If you need to check what classes are registered in the autoloader, you can use the `getFiles()` getter, which returns the array of the registered files. For the example above, `getFiles()` returns: +If you need to check what files are registered in the autoloader, you can use the `getFiles()` getter, which returns the array of the registered files. For the example above, `getFiles()` returns: ```php [ @@ -391,7 +391,7 @@ $loader->register(); The above example merges the second declaration of `registerDirs()` with the previous one. -If you need to check what classes are registered in the autoloader, you can use the `getDirs()` getter, which returns the array of the registered classes. For the example above, `getDirs()` returns: +If you need to check what directories are registered in the autoloader, you can use the `getDirs()` getter, which returns the array of the registered classes. For the example above, `getDirs()` returns: ```php [ From 079533b4ebd4d0685caf4ac4af228d408e702f9f Mon Sep 17 00:00:00 2001 From: fvromera <32909196+fvromera@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:50:49 +0200 Subject: [PATCH 4/5] Update loader.md --- en/loader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/loader.md b/en/loader.md index b35882708d84..4c93c235191e 100644 --- a/en/loader.md +++ b/en/loader.md @@ -391,7 +391,7 @@ $loader->register(); The above example merges the second declaration of `registerDirs()` with the previous one. -If you need to check what directories are registered in the autoloader, you can use the `getDirs()` getter, which returns the array of the registered classes. For the example above, `getDirs()` returns: +If you need to check what directories are registered in the autoloader, you can use the `getDirs()` getter, which returns the array of the registered directories. For the example above, `getDirs()` returns: ```php [ From 823528e2e75ed44e5dc5798f823ebb9e9f1a5273 Mon Sep 17 00:00:00 2001 From: fvromera <32909196+fvromera@users.noreply.github.com> Date: Fri, 23 Apr 2021 09:09:44 +0200 Subject: [PATCH 5/5] Update loader.md --- en/loader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/loader.md b/en/loader.md index 4c93c235191e..ba4436e51f9c 100644 --- a/en/loader.md +++ b/en/loader.md @@ -482,7 +482,7 @@ The following events are available: | Event | Description | Can stop operation? | |--------------------|-----------------------------------------------------------------------------------------|---------------------| -| `afterCheckClass` | Fires at the end of the end of the auto load process when the class has not been found. | No | +| `afterCheckClass` | Fires at the end of the auto load process when the class has not been found. | No | | `beforeCheckClass` | Fires at the beginning of the auto load process, before checking for the class. | Yes | | `beforeCheckPath` | Fires before checking a directory for a class file. | Yes | | `pathFound` | Fires when the loader locates a class file or a file in a registered directory | Yes |