-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the cache, so the cache will be cleared async to speed up process
- Loading branch information
Daniel Neto
committed
Jun 6, 2024
1 parent
aede8d0
commit ba0d0f7
Showing
9 changed files
with
175 additions
and
33 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
require_once dirname(__FILE__) . '/../../../videos/configuration.php'; | ||
|
||
class Cache_schedule_delete extends ObjectYPT { | ||
|
||
protected $id,$name; | ||
|
||
static function getSearchFieldsNames() { | ||
return array('name'); | ||
} | ||
|
||
static function getTableName() { | ||
return 'cache_schedule_delete'; | ||
} | ||
|
||
function setId($id) { | ||
$this->id = intval($id); | ||
} | ||
|
||
function setName($name) { | ||
$this->name = $name; | ||
} | ||
|
||
|
||
function getId() { | ||
return intval($this->id); | ||
} | ||
|
||
function getName() { | ||
return $this->name; | ||
} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
header('Content-Type: application/json'); | ||
require_once '../../videos/configuration.php'; | ||
|
||
$obj = new stdClass(); | ||
$obj->error = true; | ||
$obj->msg = ""; | ||
$obj->result = ""; | ||
|
||
if (!isCommandLineInterface()) { | ||
forbiddenPage('Command line only'); | ||
} | ||
|
||
// Get command line arguments | ||
if ($argc < 4) { | ||
$obj->msg = "Insufficient arguments. Usage: php script.php <videos_id> <deleteThumbs> <clearFirstPageCache>"; | ||
die(json_encode($obj)); | ||
} | ||
|
||
$videos_id = intval($argv[1]); | ||
$deleteThumbs = filter_var($argv[2], FILTER_VALIDATE_BOOLEAN); | ||
$clearFirstPageCache = filter_var($argv[3], FILTER_VALIDATE_BOOLEAN); | ||
|
||
// Call the clearCache function with the provided arguments | ||
$obj->clearCache = Video::_clearCache($videos_id, $deleteThumbs, $clearFirstPageCache, false); | ||
$obj->error = false; | ||
$obj->msg = "Cache cleared successfully"; | ||
|
||
echo json_encode($obj); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE IF NOT EXISTS `cache_schedule_delete` ( | ||
`id` INT NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(500) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE INDEX `name_UNIQUE` (`name` ASC)) | ||
ENGINE = InnoDB; |