<?php ar_pinp::allow('ar_connect_rss'); ar::load('xml'); class ar_connect_rss extends arBase { public static function client($url = null, $httpClient = null) { if (!isset($httpClient)) { $httpClient = ar_http::client(); } return new ar_connect_rssClient($url, $httpClient); } public static function parse($xml) { $client = new ar_connect_rssClient(); return $client->parse($xml); } } class ar_connect_rssClient extends ar_xmlDataBinding { private $httpClient = null; private $feed = null; public function __construct($feed = null, $httpClient = null) { $this->feed = $feed; $this->httpClient = $httpClient; if ($feed && $this->httpClient) { $this->get($feed); } }
function ar($name = null) { // this function works as an alternative to statically calling the namespaced class // this is a fallback untill namespaces work in php 5.3 return ar::load($name); }
public function __construct($httpClient = null) { if (!$httpClient) { ar::load('http'); $httpClient = new ar_httpClientStream(); } $this->client = $httpClient; }
<?php ar_pinp::allow('ar_css'); ar_pinp::allow('ar_cssStyleSheet'); ar_pinp::allow('ar_cssSearch'); ar::load('html'); class ar_css extends arBase { public static function stylesheet() { return new ar_cssStyleSheet(); } } class ar_cssStyleSheet extends ar_htmlElement { // FIXME: make the css content available as nodeValue of a child ar_htmlNode (or a list of nodes?) // create a ar_cssRule which implements or extends ar_htmlNode? private $cssText = ''; private $variables = array(); public $rules = null; public function __construct($tagName = 'style', $attributes = array(), $childNodes = null, $parentNode = null) { $this->rules = new ar_cssRules($this); if (!$attributes) { $attributes = array(); } if (!$attributes['type']) { $attributes['type'] = 'text/css'; } parent::__construct($tagName, $attributes, null, $parentNode); }