Changeset 79
- Timestamp:
- 02/26/08 22:15:40 (5 years ago)
- Files:
-
- 1 modified
-
trunk/Phergie/Plugin/Abstract/Base.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Phergie/Plugin/Abstract/Base.php
r78 r79 46 46 47 47 /** 48 * Reference to the current instance of the plugin, used to make its 48 * Reference to the current instance of the plugin, used to make its 49 49 * non-static methods accessible to other plugins 50 50 * … … 189 189 { 190 190 if (strlen($url) > 30) { 191 $tiny = @file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode($url)); 191 $opts = array('http' => 192 array( 193 'timeout' => 4, 194 'method' => 'POST', 195 'header' => 'Content-type: application/x-www-form-urlencoded', 196 'content' => http_build_query(array('url' => $url)) 197 ) 198 ); 199 $context = stream_context_create($opts); 200 $tiny = @file_get_contents('http://tinyurl.com/api-create.php', false, $context); 192 201 if (empty($tiny)) { 193 202 $tiny = $url; … … 211 220 212 221 /** 213 * Returns whether or not the current environment meets the requirements 214 * of the plugin in order for it to be run, including the PHP version, 215 * loaded PHP extensions, and other plugins intended to be loaded. 222 * Returns whether or not the current environment meets the requirements 223 * of the plugin in order for it to be run, including the PHP version, 224 * loaded PHP extensions, and other plugins intended to be loaded. 216 225 * Plugins with such requirements should override this method. 217 226 * 218 * @param array $plugins List of short names for plugins that the 227 * @param array $plugins List of short names for plugins that the 219 228 * bootstrap file intends to instantiate 220 229 * @return bool TRUE if dependencies are met, FALSE otherwise