Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
francescobianco committed Jul 19, 2022
1 parent 0572ac7 commit aab3386
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 43 deletions.
5 changes: 3 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand All @@ -16,6 +16,7 @@
use Javanile\Imap2\Message;
use Javanile\Imap2\Thread;
use Javanile\Imap2\Polyfill;
use Javanile\Imap2\Timeout;

define('IMAP2_CHARSET', 'UTF-8');
define('IMAP2_RETROFIT_MODE', function_exists('imap_open'));
Expand Down Expand Up @@ -324,7 +325,7 @@ function imap2_timeout($timeoutType, $timeout = -1)
imap_timeout($timeoutType, $timeout);
}

return Connection::timeout($timeoutType, $timeout);
return Timeout::set($timeoutType, $timeout);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Acl.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/BodyStructure.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
10 changes: 1 addition & 9 deletions src/Connection.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down Expand Up @@ -222,14 +222,6 @@ public function selectMailbox()
}
}

/**
*
*/
public static function timeout($timeoutType, $timeout = -1)
{

}

/**
*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Errors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Functions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/HeaderInfo.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/ImapHelpers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Mail.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Mailbox.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Message.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Thread.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the PHP Input package.
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
Expand Down
33 changes: 33 additions & 0 deletions src/Timeout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the PHP IMAP2 package.
*
* (c) Francesco Bianco <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Javanile\Imap2;

class Timeout
{
protected static $timeout;

public static function set($timeoutType, $timeout = -1)
{
if ($timeout == -1) {
return self::get($timeoutType);
}

self::$timeout[$timeoutType] = $timeout;

return true;
}

public static function get($timeoutType)
{
return self::$timeout[$timeoutType];
}
}
9 changes: 0 additions & 9 deletions tests/legacy/last-error.1.txt

This file was deleted.

12 changes: 0 additions & 12 deletions tests/legacy/last-error.2.txt

This file was deleted.

19 changes: 19 additions & 0 deletions tests/legacy/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
imap_timeout
imap_createmailbox
imap_getmailboxes
imap_mail_move
imap_delete
imap_fetchstructure
imap_fetchbody
imap_body
imap_fetchmime
imap_headerinfo
imap_errors
imap_last_error
imap_num_msg
imap_expunge
imap_close
*/

0 comments on commit aab3386

Please sign in to comment.