| @@ 1710-1724 (lines=15) @@ | ||
| 1707 | * |
|
| 1708 | * @author Dmitry (dio) Levashov |
|
| 1709 | **/ |
|
| 1710 | protected function _getContents($path) |
|
| 1711 | { |
|
| 1712 | $contents = ''; |
|
| 1713 | ||
| 1714 | try { |
|
| 1715 | list(, $itemId) = $this->_bd_splitPath($path); |
|
| 1716 | $url = self::API_URL.'/files/'.$itemId.'/content'; |
|
| 1717 | ||
| 1718 | $contents = $this->_bd_fetch($url, true); |
|
| 1719 | } catch (Exception $e) { |
|
| 1720 | return $this->setError('Box error: '.$e->getMessage()); |
|
| 1721 | } |
|
| 1722 | ||
| 1723 | return $contents; |
|
| 1724 | } |
|
| 1725 | ||
| 1726 | /** |
|
| 1727 | * Write a string to a file. |
|
| @@ 1662-1675 (lines=14) @@ | ||
| 1659 | * |
|
| 1660 | * @author Dmitry (dio) Levashov |
|
| 1661 | **/ |
|
| 1662 | protected function _getContents($path) |
|
| 1663 | { |
|
| 1664 | $contents = ''; |
|
| 1665 | ||
| 1666 | try { |
|
| 1667 | list(, $itemId) = $this->_od_splitPath($path); |
|
| 1668 | $url = self::API_URL.$itemId.'/content'; |
|
| 1669 | $contents = $this->_od_createCurl($url, $contents = true); |
|
| 1670 | } catch (Exception $e) { |
|
| 1671 | return $this->setError('OneDrive error: '.$e->getMessage()); |
|
| 1672 | } |
|
| 1673 | ||
| 1674 | return $contents; |
|
| 1675 | } |
|
| 1676 | ||
| 1677 | /** |
|
| 1678 | * Write a string to a file. |
|