# autoptimize/1.4/classes/autoptimizeBase.php

Autoptimize, version 1.4. 38 lines.

- Page: https://pluginprobe.com/plugins/autoptimize/1.4/code/classes/autoptimizeBase.php
- Raw: https://pluginprobe.com/plugins/autoptimize/1.4/raw/classes/autoptimizeBase.php
- Modified: 2009-07-12T02:25:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/autoptimize/1.4/code/classes/autoptimizeBase.php#L10-L20`.

```php
<?php

abstract class autoptimizeBase
{
	protected $content = '';
	
	public function __construct($content)
	{
		$this->content = $content;
		//Best place to catch errors
	}
	
	//Reads the page and collects tags
	abstract public function read($justhead);
	
	//Joins and optimizes collected things
	abstract public function minify();
	
	//Caches the things
	abstract public function cache();
	
	//Returns the content
	abstract public function getcontent();
	
	//Converts an URL to a full path
	protected function getpath($url)
	{
		$path = str_replace(get_settings('home'),'',$url);
		if(preg_match('#^(https?|ftp)://#i',$path))
		{
			//External script (adsense, etc)
			return false;
		}
		$path = str_replace('//','/',ABSPATH.$path);
		return $path;
	}
}

```
