retesere20

---recycler---get-pma-zip

Sep 20th, 2018
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private function getPmaZip(){
  2. preg_match( '/(.*?)\-english\.zip/i', $this->readUrl('https://www.phpmyadmin.net/downloads/list.txt'), $found );
  3. if( !empty($found[0]) ){
  4. $url = $found[0];
  5. wp_remote_get(
  6. $url,
  7. array(
  8. 'timeout' => 300,
  9. 'stream' => true,
  10. 'filename' => $this->pma_zipPath
  11. )
  12. );
  13. }
  14. else{
  15. add_action('admin_notice', function(){ ?>
  16. <div class="notice notice-success is-dismissible">
  17. <p><strong>Error Downloading PMA.</strong></p>
  18. <button type="button" class="notice-dismiss">
  19. <span class="screen-reader-text"></span>
  20. </button>
  21. </div>
  22. <?php
  23. } );
  24.  
  25. return "error";
  26. }
  27. }
RAW Paste Data