Download the PHP package marsapp/system-helper without Composer
On this page you can find all versions of the php package marsapp/system-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download marsapp/system-helper
More information about marsapp/system-helper
Files in marsapp/system-helper
Download marsapp/system-helper
More information about marsapp/system-helper
Files in marsapp/system-helper
Vendor marsapp
Package system-helper
Short Description Helper for system operation.
License MIT
Homepage https://github.com/marshung24/system-helper
Package system-helper
Short Description Helper for system operation.
License MIT
Homepage https://github.com/marshung24/system-helper
Please rate this library. Is it a good library?
Informations about the package system-helper
System Helper
Helper for system operation.
1. Outline
- System Helper
- 1. Outline
- 2. Description
- 3. Installation
- 3.1. composer install
- 4. Dependency
- 5. Usage
- 5.1. Cookie
- 5.1.1. Setting
- 5.1.2. Cookie Default Option - Single
- 5.1.2.1. Description
- 5.1.2.2. Parameters
- 5.1.2.3. Return Values
- 5.1.2.4. Example
- 5.1.3. Set Cookie Default Option - Multiple
- 5.1.3.1. Description
- 5.1.3.2. Parameters
- 5.1.3.3. Return Values
- 5.1.3.4. Example
- 5.1.4. Set Cookie
- 5.1.4.1. Description
- 5.1.4.2. Parameters
- 5.1.4.3. Return Values
- 5.1.4.4. Example
- 5.1.5. Set Cookie on root domain
- 5.1.5.1. Description
- 5.1.6. Get Cookie
- 5.1.6.1. Description
- 5.1.7. Delete Cookie
- 5.1.7.1. Description
- 5.1.8. Delete Cookie on root domain
- 5.1.8.1. Description
- 6. Example
- 7. Contributing
2. Description
3. Installation
3.1. composer install
4. Dependency
- PHP7
5. Usage
5.1. Cookie
- library for Cookie operating
- Wrap the PHP native function/variable setcookie()/$_COOKIE to enrich the function and simplify the usage method.
- Extra features:
- Support Cookie prefix packaging
- Support default values: expires, path, domain, secure, httponly
- Dedicated function: Root domain access
5.1.1. Setting
- 使用前設定
5.1.2. Cookie Default Option - Single
5.1.2.1. Description
cookieOption(string $param, string $value = null) : string|null
5.1.2.2. Parameters
- $param : string
- The target parameter of the cookie default options.
- $value : string
- New data.
- When $param does not exist, return null
- When there is $param but no $value(null), get the current value of $param
- When there is $param and $value, after updating the data, the updated value will be returned
5.1.2.3. Return Values
string|null
5.1.2.4. Example
5.1.3. Set Cookie Default Option - Multiple
5.1.3.1. Description
cookieOptions(array $options = []) : array
5.1.3.2. Parameters
- $options : array
- batch update cookie default options.
5.1.3.3. Return Values
array, return complete cookie default options.
5.1.3.4. Example
5.1.4. Set Cookie
5.1.4.1. Description
cookieSet(string $name, string $value = "", array $options = []) : bool
Set Cookie, Wrap the PHP native function setcookie() to simplify usage.
5.1.4.2. Parameters
- $name : string
- The name of the cookie.
- $value : string
- The value of the cookie.
- $options : array
- 'prefix' => '', // Cookie前綴,預設無前綴
- 'expires' => time()+3600, // 過期時間,預設無期限
- 'path' => '/', // 存放路徑
- 'domain' => "", // 所屬網域
- 'secure' => true, // 是否只在https生效
- 'httponly' => false, // 是否只能通過HTTP協議訪問
5.1.4.3. Return Values
bool, like PHP function setcookie()
5.1.4.4. Example
- $options可用參數
- 'prefix' => '', // Cookie前綴,預設無前綴
- 'expires' => time()+3600, // 過期時間,預設無期限
- 'path' => '/', // 存放路徑
- 'domain' => "", // 所屬網域
- 'secure' => true, // 是否只在https生效
- 'httponly' => false, // 是否只能通過HTTP協議訪問
5.1.5. Set Cookie on root domain
5.1.5.1. Description
cookieSetRoot(string $name, string $value = "", array $options = []) : bool
Like
cookieSet()
, but domain fixed on root domain.
5.1.6. Get Cookie
5.1.6.1. Description
cookieGet(string $name) : mixed
取得目標Cookie值
5.1.7. Delete Cookie
5.1.7.1. Description
cookieExpired(string $name, array $options = []) : bool
Delete target cookie.
5.1.8. Delete Cookie on root domain
5.1.8.1. Description
cookieExpiredRoot(string $name, array $options = []) : bool
Like
cookieExpired()
, but domain fixed on root domain.
6. Example
see: example/example-cookie.php
7. Contributing
- 20210424: MarsHung Build repo & development
- 20210621: MarsHung Add function cookieOption(), cookieOptions(), COOKIE_DEFAULT_PREFIX
All versions of system-helper with dependencies
PHP Build Version
Package Version
Requires
php Version
^7
The package marsapp/system-helper contains the following files
Loading the files please wait ....