super-powers/src/a223b31e-ea1d-4cdf-92ae-5f9becffaff0/README.md

102 lines
3.6 KiB
Markdown
Raw Permalink Normal View History

2023-03-21 22:43:11 +00:00
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# abstract class FileHelper (Details)
2024-06-21 12:01:19 +00:00
> namespace: **VDM\Joomla\Utilities**
2024-07-16 12:12:10 +00:00
2023-03-21 22:43:11 +00:00
```uml
@startuml
abstract FileHelper #Orange {
# static $curlError
+ {static} zip(string $workingDirectory, string $filepath) : bool
2024-01-27 07:08:12 +00:00
+ {static} getContent(string $path, mixed $none = '') : string
2023-03-21 22:43:11 +00:00
+ {static} write(string $path, string $data) : bool
2024-01-27 07:08:12 +00:00
+ {static} getPaths(string $folder, array $fileTypes = array('\.php') : array|null
2023-03-21 22:43:11 +00:00
+ {static} getPath(string $type = 'path', string $target = 'filepath', ...) : string
+ {static} exists(string $path) : bool
}
note right of FileHelper::zip
The zipper method
since: 3.0.9
return: bool
end note
note right of FileHelper::getContent
get the content of a file
since: 3.0.9
return: string
end note
note right of FileHelper::write
Write a file to the server
since: 3.0.9
return: bool
end note
note right of FileHelper::getPaths
get all the file paths in folder and sub folders
since: 3.0.9
2024-01-27 07:08:12 +00:00
return: array|null
2023-03-21 22:43:11 +00:00
end note
note right of FileHelper::getPath
Get the file path or url
since: 3.0.9
return: string
arguments:
string $type = 'path'
string $target = 'filepath'
string $fileType = null
string $key = ''
string $default = ''
bool $createIfNotSet = true
end note
note right of FileHelper::exists
Check if file exist
since: 3.0.9
return: bool
end note
@enduml
```
2024-07-16 12:12:10 +00:00
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
To add this specific Power to your project in JCB:
> simply use this SPK
```
Super---a223b31e_ea1d_4cdf_92ae_5f9becffaff0---Power
```
> remember to replace the `---` with `___` to activate this Power in your code
2023-03-21 22:43:11 +00:00
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)