66 function read_file( $Files , $Path , $File , $Mask =
'/.+/' , $Recursive =
true )
70 if( $File !=
"." && $File !=
".." && $File !=
'index.html' )
72 $FullPath = $Path.$File;
74 if( $Recursive && is_dir( $FullPath ) )
81 elseif( preg_match( $Mask , $FullPath ) )
83 $Files [] = $FullPath;
129 $Path = rtrim( $Path ,
'/' ).
'/';
131 $Handle = @opendir( $Path );
134 if( $Handle !==
false )
136 for( ;
false !== ( $File = readdir( $Handle ) ) ; )
138 $Files = $this->
read_file( $Files , $Path , $File , $Mask , $Recursive );
146 catch( Exception $e )
180 $Text =
get_package(
'string::text' ,
'last' , __FILE__ );
181 $Files = $Text->trim_common_prefix( $Files );
183 $Zip =
new ZipArchive;
184 $Zip->open(
"$ArchivePath" , ZIPARCHIVE::CREATE );
185 foreach( $Files as $i => $File )
187 $Zip->addFile(
"$Directory/$File" , $File );
191 catch( Exception $e )
229 foreach( $Params as $k => $v )
231 if(
in_array( $k , $Exceptions ) ===
false )
237 return( implode(
'&' , $Tmp ) );
239 catch( Exception $e )
279 $PackageName = $Settings->get_setting( $Prefix.
'package_name' );
281 $PackageVersion = $Settings->get_setting( $Prefix.
'package_version' ,
'last' );
283 return(
get_package( $PackageName , $PackageVersion , $File ) );
285 catch( Exception $e )
317 $PackageName = $Settings->get_setting(
'package_name' );
319 $PackageVersion = $Settings->get_setting(
'package_version' ,
'last' );
323 catch( Exception $e )
355 $Query = $this->Settings->get_setting(
'query' ,
false );
359 $Records = $this->Database->query( $Query );
360 return( $this->Database->fetch_results( $Records ) );
364 $Package = $this->
get_package( $Settings , __FILE__ );
365 $FunctionName = $Settings->get_setting(
'access_function_name' ,
'simple_select' );
366 if( method_exists( $Package , $FunctionName ) )
368 return( call_user_func( array( $Package , $FunctionName ) ) );
371 throw(
new Exception(
"Can't get records" ) );
373 catch( Exception $e )
405 $UserAgent = $_SERVER[
'HTTP_USER_AGENT'];
407 if( stristr( $UserAgent ,
'Firefox' ) !==
false )
411 elseif( stristr( $UserAgent ,
'Chrome' ) !==
false )
415 elseif( stristr( $UserAgent ,
'Safari' ) !==
false )
419 elseif( stristr( $UserAgent ,
'Opera' ) !==
false )
426 catch( Exception $e )