Directory creation for the new asset cache. Increasing version to 1.3.2 as a result. Closes #436
This commit is contained in:
parent
8e51e58b12
commit
2fc773b5c5
7 changed files with 40 additions and 5 deletions
|
@ -69,6 +69,9 @@ echo ""
|
||||||
mkdir /var/www/openphoto/src/userdata
|
mkdir /var/www/openphoto/src/userdata
|
||||||
chown www-data:www-data /var/www/openphoto/src/userdata
|
chown www-data:www-data /var/www/openphoto/src/userdata
|
||||||
|
|
||||||
|
mkdir /var/www/openphoto/src/html/assets/cache
|
||||||
|
chown www-data:www-data /var/www/openphoto/src/html/assets/cache
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo "===================================================="
|
echo "===================================================="
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[defaults]
|
[defaults]
|
||||||
theme=beisel
|
theme=beisel
|
||||||
lastCodeVersion=0.0.0
|
lastCodeVersion=0.0.0
|
||||||
currentCodeVersion=1.3.1
|
currentCodeVersion=1.3.2
|
||||||
|
|
||||||
[site]
|
[site]
|
||||||
mode=prod
|
mode=prod
|
||||||
|
|
13
src/configs/upgrade/base/base-1.3.2.php
Normal file
13
src/configs/upgrade/base/base-1.3.2.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
$assetsPath = sprintf('%s/assets', getConfig()->get('paths')->docroot);
|
||||||
|
$cachePath = sprintf('%s/cache', $assetsPath);
|
||||||
|
|
||||||
|
if(!is_dir($cachePath) && is_writable($assetsPath))
|
||||||
|
@mkdir($cachePath, 0700);
|
||||||
|
|
||||||
|
if(!is_dir($cachePath))
|
||||||
|
{
|
||||||
|
getLogger()->crit(sprintf("Could not create directory: %s", $cachePath));
|
||||||
|
getRoute()->run('/error/500', EpiRoute::httpGet);
|
||||||
|
die();
|
||||||
|
}
|
5
src/configs/upgrade/readme/readme-1.3.2.php
Normal file
5
src/configs/upgrade/readme/readme-1.3.2.php
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Please execute the following commands before upgrading.
|
||||||
|
|
||||||
|
<pre>mkdir <?php printf('%s/assets/cache', getConfig()->get('paths')->docroot); ?>
|
||||||
|
|
||||||
|
chown <?php printf('%s:%s %s/assets/cache', exec('whoami'), exec('whoami'), getConfig()->get('paths')->docroot); ?> </pre>
|
|
@ -124,7 +124,7 @@
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
'<?php echo getAssetPipeline(true)->addJs('/assets/javascripts/openphoto-batch.min.js')->
|
'<?php echo getAssetPipeline(true)->addJs('/assets/javascripts/openphoto-batch.min.js')->
|
||||||
addJs($this->theme->asset('javascript', 'openphoto-theme-full-min.js', false))->
|
addJs($this->theme->asset('javascript', 'openphoto-theme-full-min.js', false))->
|
||||||
getUrl(AssetPipeline::js, 'b'); ?>'
|
getUrl(AssetPipeline::js, 'c'); ?>'
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
],
|
],
|
||||||
onComplete: function(){
|
onComplete: function(){
|
||||||
|
|
|
@ -678,8 +678,9 @@ class SetupController extends BaseController
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$configDir = $this->utility->getBaseDir() . '/userdata';
|
$configDir = $this->utility->getBaseDir() . '/userdata';
|
||||||
$generatedDir = "{$configDir}/configs";
|
$generatedDir = "{$configDir}/configs";
|
||||||
|
$assetsDir = $this->utility->getBaseDir() . '/html/assets/cache';
|
||||||
|
|
||||||
if(file_exists($generatedDir) && is_writable($generatedDir) && !empty($imageLibs))
|
if(file_exists($generatedDir) && is_writable($generatedDir) && file_exists($assetsDir) && is_writable($assetsDir) && !empty($imageLibs))
|
||||||
# No errors, return empty array
|
# No errors, return empty array
|
||||||
return $errors;
|
return $errors;
|
||||||
|
|
||||||
|
@ -692,7 +693,7 @@ class SetupController extends BaseController
|
||||||
|
|
||||||
if(!file_exists($generatedDir))
|
if(!file_exists($generatedDir))
|
||||||
{
|
{
|
||||||
$createDir = mkdir($generatedDir, 0700);
|
$createDir = @mkdir($generatedDir, 0700);
|
||||||
if(!$createDir)
|
if(!$createDir)
|
||||||
$errors[] = "Could not create configuration directory.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$generatedDir}</em>.</li></ul>";
|
$errors[] = "Could not create configuration directory.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$generatedDir}</em>.</li></ul>";
|
||||||
}
|
}
|
||||||
|
@ -701,6 +702,18 @@ class SetupController extends BaseController
|
||||||
$errors[] = "Directory exist but is not writable.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$generatedDir}</em>.</li></ul>";
|
$errors[] = "Directory exist but is not writable.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$generatedDir}</em>.</li></ul>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!file_exists($assetsDir))
|
||||||
|
{
|
||||||
|
$createDir = @mkdir($assetsDir, 0700);
|
||||||
|
if(!$createDir)
|
||||||
|
$errors[] = "Could not create assets cache directory.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$assetsDir}</em>.</li></ul>";
|
||||||
|
}
|
||||||
|
elseif(!is_writable($assetsDir))
|
||||||
|
{
|
||||||
|
$errors[] = "Directory exist but is not writable.<ul><li>Make sure the user <em>{$user}</em> can write to <em>{$assetsDir}</em>.</li></ul>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(empty($imageLibs))
|
if(empty($imageLibs))
|
||||||
$errors[] = 'No suitable image library exists.<ul><li>Make sure that one of the following are installed: <em><a href="http://php.net/imagick">Imagick</a></em>, <em><a href="http://php.net/gmagick">Gmagick</a></em>, or <em><a href="http://php.net/gd">GD</a></em>.</li></ul>';
|
$errors[] = 'No suitable image library exists.<ul><li>Make sure that one of the following are installed: <em><a href="http://php.net/imagick">Imagick</a></em>, <em><a href="http://php.net/gmagick">Gmagick</a></em>, or <em><a href="http://php.net/gd">GD</a></em>.</li></ul>';
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,8 @@ class User extends BaseModel
|
||||||
*/
|
*/
|
||||||
private function update($params)
|
private function update($params)
|
||||||
{
|
{
|
||||||
$params = array_merge($this->getDefaultAttributes(), $params);
|
$user = $this->getUserRecord();
|
||||||
|
$params = array_merge($this->getDefaultAttributes(), $user, $params);
|
||||||
return $this->db->postUser($params);
|
return $this->db->postUser($params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue