Changeset 1830 -- 2010-05-07 20:52:25
- Author
させざき
- Comment
- should use getcwd() for current working directory
Diffs
Wozozo_WWW_YouTube/trunk/src/Wozozo/WWW/YouTube.php
@@ -15,7 +15,7 @@
* @var array
*/
protected $_config = array('fmt' => 18,
- 'save' => 'PWD', //'PWD' will use getcwd();
+ 'save' => 'GETCWD', //'GETCWD' will use getcwd();
'request_video_stream' => true, //output stream
'response_video_cleanup' => true
);
@@ -159,8 +159,8 @@
{
$dir = $this->_config['save'];
$fmt = $this->_config['fmt'];
- if ('PWD' === $dir) {
- $dir = $_SERVER['PWD'];
+ if ('GETCWD' === $dir) {
+ $dir = getcwd();
} else {
if(!is_dir($dir)) {
throw new InvalidArgumentException('Invalid dir'.$dir);
@@ -173,6 +173,12 @@
/**
* borrowed from WWW::YouTube::Download
+ *
+ * @see
+ * http://cpansearch.perl.org/src/XAICRON/WWW-YouTube-Download-0.13/lib/WWW/YouTube/Download.pm
+ *
+ * @param string
+ * @return string
*/
public static function detectSuffix($fmt)
{
Wozozo_WWW_YouTube/trunk/src/Wozozo/WWW/YouTube/Tool/YoutubeProvider.php
@@ -20,7 +20,7 @@
$this->_out($url);
}
- public function download($id, $path = 'PWD')
+ public function download($id, $path = 'GETCWD')
{
$this->_download($id, $path, false);
}