-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swap static variable for shared reference to object
- Loading branch information
Showing
2 changed files
with
94 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
//============================================================+ | ||
// File name : tcpdf_page_cache_reference_counts.php | ||
// Version : 1.0.000 | ||
// Begin : 2023-08-04 | ||
// Last Update : 2023-08-04 | ||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) | ||
// ------------------------------------------------------------------- | ||
// Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD | ||
// | ||
// This file is part of TCPDF software library. | ||
// | ||
// TCPDF is free software: you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as | ||
// published by the Free Software Foundation, either version 3 of the | ||
// License, or (at your option) any later version. | ||
// | ||
// TCPDF is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// See LICENSE.TXT file for more information. | ||
// ------------------------------------------------------------------- | ||
// | ||
// Description : Class to keep track of page cache references | ||
// | ||
//============================================================+ | ||
|
||
/** | ||
* @file | ||
* PHP page cache reference counts class for TCPDF | ||
* @package com.tecnick.tcpdf | ||
*/ | ||
|
||
/** | ||
* @class TCPDF_PAGE_CACHE_REFERENCE_COUNTS | ||
* PHP page cache reference counts class for TCPDF | ||
* @package com.tecnick.tcpdf | ||
* @version 1.0.000 | ||
*/ | ||
class TCPDF_PAGE_CACHE_REFERENCE_COUNTS | ||
{ | ||
/** @var int Number of references */ | ||
private $numReferences = 0; | ||
|
||
/** | ||
* Increment reference count | ||
*/ | ||
public function incrementReferenceCount() | ||
{ | ||
$this->numReferences++; | ||
} | ||
|
||
/** | ||
* Decrement reference count | ||
*/ | ||
public function decrementReferenceCount() | ||
{ | ||
$this->numReferences--; | ||
} | ||
|
||
/** | ||
* Get reference count | ||
* | ||
* @return int Reference count | ||
*/ | ||
public function getReferenceCount() | ||
{ | ||
return $this->numReferences; | ||
} | ||
} |
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