@@ -984,7 +984,7 @@ function retrieveSections($aSectionType, $gb_record_sections){
984
984
* it removes the header at the top of the file
985
985
*/
986
986
function removeHeader ($ aGbRecord ){
987
- $ gb_arr = split ("\n" , $ aGbRecord );
987
+ $ gb_arr = explode ("\n" , $ aGbRecord );
988
988
for ($ i =0 ;$ i <count ($ gb_arr );$ i ++){
989
989
preg_match ("/^LOCUS/ " , $ gb_arr [$ i ], $ matches );
990
990
if (count ($ matches )){
@@ -1005,7 +1005,7 @@ function removeHeader($aGbRecord){
1005
1005
*/
1006
1006
function parseGenbankRaw ($ gb_record ){
1007
1007
$ sections = array ();
1008
- $ gb_arr = split ("\n" , $ gb_record );
1008
+ $ gb_arr = explode ("\n" , $ gb_record );
1009
1009
$ aSection = "" ;
1010
1010
$ section_name = "" ;
1011
1011
$ record_counter = 0 ;
@@ -1063,9 +1063,13 @@ function getFtpFileList($ftp_uri, $path, $regex){
1063
1063
echo "Couldn't connect as $ ftp_user \n" ;
1064
1064
exit ;
1065
1065
}
1066
-
1066
+ ftp_pasv ( $ conn_id , TRUE );
1067
1067
// get contents of the current directory
1068
1068
$ contents = ftp_nlist ($ conn_id , $ path );
1069
+ if (FALSE === $ contents ) {
1070
+ echo "Unable to get contents for $ path " .PHP_EOL ;
1071
+ exit (-1 );
1072
+ }
1069
1073
foreach ($ contents as $ aFile ){
1070
1074
// $reg_exp = "/.*\/(.*".$extension.")/";
1071
1075
preg_match ($ regex , $ aFile , $ matches );
0 commit comments