CodeIgniter Forums
Automatic assignment of 0777 access permissions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Addins (https://forum.codeigniter.com/forumdisplay.php?fid=34)
+--- Thread: Automatic assignment of 0777 access permissions (/showthread.php?tid=73526)



Automatic assignment of 0777 access permissions - Basic App - 05-04-2019

You can use the module installer from the Yii framework to copy files and set access permissions to files and directories. It is well suited for this task, for it is an independent package that does not require the Yii framework, nor any other libraries.

Example of composer.json configuration:

PHP Code:
"require": {
 
   "yiisoft/yii2-composer""^2.0" 
}, 
"scripts": {
 
   "post-create-project-cmd": [
 
       "yii\\composer\\Installer::postCreateProject"
 
   ]
}, 
"extra": {
 
   "yii\\composer\\Installer::postCreateProject": {
 
       "copyFiles": [
 
           {
 
              "environment/.env"".env" 
 
           }
 
       ], 
 
       "setPermission": [
 
           {
 
               "writable/cache""0777",
 
               "writable/debugbar""0777",
 
               "writable/logs""0777",
 
               "writable/session""0777",
 
               "writable/uploads""0777"
 
           }
 
       ]
 
   }


Read more


RE: Automatic assignment of 0777 access permissions - skunkbad - 05-05-2019

I think 0755 is more appropriate.


RE: Automatic assignment of 0777 access permissions - InsiteFX - 05-06-2019

Most hosting will set the root to html or public_html to 0755

Also not sure is the composer will cause an error but all permission must be
in octal format not strings. Strings will throw an error.