This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { SQLite } from '@ionic-native/sqlite'; | |
import { Platform } from 'ionic-angular'; | |
import { isEmpty, isNull, keys, sortBy, get, parseInt } from 'lodash'; | |
import { browserDBInstance } from './browser'; | |
declare var window: any; | |
const SQL_DB_NAME = process.env.IONIC_ENV === 'dev' ? '__broswer.db' : '__native.db'; | |
@Injectable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filesystem = \Drupal::service('file_system'); | |
// Create file entity. | |
$image = File::create(); | |
$image->setFileUri($destination); | |
$image->setOwnerId(\Drupal::currentUser()->id()); | |
$image->setMimeType('image/' . pathinfo($destination, PATHINFO_EXTENSION)); | |
$image->setFileName($filesystem->basename($destination)); | |
$image->setPermanent(); | |
$image->save(); |