Skip to content

Commit

Permalink
Package core moved to php-imap
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Sep 22, 2020
1 parent 3391e8a commit d01caf1
Show file tree
Hide file tree
Showing 39 changed files with 37 additions and 5,444 deletions.
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -20,15 +20,15 @@
],
"require": {
"php": ">=5.5.9",
"ext-imap": "*",
"ext-mbstring": "*",
"ext-iconv": "*",
"ext-fileinfo": "*",
"webklex/php-imap": "^2.1",
"laravel/framework": ">=5.0.0"
},
"autoload": {
"psr-4": {
"Webklex\\IMAP\\": "src/IMAP"
"Webklex\\IMAP\\": "src"
}
},
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions examples/custom_attachment_mask.php
Expand Up @@ -10,7 +10,7 @@
* -
*/

class CustomAttachmentMask extends \Webklex\IMAP\Support\Masks\AttachmentMask {
class CustomAttachmentMask extends \Webklex\PHPIMAP\Support\Masks\AttachmentMask {

/**
* New custom method which can be called through a mask
Expand All @@ -35,18 +35,18 @@ public function custom_save() {

}

/** @var \Webklex\IMAP\Client $oClient */
/** @var \Webklex\PHPIMAP\Client $oClient */
$oClient = \Webklex\IMAP\Facades\Client::account('default');
$oClient->connect();
$oClient->setDefaultAttachmentMask(CustomAttachmentMask::class);

/** @var \Webklex\IMAP\Folder $folder */
/** @var \Webklex\PHPIMAP\Folder $folder */
$folder = $oClient->getFolder('INBOX');

/** @var \Webklex\IMAP\Message $message */
/** @var \Webklex\PHPIMAP\Message $message */
$message = $folder->query()->limit(1)->get()->first();

/** @var \Webklex\IMAP\Attachment $attachment */
/** @var \Webklex\PHPIMAP\Attachment $attachment */
$attachment = $message->getAttachments()->first();

/** @var CustomAttachmentMask $masked_attachment */
Expand Down
8 changes: 4 additions & 4 deletions examples/custom_message_mask.php
Expand Up @@ -10,7 +10,7 @@
* -
*/

class CustomMessageMask extends \Webklex\IMAP\Support\Masks\MessageMask {
class CustomMessageMask extends \Webklex\PHPIMAP\Support\Masks\MessageMask {

/**
* New custom method which can be called through a mask
Expand All @@ -30,14 +30,14 @@ public function getAttachmentCount() {

}

/** @var \Webklex\IMAP\Client $oClient */
/** @var \Webklex\PHPIMAP\Client $oClient */
$oClient = \Webklex\IMAP\Facades\Client::account('default');
$oClient->connect();

/** @var \Webklex\IMAP\Folder $folder */
/** @var \Webklex\PHPIMAP\Folder $folder */
$folder = $oClient->getFolder('INBOX');

/** @var \Webklex\IMAP\Message $message */
/** @var \Webklex\PHPIMAP\Message $message */
$message = $folder->query()->limit(1)->get()->first();

/** @var CustomMessageMask $masked_message */
Expand Down
4 changes: 2 additions & 2 deletions examples/folder_structure.blade.php
Expand Up @@ -11,8 +11,8 @@
*/
/**
* @var \Webklex\IMAP\Support\FolderCollection $paginator
* @var \Webklex\IMAP\Folder $oFolder
* @var \Webklex\PHPIMAP\Support\FolderCollection $paginator
* @var \Webklex\PHPIMAP\Folder $oFolder
*/
?>
Expand Down
4 changes: 2 additions & 2 deletions examples/message_table.blade.php
Expand Up @@ -11,8 +11,8 @@
*/
/**
* @var \Webklex\IMAP\Support\MessageCollection $paginator
* @var \Webklex\IMAP\Message $oMessage
* @var \Webklex\PHPIMAP\Support\MessageCollection $paginator
* @var \Webklex\PHPIMAP\Message $oMessage
*/
?>
Expand Down
43 changes: 0 additions & 43 deletions examples/replace_images_with_url.php

This file was deleted.

22 changes: 14 additions & 8 deletions src/IMAP/ClientManager.php → src/ClientManager.php
Expand Up @@ -12,6 +12,11 @@

namespace Webklex\IMAP;

use Illuminate\Foundation\Application;
use Webklex\PHPIMAP\Client;
use Webklex\PHPIMAP\ClientManager as CM;
use Webklex\PHPIMAP\Exceptions\MaskNotFoundException;

/**
* Class ClientManager
*
Expand All @@ -24,7 +29,7 @@ class ClientManager {
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var Application
*/
protected $app;

Expand All @@ -36,19 +41,19 @@ class ClientManager {
/**
* Create a new client manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param Application $app
*/
public function __construct($app) {
$this->app = $app;
CM::$config = $this->app['config']["imap"];
}

/**
* Resolve a account instance.
*
* @param string $name
*
* @return Client
* @throws Exceptions\MaskNotFoundException
* @throws MaskNotFoundException
*/
public function account($name = null) {
$name = $name ?: $this->getDefaultAccount();
Expand All @@ -68,7 +73,7 @@ public function account($name = null) {
* @param string $name
*
* @return Client
* @throws Exceptions\MaskNotFoundException
* @throws MaskNotFoundException
*/
protected function resolve($name) {
$config = $this->getConfig($name);
Expand Down Expand Up @@ -109,16 +114,17 @@ public function getDefaultAccount() {
*/
public function setDefaultAccount($name) {
$this->app['config']['imap.default'] = $name;
CM::$config['config']['default'] = $name;
}

/**
* Dynamically pass calls to the default account.
*
* @param string $method
* @param array $parameters
* @param string $method
* @param array $parameters
*
* @return mixed
* @throws Exceptions\MaskNotFoundException
* @throws MaskNotFoundException
*/
public function __call($method, $parameters) {
$callable = [$this->account(), $method];
Expand Down
File renamed without changes.

0 comments on commit d01caf1

Please sign in to comment.