sai
No long description provided.
Installation
dagger install github.com/sai-php/sai@1015f56a42daff8888159b0fee04dd214e7dafd6
Types
Composer 🔗
install() 🔗
Perform a composer install and return the result as a directory
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
composerJson | File ! | - | No description provided |
composerLock | File | null | No description provided |
Example
func (m *myModule) example(container *Container, composerVersion string, composerCacheName string, composerJson *File) *Directory {
return dag.
Sai().
AdoptPhpcontainer(container).
Composer(composerVersion, composerCacheName).
Install(composerJson)
}
NginxContainer 🔗
withAppCode() 🔗
Add application code to container
Return Type
NginxContainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
appCode | Directory ! | - | No description provided |
path | String ! | "\/app" | No description provided |
Example
func (m *myModule) example(version string, os string, appCode *Directory, path string) *SaiNginxContainer {
return dag.
Sai().
Nginx(version, os).
WithAppCode(appCode, path)
}
withConfigTemplate() 🔗
Add config template to the container
Return Type
NginxContainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
configTemplate | File ! | - | No description provided |
Example
func (m *myModule) example(version string, os string, configTemplate *File) *SaiNginxContainer {
return dag.
Sai().
Nginx(version, os).
WithConfigTemplate(configTemplate)
}
container() 🔗
Returns the built Nginx container
Return Type
Container !
Example
func (m *myModule) example(version string, os string) *Container {
return dag.
Sai().
Nginx(version, os).
Container()
}
Phpcontainer 🔗
withExtension() 🔗
Install a PHP extension into the container
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
extension | String ! | - | No description provided |
Example
func (m *myModule) example(container *Container, extension string) *SaiPhpcontainer {
return dag.
Sai().
AdoptPhpcontainer(container).
WithExtension(extension)
}
withComposer() 🔗
Install composer into the container, useful if you need a container with composer in it, but to run composer commands see the composer() function.
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
composerVersion | String ! | "2" | No description provided |
composerCacheName | String ! | "sai-composer-cache" | No description provided |
Example
func (m *myModule) example(container *Container, composerVersion string, composerCacheName string) *SaiPhpcontainer {
return dag.
Sai().
AdoptPhpcontainer(container).
WithComposer(composerVersion, composerCacheName)
}
composer() 🔗
Returns a composer object which can operate with your container
Return Type
Composer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
composerVersion | String ! | "2" | No description provided |
composerCacheName | String ! | "sai-composer-cache" | No description provided |
Example
func (m *myModule) example(container *Container, composerVersion string, composerCacheName string) *SaiComposer {
return dag.
Sai().
AdoptPhpcontainer(container).
Composer(composerVersion, composerCacheName)
}
withAppCode() 🔗
Add application code to container
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
appCode | Directory ! | - | No description provided |
path | String ! | "\/app" | No description provided |
Example
func (m *myModule) example(container *Container, appCode *Directory, path string) *SaiPhpcontainer {
return dag.
Sai().
AdoptPhpcontainer(container).
WithAppCode(appCode, path)
}
withComposerApp() 🔗
Adds application code which uses composer to manage dependencies. Requires a composer.json in the root of the directory. Will do an install of the dependencies using Composer.
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
appCode | Directory ! | - | No description provided |
path | String ! | "\/app" | No description provided |
composerVersion | String ! | "2" | No description provided |
composerCacheName | String ! | "sai-composer-cache" | No description provided |
Example
func (m *myModule) example(container *Container, appCode *Directory, path string, composerVersion string, composerCacheName string) *SaiPhpcontainer {
return dag.
Sai().
AdoptPhpcontainer(container).
WithComposerApp(appCode, path, composerVersion, composerCacheName)
}
container() 🔗
Returns the built PHP container
Return Type
Container !
Example
func (m *myModule) example(container *Container) *Container {
return dag.
Sai().
AdoptPhpcontainer(container).
Container()
}
Sai 🔗
php() 🔗
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | "8.3" | No description provided |
os | String ! | "alpine" | No description provided |
variant | String ! | "cli" | No description provided |
Example
func (m *myModule) example(version string, os string, variant string) *SaiPhpcontainer {
return dag.
Sai().
Php(version, os, variant)
}
adoptPhpcontainer() 🔗
Return Type
Phpcontainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | No description provided |
Example
func (m *myModule) example(container *Container) *SaiPhpcontainer {
return dag.
Sai().
AdoptPhpcontainer(container)
}
nginx() 🔗
Return Type
NginxContainer !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | "1.27" | No description provided |
os | String ! | "alpine" | No description provided |
variant | String | null | No description provided |
Example
func (m *myModule) example(version string, os string) *SaiNginxContainer {
return dag.
Sai().
Nginx(version, os)
}