aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/template.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-10-06 12:38:59 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-10-17 12:22:26 +0200
commit93b0f1a3bff98f3b9aa9f2e0ca2db4bc23ca3746 (patch)
tree69c18c9a69eec1f74fdf4755886ecb7b95e88cdb /lib/private/template.php
parent688a141586dad961b24b364e79cd11c1aa343730 (diff)
downloadnextcloud-server-93b0f1a3bff98f3b9aa9f2e0ca2db4bc23ca3746.tar.gz
nextcloud-server-93b0f1a3bff98f3b9aa9f2e0ca2db4bc23ca3746.zip
adding cssmin and jssmin(minify)
adding argument deleteSelf to rmdirr() - if false the directory itself will not be deleted only it's content adding repair step to clean the asset cache after upgrade + coding style adjustments
Diffstat (limited to 'lib/private/template.php')
-rw-r--r--lib/private/template.php34
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/private/template.php b/lib/private/template.php
index fce26117ede..fe0cde53ff1 100644
--- a/lib/private/template.php
+++ b/lib/private/template.php
@@ -198,8 +198,8 @@ class OC_Template extends \OC\Template\Base {
* Includes another template. use <?php echo $this->inc('template'); ?> to
* do this.
*/
- public function inc( $file, $additionalparams = null ) {
- return $this->load($this->path.$file.'.php', $additionalparams);
+ public function inc( $file, $additionalParams = null ) {
+ return $this->load($this->path.$file.'.php', $additionalParams);
}
/**
@@ -277,4 +277,34 @@ class OC_Template extends \OC\Template\Base {
$content->printPage();
die();
}
+
+ /**
+ * @return bool
+ */
+ public static function isAssetPipelineEnabled() {
+ // asset management enabled?
+ $useAssetPipeline = \OC::$server->getConfig()->getSystemValue('asset-pipeline.enabled', false);
+ if (!$useAssetPipeline) {
+ return false;
+ }
+
+ // assets folder exists?
+ $assetDir = \OC::$SERVERROOT . '/assets';
+ if (!is_dir($assetDir)) {
+ if (!mkdir($assetDir)) {
+ \OCP\Util::writeLog('assets',
+ "Folder <$assetDir> does not exist and/or could not be generated.", \OCP\Util::ERROR);
+ return false;
+ }
+ }
+
+ // assets folder can be accessed?
+ if (!touch($assetDir."/.oc")) {
+ \OCP\Util::writeLog('assets',
+ "Folder <$assetDir> could not be accessed.", \OCP\Util::ERROR);
+ return false;
+ }
+ return $useAssetPipeline;
+ }
+
}