Exemple #1
0
 /**
  * Set static upload directory properties
  *
  * @internal
  * @return boolean
  */
 private function populate_dir_props()
 {
     // only populate dir info once
     if (!self::$populated) {
         // get upload directory details
         $upload_dir = wp_upload_dir();
         // make sure we didn't get an error
         if ($upload_dir['error'] == false) {
             // set upload dir path and url
             self::$upload_dir = realpath($upload_dir['basedir']);
             self::$upload_url = $upload_dir['baseurl'];
             // determine export path and url
             self::$export_dir = sprintf('%s/%s/%s', self::$upload_dir, ICE_EXPORTS_SUBDIR, ICE_ACTIVE_THEME);
             self::$export_url = sprintf('%s/%s/%s', self::$upload_url, ICE_EXPORTS_SUBDIR, ICE_ACTIVE_THEME);
             // don't try to set these twice
             self::$populated = true;
             // yay
             return true;
         }
         throw new ICE_Export_Exception($upload_dir['error']);
     }
     return true;
 }