Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

driver_interface.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 3.84 KiB


 001  <?php
 002  /**
 003  *
 004  * This file is part of the phpBB Forum Software package.
 005  *
 006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 007  * @license GNU General Public License, version 2 (GPL-2.0)
 008  *
 009  * For full copyright and license information, please see
 010  * the docs/CREDITS.txt file.
 011  *
 012  */
 013   
 014  namespace phpbb\cache\driver;
 015   
 016  /**
 017  * An interface that all cache drivers must implement
 018  */
 019  interface driver_interface
 020  {
 021      /**
 022      * Load global cache
 023      *
 024      * @return mixed False if an error was encountered, otherwise the data type of the cached data
 025      */
 026      public function load();
 027   
 028      /**
 029      * Unload cache object
 030      *
 031      * @return null
 032      */
 033      public function unload();
 034   
 035      /**
 036      * Save modified objects
 037      *
 038      * @return null
 039      */
 040      public function save();
 041   
 042      /**
 043      * Tidy cache
 044      *
 045      * @return null
 046      */
 047      public function tidy();
 048   
 049      /**
 050      * Get saved cache object
 051      *
 052      * @param string $var_name         Cache key
 053      * @return mixed                 False if an error was encountered, otherwise the saved cached object
 054      */
 055      public function get($var_name);
 056   
 057      /**
 058      * Put data into cache
 059      *
 060      * @param string $var_name         Cache key
 061      * @param mixed $var             Cached data to store
 062      * @param int $ttl                 Time-to-live of cached data
 063      * @return null
 064      */
 065      public function put($var_name, $var, $ttl = 0);
 066   
 067      /**
 068      * Purge cache data
 069      *
 070      * @return null
 071      */
 072      public function purge();
 073   
 074      /**
 075      * Destroy cache data
 076      *
 077      * @param string $var_name         Cache key
 078      * @param string $table             Table name
 079      * @return null
 080      */
 081      public function destroy($var_name, $table = '');
 082   
 083      /**
 084      * Check if a given cache entry exists
 085      *
 086      * @param string $var_name         Cache key
 087      *
 088      * @return bool                     True if cache file exists and has not expired.
 089      *                                False otherwise.
 090      */
 091      public function _exists($var_name);
 092   
 093      /**
 094      * Load result of an SQL query from cache.
 095      *
 096      * @param string $query            SQL query
 097      *
 098      * @return int|bool                Query ID (integer) if cache contains a rowset
 099      *                                for the specified query.
 100      *                                False otherwise.
 101      */
 102      public function sql_load($query);
 103   
 104      /**
 105      * Save result of an SQL query in cache.
 106      *
 107      * In persistent cache stores, this function stores the query
 108      * result to persistent storage. In other words, there is no need
 109      * to call save() afterwards.
 110      *
 111      * @param \phpbb\db\driver\driver_interface $db    Database connection
 112      * @param string $query            SQL query, should be used for generating storage key
 113      * @param mixed $query_result    The result from \dbal::sql_query, to be passed to
 114      *                                 \dbal::sql_fetchrow to get all rows and store them
 115      *                                 in cache.
 116      * @param int $ttl                Time to live, after this timeout the query should
 117      *                                expire from the cache.
 118      * @return int|mixed                If storing in cache succeeded, an integer $query_id
 119      *                                 representing the query should be returned. Otherwise
 120      *                                 the original $query_result should be returned.
 121      */
 122      public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl);
 123   
 124      /**
 125      * Check if result for a given SQL query exists in cache.
 126      *
 127      * @param int $query_id
 128      * @return bool
 129      */
 130      public function sql_exists($query_id);
 131   
 132      /**
 133      * Fetch row from cache (database)
 134      *
 135      * @param int $query_id
 136      * @return array|bool             The query result if found in the cache, otherwise
 137      *                                 false.
 138      */
 139      public function sql_fetchrow($query_id);
 140   
 141      /**
 142      * Fetch a field from the current row of a cached database result (database)
 143      *
 144      * @param int $query_id
 145      * @param string $field             The name of the column.
 146      * @return string|bool             The field of the query result if found in the cache,
 147      *                                 otherwise false.
 148      */
 149      public function sql_fetchfield($query_id, $field);
 150   
 151      /**
 152      * Seek a specific row in an a cached database result (database)
 153      *
 154      * @param int $rownum             Row to seek to.
 155      * @param int $query_id
 156      * @return bool
 157      */
 158      public function sql_rowseek($rownum, $query_id);
 159   
 160      /**
 161      * Free memory used for a cached database result (database)
 162      *
 163      * @param int $query_id
 164      * @return bool
 165      */
 166      public function sql_freeresult($query_id);
 167  }
 168