public function __construct($app = null)
{
if (!is_object($this->app)) {
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}
if (function_exists('mw_cache_path')) {
$this->temp_dir = mw_cache_path() . 'updates_temp' . DIRECTORY_SEPARATOR;
} else {
$this->temp_dir = __DIR__ . DIRECTORY_SEPARATOR . 'cache/updates_temp' . DIRECTORY_SEPARATOR;
}
if (!is_dir($this->temp_dir)) {
mkdir_recursive($this->temp_dir);
}
}