Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
41 KiB

  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. class TestMachine extends Command
  5. {
  6. /**
  7. * The name and signature of the console command.
  8. *
  9. * @var string
  10. */
  11. protected $signature = 'test:machine';
  12. /**
  13. * The console command description.
  14. *
  15. * @var string
  16. */
  17. protected $description = 'Command description';
  18. /**
  19. * Create a new command instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. }
  27. /**
  28. * Execute the console command.
  29. *
  30. * @return mixed
  31. */
  32. public function handle()
  33. {
  34. $data = '["{P1_Name} GENERAL TERMS AND CONDITIONS","These General Terms and Conditions (\"General Terms\") are made as of _______________________ (the \"Effective Date\")","between","{P1_Name},","a","Delaware","corporation,","with","offices","at","{P1_Reg}","({P1_Name)","and","_______________________________________________ with offices at _____________________________________","(\u201cCustomer\u201d).","{P1_Name} offers the {P1_Pros} to many customers in a wide variety of market sectors, deployed either from our multi-tenant","cloud or from a Customer\u2019s private cloud\/data center(s). {P1_Name}\u2019s flagship product, {P1_Name} {P1_Pro], is operated by","(or for) the Customer for them to manage large numbers of Application Programming Interfaces (APIs) to the Customer\u2019s","back-end systems so that the Customer can operate and optimize API-based mobile apps and web ecosystems. The APIs","developed by the Customer and managed through {P1_Name} {P1_Pro] enable the Customer\u2019s back-end systems to share","data and services with mobile apps and other digital assets. {P1_Name} {P1_Pro] includes tools for the Customer: to develop","and implement API-related policies (such as those relating to the access and security of Customer Data); to easily create,","deploy, and update APIs; and to operate a portal to share its APIs with its internal and external developers. {P1_Name}","{P1_Pro] does not require the Customer\u2019s data to be stored within product; rather, the {P1_Name} {P1_Pro] gateway","processes API calls between the Customer\u2019s back-end systems and the mobile apps and other digital assets that incorporate","the Customer\u2019s APIs.","CUSTOMER:","{P1_NAME}","Individual Signing:","[print name]","{P2_Ind}","Individual Signing:","[print name]","{P1_Ind}","Signature:","Signature:","Title:","Title:","{P1_Ind_Pos}","Signing Date:","CUSTOMER ADDRESS FOR NOTIFICATIONS:","{P2_NOT}","{P1_Ind_Pos}","Signing Date:","{P1_NAME} ADDRESS FOR NOTIFICATIONS:","{P1_Not}","Attn: {P1_Ind_Pos}","The purpose of these General Terms is to provide a single set of terms and conditions under which Customer may license","and\/or purchase {P1_Pros}. The {P1_Pros} ordered by Customer and corresponding fees will be identified in an Order Form,","the first of which is attached hereto as Exhibit A to these General Terms. If Customer orders additional {P1_Pros} or","Professional Services after the Effective Date, {P1_Name} may in its sole discretion accept a purchase order from Customer","referencing these General Terms, the additional {P1_Pros} and\/or Professional Services and the applicable fees or may","require in its discretion an additional document similar to the Order Form to be executed by Customer. In addition to the","General Terms, Customer\u2019s license and use of {P1_Pros} shall also be subject to the provisions of the applicable {P1_Name}","Product exhibit attached as Exhibit B-1 (\u201cProduct Exhibit\u201d). Exhibit B-1 applies to Software deployed at premises owned and","operated by or for Customer). In the event of any conflict between an applicable Product Exhibit and these General Terms,","the applicable Product Exhibit shall control. These General Terms, together with the Exhibits, are collectively known as the","\u201cAgreement.\u201d","1.","DEFINITIONS.","\"Affiliate\" means, with respect to a party, any entity,","which directly or indirectly Controls, is Controlled by, or is","under common Control with such party.","\"{P1_Pros}\" means the Cloud Service, and\/or Software","licensed and\/or purchased by Customer under the","Agreement","\u201cCloud Service\u201d means the cloud service offerings as","further described in the Documentation and on the Order","Form.","\u201cConfidential Information\u201d has the meaning set forth in","Section 10.","28323853 v1","\u201cControl\u201d means ownership or control, directly or","indirectly, of more than 50% of the voting interests of the","subject entity.","\u201cCustomer Data\u201d means all data of Customer that is","submitted to the {P1_Pros} by Customer and al
  35. $dataArray = json_decode($data,true);
  36. $count = count($dataArray);
  37. for($i=0;$i<$count;$i++){
  38. $current = $dataArray[$i];
  39. $next = $dataArray[$i+1];
  40. $scriptPath = storage_path('test/test.py');
  41. exec("/home/florin/anaconda3/bin/python /home/florin/Projects/contrai_ingest/storage/test/test.py $scriptPath $current $next",$output);
  42. // print output from command
  43. $this->output->text($current.'=>'.$next);
  44. $this->output->text( implode( PHP_EOL, $output ) );
  45. $i++;
  46. }
  47. }
  48. }