server/src/app/Libraries/Handle/HandleClient.php
changeset 552 2c579ea45608
parent 387 7fba86fa8604
equal deleted inserted replaced
551:e70004b11b3b 552:2c579ea45608
     1 <?php
     1 <?php
     2 namespace CorpusParole\Libraries\Handle;
     2 namespace CorpusParole\Libraries\Handle;
     3 
     3 
       
     4 use Config;
     4 use Log;
     5 use Log;
     5 
       
     6 
     6 
     7 use Illuminate\Pagination\LengthAwarePaginator;
     7 use Illuminate\Pagination\LengthAwarePaginator;
     8 use Illuminate\Pagination\Paginator;
     8 use Illuminate\Pagination\Paginator;
     9 
     9 
    10 use phpseclib\Crypt\RSA;
    10 use phpseclib\Crypt\RSA;
   255         $delRes = $this->httpClient->delete($delUrl, $this->guzzleOptions);
   255         $delRes = $this->httpClient->delete($delUrl, $this->guzzleOptions);
   256 
   256 
   257         Log::debug('Delete Handle: '.$delRes->getStatusCode().': '.$delRes->getReasonPhrase());
   257         Log::debug('Delete Handle: '.$delRes->getStatusCode().': '.$delRes->getReasonPhrase());
   258     }
   258     }
   259 
   259 
   260     public function createHandleUrlRecord($handle, $url) {
   260     public function createHandleUrlRecord($handle, $url, $title) {
   261         $this->initSession();
   261         $this->initSession();
   262         $currentDate = gmstrftime('%Y-%m-%dT%H:%M:%SZ');
   262         $currentDate = gmstrftime('%Y-%m-%dT%H:%M:%SZ');
   263         $handleRecord = [
   263         $handleRecord = [
   264           'values' => [
   264           'values' => [
   265             ['index' => 1, 'ttl' => 86400, 'type' => 'URL', 'timestamp' => $currentDate, 'data' => ['value'=> $url, 'format'=> 'string']],
   265             ['index' => 1, 'ttl' => 86400, 'type' => 'URL', 'timestamp' => $currentDate, 'data' => ['value'=> $url, 'format'=> 'string']],
       
   266             ['index' => 2, 'ttl' => 86400, 'type' => 'DESC', 'timestamp' => $currentDate, 'data' => ['value'=> config('corpusparole.handle_title_prefix')." : $title", 'format'=> 'string']],
       
   267             ['index' => 3, 'ttl' => 86400, 'type' => 'EMAIL', 'timestamp' => $currentDate, 'data' => ['value'=> config('corpusparole.handle_contact_email'), 'format'=> 'string']],
   266             ['index' => 100, 'ttl' => 86400, 'type' => 'HS_ADMIN', 'timestamp' => $currentDate, 'data' => [
   268             ['index' => 100, 'ttl' => 86400, 'type' => 'HS_ADMIN', 'timestamp' => $currentDate, 'data' => [
   267                 'value' => ['index' => 200, 'handle' => $this->adminId],
   269                 'value' => ['index' => 200, 'handle' => $this->adminId],
   268                 'permissions' => '011111110011',
   270                 'permissions' => '011111110011',
   269                 'format' => 'admin'
   271                 'format' => 'admin'
   270               ]
   272               ]