PageRenderTime 24ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/public/plugin/ckfinder/config.php

https://gitlab.com/vietdhtn/myweb
PHP | 175 lines | 89 code | 42 blank | 44 comment | 0 complexity | 49253f6c70f97487537980c377c722db MD5 | raw file
  1. <?php
  2. /*
  3. * CKFinder Configuration File
  4. *
  5. * For the official documentation visit http://docs.cksource.com/ckfinder3-php/
  6. */
  7. /*============================ PHP Error Reporting ====================================*/
  8. // http://docs.cksource.com/ckfinder3-php/debugging.html
  9. // Production
  10. error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
  11. ini_set('display_errors', 0);
  12. // Development
  13. // error_reporting(E_ALL);
  14. // ini_set('display_errors', 1);
  15. /*============================ General Settings =======================================*/
  16. // http://docs.cksource.com/ckfinder3-php/configuration.html
  17. $config = array();
  18. /*============================ Enable PHP Connector HERE ==============================*/
  19. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_authentication
  20. $config['authentication'] = function () {
  21. return true;
  22. };
  23. /*============================ License Key ============================================*/
  24. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_licenseKey
  25. $config['licenseName'] = '';
  26. $config['licenseKey'] = '';
  27. /*============================ CKFinder Internal Directory ============================*/
  28. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_privateDir
  29. $config['privateDir'] = array(
  30. 'backend' => 'default',
  31. 'tags' => '.ckfinder/tags',
  32. 'logs' => '.ckfinder/logs',
  33. 'cache' => '.ckfinder/cache',
  34. 'thumbs' => '.ckfinder/cache/thumbs',
  35. );
  36. /*============================ Images and Thumbnails ==================================*/
  37. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_images
  38. $config['images'] = array(
  39. 'maxWidth' => 1600,
  40. 'maxHeight' => 1200,
  41. 'quality' => 80,
  42. 'sizes' => array(
  43. 'small' => array('width' => 480, 'height' => 320, 'quality' => 80),
  44. 'medium' => array('width' => 600, 'height' => 480, 'quality' => 80),
  45. 'large' => array('width' => 800, 'height' => 600, 'quality' => 80)
  46. )
  47. );
  48. /*=================================== Backends ========================================*/
  49. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_backends
  50. $config['backends'][] = array(
  51. 'name' => 'default',
  52. 'adapter' => 'local',
  53. 'baseUrl' => 'http://localhost/demo/public/uploads/',
  54. // 'root' => '', // Can be used to explicitly set the CKFinder user files directory.
  55. 'chmodFiles' => 0777,
  56. 'chmodFolders' => 0755,
  57. 'filesystemEncoding' => 'UTF-8',
  58. );
  59. /*================================ Resource Types =====================================*/
  60. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_resourceTypes
  61. $config['defaultResourceTypes'] = '';
  62. $config['resourceTypes'][] = array(
  63. 'name' => 'Files', // Single quotes not allowed.
  64. 'directory' => 'files',
  65. 'maxSize' => 0,
  66. 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
  67. 'deniedExtensions' => '',
  68. 'backend' => 'default'
  69. );
  70. $config['resourceTypes'][] = array(
  71. 'name' => 'Images',
  72. 'directory' => 'images',
  73. 'maxSize' => 0,
  74. 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
  75. 'deniedExtensions' => '',
  76. 'backend' => 'default'
  77. );
  78. /*================================ Access Control =====================================*/
  79. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_roleSessionVar
  80. $config['roleSessionVar'] = 'CKFinder_UserRole';
  81. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_accessControl
  82. $config['accessControl'][] = array(
  83. 'role' => '*',
  84. 'resourceType' => '*',
  85. 'folder' => '/',
  86. 'FOLDER_VIEW' => true,
  87. 'FOLDER_CREATE' => true,
  88. 'FOLDER_RENAME' => true,
  89. 'FOLDER_DELETE' => true,
  90. 'FILE_VIEW' => true,
  91. 'FILE_CREATE' => true,
  92. 'FILE_RENAME' => true,
  93. 'FILE_DELETE' => true,
  94. 'IMAGE_RESIZE' => true,
  95. 'IMAGE_RESIZE_CUSTOM' => true
  96. );
  97. /*================================ Other Settings =====================================*/
  98. // http://docs.cksource.com/ckfinder3-php/configuration.html
  99. $config['overwriteOnUpload'] = false;
  100. $config['checkDoubleExtension'] = true;
  101. $config['disallowUnsafeCharacters'] = false;
  102. $config['secureImageUploads'] = true;
  103. $config['checkSizeAfterScaling'] = true;
  104. $config['htmlExtensions'] = array('html', 'htm', 'xml', 'js');
  105. $config['hideFolders'] = array('.*', 'CVS', '__thumbs');
  106. $config['hideFiles'] = array('.*');
  107. $config['forceAscii'] = false;
  108. $config['xSendfile'] = false;
  109. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_debug
  110. $config['debug'] = false;
  111. /*==================================== Plugins ========================================*/
  112. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_plugins
  113. $config['pluginsDirectory'] = __DIR__ . '/plugins';
  114. $config['plugins'] = array();
  115. /*================================ Cache settings =====================================*/
  116. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_cache
  117. $config['cache'] = array(
  118. 'imagePreview' => 24 * 3600,
  119. 'thumbnails' => 24 * 3600 * 365,
  120. 'proxyCommand' => 0
  121. );
  122. /*============================ Temp Directory settings ================================*/
  123. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_tempDirectory
  124. $config['tempDirectory'] = sys_get_temp_dir();
  125. /*============================ Session Cause Performance Issues =======================*/
  126. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_sessionWriteClose
  127. $config['sessionWriteClose'] = true;
  128. /*================================= CSRF protection ===================================*/
  129. // http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_csrfProtection
  130. $config['csrfProtection'] = true;
  131. /*============================== End of Configuration =================================*/
  132. // Config must be returned - do not change it.
  133. return $config;