/** */ public function get_property($name) { switch ($name) { case 'path': return $this->export->get_property('path'); case 'url': return $this->export->get_property('url'); default: return parent::get_property($name); } }
/** * Constructor * * @param integer $max_age */ private function __construct($max_age = 86400) { // initialize services map $this->services = new ICE_Map(); // add google always (for now) $this->add_google(); // set up export $this->export = new ICE_Export('webfont', 'json', array($this, 'update')); // try to refresh $this->export->refresh(time() - $max_age); }
/** * 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; }