@@ -284,7 +284,7 @@ public function connect($attempts = 3) {
284
284
$ this ->disconnect ();
285
285
286
286
try {
287
- $ this ->connection = imap_open (
287
+ $ this ->connection = \ imap_open (
288
288
$ this ->getAddress (),
289
289
$ this ->username ,
290
290
$ this ->password ,
@@ -294,7 +294,7 @@ public function connect($attempts = 3) {
294
294
);
295
295
$ this ->connected = !!$ this ->connection ;
296
296
} catch (\ErrorException $ e ) {
297
- $ errors = imap_errors ();
297
+ $ errors = \ imap_errors ();
298
298
$ message = $ e ->getMessage ().'. ' .implode ("; " , (is_array ($ errors ) ? $ errors : array ()));
299
299
300
300
throw new ConnectionFailedException ($ message );
@@ -310,8 +310,8 @@ public function connect($attempts = 3) {
310
310
*/
311
311
public function disconnect () {
312
312
if ($ this ->isConnected () && $ this ->connection !== false && is_integer ($ this ->connection ) === false ) {
313
- $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
314
- $ this ->connected = !imap_close ($ this ->connection , IMAP ::CL_EXPUNGE );
313
+ $ this ->errors = array_merge ($ this ->errors , \ imap_errors () ?: []);
314
+ $ this ->connected = !\ imap_close ($ this ->connection , IMAP ::CL_EXPUNGE );
315
315
}
316
316
317
317
return $ this ;
@@ -361,7 +361,7 @@ public function getFolders($hierarchical = true, $parent_folder = null) {
361
361
362
362
$ pattern = $ parent_folder .($ hierarchical ? '% ' : '* ' );
363
363
364
- $ items = imap_getmailboxes ($ this ->connection , $ this ->getAddress (), $ pattern );
364
+ $ items = \ imap_getmailboxes ($ this ->connection , $ this ->getAddress (), $ pattern );
365
365
if (is_array ($ items )){
366
366
foreach ($ items as $ item ) {
367
367
$ folder = new Folder ($ this , $ item );
@@ -400,7 +400,7 @@ public function openFolder($folder_path, $attempts = 3) {
400
400
if ($ this ->active_folder !== $ folder_path ) {
401
401
$ this ->active_folder = $ folder_path ;
402
402
403
- imap_reopen ($ this ->getConnection (), $ folder_path , $ this ->getOptions (), $ attempts );
403
+ \ imap_reopen ($ this ->getConnection (), $ folder_path , $ this ->getOptions (), $ attempts );
404
404
}
405
405
}
406
406
@@ -414,7 +414,7 @@ public function openFolder($folder_path, $attempts = 3) {
414
414
*/
415
415
public function createFolder ($ name , $ expunge = true ) {
416
416
$ this ->checkConnection ();
417
- $ status = imap_createmailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ name ));
417
+ $ status = \ imap_createmailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ name ));
418
418
if ($ expunge ) $ this ->expunge ();
419
419
420
420
return $ status ;
@@ -431,7 +431,7 @@ public function createFolder($name, $expunge = true) {
431
431
*/
432
432
public function renameFolder ($ old_name , $ new_name , $ expunge = true ) {
433
433
$ this ->checkConnection ();
434
- $ status = imap_renamemailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ old_name ), $ this ->getAddress () . imap_utf7_encode ($ new_name ));
434
+ $ status = \ imap_renamemailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ old_name ), $ this ->getAddress () . \ imap_utf7_encode ($ new_name ));
435
435
if ($ expunge ) $ this ->expunge ();
436
436
437
437
return $ status ;
@@ -447,7 +447,7 @@ public function renameFolder($old_name, $new_name, $expunge = true) {
447
447
*/
448
448
public function deleteFolder ($ name , $ expunge = true ) {
449
449
$ this ->checkConnection ();
450
- $ status = imap_deletemailbox ($ this ->getConnection (), $ this ->getAddress () . imap_utf7_encode ($ name ));
450
+ $ status = \ imap_deletemailbox ($ this ->getConnection (), $ this ->getAddress () . \ imap_utf7_encode ($ name ));
451
451
if ($ expunge ) $ this ->expunge ();
452
452
453
453
return $ status ;
@@ -523,7 +523,7 @@ public function searchMessages(array $where, Folder $folder, $fetch_options = nu
523
523
}
524
524
525
525
/**
526
- * Get option for imap_open and imap_reopen.
526
+ * Get option for \ imap_open and \ imap_reopen.
527
527
* It supports only isReadOnly feature.
528
528
*
529
529
* @return int
@@ -561,7 +561,7 @@ protected function getAddress() {
561
561
*/
562
562
public function getQuota () {
563
563
$ this ->checkConnection ();
564
- return imap_get_quota ($ this ->getConnection (), 'user. ' .$ this ->username );
564
+ return \ imap_get_quota ($ this ->getConnection (), 'user. ' .$ this ->username );
565
565
}
566
566
567
567
/**
@@ -574,7 +574,7 @@ public function getQuota() {
574
574
*/
575
575
public function getQuotaRoot ($ quota_root = 'INBOX ' ) {
576
576
$ this ->checkConnection ();
577
- return imap_get_quotaroot ($ this ->getConnection (), $ quota_root );
577
+ return \ imap_get_quotaroot ($ this ->getConnection (), $ quota_root );
578
578
}
579
579
580
580
/**
@@ -585,7 +585,7 @@ public function getQuotaRoot($quota_root = 'INBOX') {
585
585
*/
586
586
public function countMessages () {
587
587
$ this ->checkConnection ();
588
- return imap_num_msg ($ this ->connection );
588
+ return \ imap_num_msg ($ this ->connection );
589
589
}
590
590
591
591
/**
@@ -596,7 +596,7 @@ public function countMessages() {
596
596
*/
597
597
public function countRecentMessages () {
598
598
$ this ->checkConnection ();
599
- return imap_num_recent ($ this ->connection );
599
+ return \ imap_num_recent ($ this ->connection );
600
600
}
601
601
602
602
/**
@@ -605,7 +605,7 @@ public function countRecentMessages() {
605
605
* @return array
606
606
*/
607
607
public function getAlerts () {
608
- return imap_alerts ();
608
+ return \ imap_alerts ();
609
609
}
610
610
611
611
/**
@@ -614,7 +614,7 @@ public function getAlerts() {
614
614
* @return array
615
615
*/
616
616
public function getErrors () {
617
- $ this ->errors = array_merge ($ this ->errors , imap_errors () ?: []);
617
+ $ this ->errors = array_merge ($ this ->errors , \ imap_errors () ?: []);
618
618
619
619
return $ this ->errors ;
620
620
}
@@ -625,7 +625,7 @@ public function getErrors() {
625
625
* @return string
626
626
*/
627
627
public function getLastError () {
628
- return imap_last_error ();
628
+ return \ imap_last_error ();
629
629
}
630
630
631
631
/**
@@ -636,7 +636,7 @@ public function getLastError() {
636
636
*/
637
637
public function expunge () {
638
638
$ this ->checkConnection ();
639
- return imap_expunge ($ this ->connection );
639
+ return \ imap_expunge ($ this ->connection );
640
640
}
641
641
642
642
/**
@@ -653,7 +653,7 @@ public function expunge() {
653
653
*/
654
654
public function checkCurrentMailbox () {
655
655
$ this ->checkConnection ();
656
- return imap_check ($ this ->connection );
656
+ return \ imap_check ($ this ->connection );
657
657
}
658
658
659
659
/**
@@ -666,7 +666,7 @@ public function checkCurrentMailbox() {
666
666
*/
667
667
public function setTimeout ($ type , $ timeout ) {
668
668
if (0 <= $ type && $ type <= 4 ) {
669
- return imap_timeout ($ type , $ timeout );
669
+ return \ imap_timeout ($ type , $ timeout );
670
670
}
671
671
672
672
throw new InvalidImapTimeoutTypeException ("Invalid imap timeout type provided. " );
@@ -681,7 +681,7 @@ public function setTimeout($type, $timeout) {
681
681
*/
682
682
public function getTimeout ($ type ){
683
683
if (0 <= $ type && $ type <= 4 ) {
684
- return imap_timeout ($ type );
684
+ return \ imap_timeout ($ type );
685
685
}
686
686
687
687
throw new InvalidImapTimeoutTypeException ("Invalid imap timeout type provided. " );
0 commit comments