CAssetManager

NameassetManager
ClassCAssetManager
Location/home/vhosts/app-manager.eu5.org/framework/web/CAssetManager.php
CAssetManager is a Web application component that manages private files (called assets) and makes them accessible by Web clients.

It achieves this goal by copying assets to a Web-accessible directory and returns the corresponding URL for accessing them. To publish an asset, simply call {@link publish()}. The Web-accessible directory holding the published files is specified by {@link setBasePath basePath}, which defaults to the "assets" directory under the directory containing the application entry script file. The property {@link setBaseUrl baseUrl} refers to the URL for accessing the {@link setBasePath basePath}.

Options

Displaying 1-8 of 8 results.
NameValueDescriptionType
linkAssetsfalseWhether to use symbolic link to publish asset files. Defaults to false, meaning asset files are copied to public folders. Using symbolic links has the benefit that the published assets will always be consistent with the source assets. This is especially useful during development. However, there are special requirements for hosting environments in order to use symbolic links. In particular, symbolic links are supported only on Linux/Unix, and Windows Vista/2008 or greater. The latter requires PHP 5.3 or greater. Moreover, some Web servers need to be properly configured so that the linked assets are accessible to Web users. For example, for Apache Web server, the following configuration directive should be added for the Web folder: <pre> Options FollowSymLinks </pre> @since 1.1.5boolean
excludeFilesarray ( '.svn', '.gitignore', )List of directories and files which should be excluded from the publishing process. Defaults to exclude '.svn' and '.gitignore' files only. This option has no effect if {@link linkAssets} is enabled. @since 1.1.6 */array
newFileMode438The permission to be set for newly generated asset files. This value will be used by PHP chmod function. Defaults to 0666, meaning the file is read-writable by all users. @since 1.1.8integer
newDirMode511The permission to be set for newly generated asset directories. This value will be used by PHP chmod function. Defaults to 0777, meaning the directory can be read, written and executed by all users. @since 1.1.8integer
forceCopytrueWhether we should copy the asset files and directories even if they already published before. This property is used only during development stage. The main use case of this property is when you need to force the original assets always copied by changing only one value without searching needed {@link publish} method calls across the application codebase. Also it is useful in operating systems which does not fully support symbolic links (therefore it is not possible to use {@link $linkAssets}) or we don't want to use them. This property sets the default value of the $forceCopy parameter in {@link publish} method. Default value of this property is false meaning that the assets will be published only in case they don't exist in webroot assets directory. @since 1.1.11boolean
behaviorsarray()The behaviors that should be attached to this component. The behaviors will be attached to the component when {@link init} is called. Please refer to {@link CModel::behaviors} on how to specify the value of this property.array
basePathnullSets the root directory storing published asset files. the root directory storing published asset files @throws CException if the base path is invalidstring
baseUrlnullThe base url that the published asset files can be accessedstring
Free Web Hosting