Skip to content

Commit

Permalink
try catch call api vimeo
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroOmatech committed Nov 15, 2019
1 parent 56dce95 commit 696de0b
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/admin/models/instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,21 +741,26 @@ function getJsonValVideo( $p_valor ){
$video = explode( ':', $p_valor);
$json_val = NULL;

if( !empty($video) && isset($video[0]) && isset($video[1]) ){
try{
if( !empty($video) && isset($video[0]) && isset($video[1]) ){

switch($video[0]){
switch($video[0]){

case 'vimeo':
$json_val = file_get_contents("http://vimeo.com/api/v2/video/$video[1].json");
break;
case 'vimeo':
$json_val = file_get_contents("http://vimeo.com/api/v2/video/$video[1].json");
break;

case 'youtube':
break;
case 'youtube':
break;

default:
break;
default:
break;
}
}
}catch(\Exception $e){

}

return $json_val;
}
function getExistsColumnDatabase( $table, $column ){
Expand Down

0 comments on commit 696de0b

Please sign in to comment.