• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic assignment of 0777 access permissions

#1
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

Basic App, an open source simple CMS based on CodeIgniter 4
Reply

#2
I think 0755 is more appropriate.
Reply

#3
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.