コード例 #1
0
ファイル: plugin_service.php プロジェクト: ZyXelP/oxwall
 /**
  * Creates platform reserved dirs for plugin, copies all plugin static data
  * 
  * @param BOL_Plugin $pluginDto
  */
 public function addPluginDirs(BOL_Plugin $pluginDto)
 {
     $plugin = new OW_Plugin($pluginDto);
     if (file_exists($plugin->getStaticDir())) {
         UTIL_File::copyDir($plugin->getStaticDir(), $plugin->getPublicStaticDir());
         UTIL_File::chmodDir($plugin->getPublicStaticDir(), 0777, 0666);
     }
     // create dir in pluginfiles
     if (file_exists($plugin->getInnerPluginFilesDir())) {
         UTIL_File::copyDir($plugin->getInnerPluginFilesDir(), $plugin->getPluginFilesDir());
         UTIL_File::chmodDir($plugin->getPluginFilesDir(), 0777, 0666);
     } else {
         if (!file_exists($plugin->getPluginFilesDir())) {
             mkdir($plugin->getPluginFilesDir());
             chmod($plugin->getPluginFilesDir(), 0777);
         }
     }
     // create dir in userfiles
     if (file_exists($plugin->getInnerUserFilesDir())) {
         OW::getStorage()->copyDir($plugin->getInnerUserFilesDir(), $plugin->getUserFilesDir());
         UTIL_File::chmodDir($plugin->getUserFilesDir(), 0777, 0666);
     } else {
         if (!file_exists($plugin->getUserFilesDir())) {
             OW::getStorage()->mkdir($plugin->getUserFilesDir());
         }
     }
 }