HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/winter_site/wp-content/plugins/smart-slider-3/Nextend/SmartSlider3/PublicApi/Project.php
<?php


namespace Nextend\SmartSlider3\PublicApi;


use Nextend\SmartSlider3\Application\ApplicationSmartSlider3;
use Nextend\SmartSlider3\Application\Model\ModelSliders;
use Nextend\SmartSlider3\BackupSlider\ImportSlider;


/**
 * Class Project
 *
 * This class contains the publicly available static methods to interact with projects.
 *
 * @package Nextend\SmartSlider3
 */
class Project {

    /**
     * @param int $projectID
     *
     * @example \Nextend\SmartSlider3\PublicApi\Project::clearCache(6);
     *
     */
    public static function clearCache($projectID) {

        $application = ApplicationSmartSlider3::getInstance();

        $applicationType = $application->getApplicationTypeFrontend();

        $sliderModal = new ModelSliders($applicationType);

        $sliderModal->refreshCache($projectID);
    }

    /**
     * @param string  $pathToFile
     * @param integer $groupID
     *
     * @return bool|int projectID on success. false on failure.
     *
     * @example \Nextend\SmartSlider3\PublicApi\Project::import('/path/to/project.ss3');
     */
    public static function import($pathToFile, $groupID = 0) {

        if (!is_admin()) {
            require_once(ABSPATH . 'wp-admin/includes/file.php');
        }

        $application = ApplicationSmartSlider3::getInstance();

        $applicationType = $application->getApplicationTypeAdmin();

        $import = new ImportSlider($applicationType);

        $projectID = $import->import($pathToFile, $groupID);

        if ($projectID !== false) {
            return $projectID;
        }

        return false;
    }
}