2222namespace Pydio \Access \Driver \StreamProvider \SMB ;
2323
2424use DOMNode ;
25+ use PclZip ;
26+ use Pydio \Access \Core \MetaStreamWrapper ;
2527use Pydio \Access \Core \Model \AJXP_Node ;
28+ use Pydio \Access \Core \Model \UserSelection ;
2629use Pydio \Access \Core \RecycleBinManager ;
2730use Pydio \Access \Core \Model \Repository ;
2831use Pydio \Access \Driver \StreamProvider \FS \FsAccessDriver ;
2932use Pydio \Core \Model \ContextInterface ;
3033use Pydio \Core \Exception \PydioException ;
34+ use Pydio \Core \Services \ConfService ;
35+ use Pydio \Core \Utils \TextEncoder ;
36+ use Pydio \Core \Utils \Vars \InputFilter ;
37+ use Pydio \Tasks \Task ;
38+ use Pydio \Tasks \TaskService ;
3139
3240
3341defined ('AJXP_EXEC ' ) or die ( 'Access not allowed ' );
@@ -47,6 +55,16 @@ class SMBAccessDriver extends FsAccessDriver
4755 protected $ wrapperClassName ;
4856 protected $ urlBase ;
4957
58+ protected function loadExternalWrapper (){
59+ if (!empty ($ this ->pluginConf ['SMBCLIENT ' ]) && !defined ('SMB4PHP_SMBCLIENT ' )){
60+ define ('SMB4PHP_SMBCLIENT ' , $ this ->pluginConf ["SMBCLIENT " ]);
61+ }
62+ if (!empty ($ this ->pluginConf ['SMB_PATH_TMP ' ]) && !defined ('SMB_PATH_TMP ' )){
63+ define ('SMB4PHP_SMBTMP ' , $ this ->pluginConf ["SMB_PATH_TMP " ]);
64+ }
65+ require_once ($ this ->getBaseDir ()."/smb.php " );
66+ }
67+
5068 /**
5169 * @param ContextInterface $contextInterface
5270 * @throws PydioException
@@ -59,13 +77,7 @@ protected function initRepository(ContextInterface $contextInterface)
5977 } else {
6078 $ this ->driverConf = array ();
6179 }
62- $ smbclientPath = $ this ->driverConf ["SMBCLIENT " ];
63- define ('SMB4PHP_SMBCLIENT ' , $ smbclientPath );
64-
65- $ smbtmpPath = $ this ->driverConf ["SMB_PATH_TMP " ];
66- define ('SMB4PHP_SMBTMP ' , $ smbtmpPath );
67-
68- require_once ($ this ->getBaseDir ()."/smb.php " );
80+ $ this ->loadExternalWrapper ();
6981
7082 //$create = $this->repository->getOption("CREATE");
7183 $ recycle = $ this ->repository ->getContextOption ($ contextInterface , "RECYCLE_BIN " );
@@ -92,7 +104,7 @@ protected function initRepository(ContextInterface $contextInterface)
92104 public function detectStreamWrapper ($ register = false , ContextInterface $ ctx = null )
93105 {
94106 if ($ register ) {
95- require_once ( $ this ->getBaseDir (). " /smb.php " );
107+ $ this ->loadExternalWrapper ( );
96108 }
97109 return parent ::detectStreamWrapper ($ register , $ ctx );
98110 }
0 commit comments