- }
- else try {
- # dommage que ca ne soit pas une option de yql_to_array...
- if ($this->command['sourcemode'] == 'yql')
- if (!isset($ttl)) $ttl = 3600;
-
- if (isset($this->command['sourcemode'])
- AND in_array($this->command['sourcemode'],
- array('table', 'array', 'tableau'))
- ) {
- if (is_array($a = $src)
- OR (is_string($a)
- AND $a = str_replace('"', '"', $a) # fragile!
- AND is_array($a = @unserialize($a)))
- )
- $this->tableau = $a;
- }
- else {
- if (preg_match(',^https?://,', $src)) {
- include_spip('inc/distant');
- $u = recuperer_page($src, false, false, _DATA_SOURCE_MAX_SIZE);
- if (!$u)
- throw new Exception("404");
- if (!isset($ttl)) $ttl = 24*3600;
- } else if (@is_dir($src)) {
- $u = $src;
- if (!isset($ttl)) $ttl = 10;
- } else if (@is_readable($src) && @is_file($src)) {
- $u = spip_file_get_contents($src);
- if (!isset($ttl)) $ttl = 10;
- } else {
- $u = $src;
- if (!isset($ttl)) $ttl = 10;