Zend Studio 13 中未定义的内置函数

undefined built in functions in Zend Studio 13

我在 Zend Studio 13 中创建了 PHP7 项目,但收到这样的警告 Call to undefined function 'dba_open'。为什么 Zend Studio 不识别这些函数?

dba_open
dba_close
dba_fetch
mhash

有什么解决办法吗?

Zend 并未为 Zend Studio 中的所有扩展提供语言支持。

为不受支持的扩展提供的语言实体添加支持的最有效方法无疑是创建存根。 所有受支持的 PHP 实体的描述 "stub" 文件可在此目录中找到: /.metadata/.plugins/org.eclipse.php.core/语言 这也是您应该放置存根文件的位置。

从下面复制 PHP 代码。创建文件 DBA.php 并将其放入文件夹 workspace/.metadata/.plugins/org.eclipse.php.core/__language__/languagecode/DBA.php

语言代码 - 8 位十六进制数字名称

您将无法调试具有这些功能的代码,但至少不再有警告。

<?php

/**
dba_open() establishes a database instance for path with mode using handler.

@link http://php.net/manual/en/function.dba-open.php

@param path string <p>Commonly a regular path in your filesystem.</p>

@param mode string <p>It is r for read access, w for read/write access to an already existing database,
c for read/write access and database creation if it doesn't currently exist, and n for create,
truncate and read/write access. The database is created in BTree mode, other modes (like Hash or Queue)
are not supported.<br>
<strong>Note:</strong><br>
There can only be one writer for one database file. When you use dba on a web server and more than
one request requires write operations they can only be done one after another. Also read during write
is not allowed. The dba extension uses locks to prevent this.
</p>

@param handler string <p>The name of the handler which shall be used for accessing path. It is passed all
optional parameters given to dba_open() and can act on behalf of them.</p>

@return FALSE on failure or positive handle on success.
*/
function dba_open ( $path , $mode, $handler=null) {}

/**
 * dba_exists() checks whether the specified key exists in the database.
 * @link http://php.net/manual/en/function.dba-exists.php
 *
 * @param string $key <p>The key the check is performed for.</p>
 * @param mixed $handle <p>The database handler, returned by dba_open() or dba_popen().</p>
 * @return Returns TRUE if the key exists, FALSE otherwise.
 */
function dba_exists ( $key , $handle ) {}

/**
 * dba_fetch() — Fetch data specified by key
 * @link http://php.net/manual/en/function.dba-fetch.php
 *
 * @param string $key The key the data is specified by.
 * <p><div><h3>Note:</h3></div>
 * When working with inifiles this function accepts arrays as keys where index 0 is the group and index 1 is the value name. See: dba_key_split().
 * </p>
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns the associated string if the key/data pair is found, FALSE otherwise.
 */
function dba_fetch ( $key , $handle ) {}

/**
 * dba_fetch() — Fetch data specified by key
 * @link http://php.net/manual/en/function.dba-fetch.php
 *
 * @param string $key The key the data is specified by.
 * <p><div><h3>Note:</h3></div>
 * When working with inifiles this function accepts arrays as keys where index 0 is the group and index 1 is the value name. See: dba_key_split().
 * </p>
 * @param $skip The number of key-value pairs to ignore when using cdb databases. This value is ignored for all other databases which do not support multiple keys with the same name.
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns the associated string if the key/data pair is found, FALSE otherwise.
 */
function dba_fetch ( $key , $skip , $handle ) {}

/**
 * dba_delete — Delete DBA entry specified by key
 * @link http://php.net/manual/en/function.dba-delete.php
 *
 * @param mixed $key The key of the entry which is deleted.
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns TRUE on success or FALSE on failure.
 */
function dba_delete ( $key , $handle ) {}

/**
 * dba_replace — Replace or insert entry
 * @link http://php.net/manual/en/function.dba-replace.php
 *
 * @param mixed $key The key of the entry to be replaced.
 * @param mixed $value The value to be replaced.
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns TRUE on success or FALSE on failure.
 */
function dba_replace ( $key , $value , $handle ) {}

/**
 * dba_insert() inserts the entry described with key and value into the database.
 * @link http://php.net/manual/en/function.dba-insert.php
 *
 * @param string $key <p>The key of the entry to be inserted. If this key already exist in the database, this function will fail. Use dba_replace() if you need to replace an existent key.</p>
 * @param string $value <p>The value to be inserted.</p>
 * @param mixed $handle <p>The database handler, returned by dba_open() or dba_popen().</p>
 *
 * @return Returns TRUE on success or FALSE on failure.
 */
function dba_insert ( $key , $value , $handle ) {}

/**
 * dba_firstkey() returns the first key of the database and resets the internal key pointer. This permits a linear search through the whole database.
 *
 * @link http://php.net/manual/en/function.dba-firstkey.php
 *
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns the key on success or FALSE on failure.
 */
function dba_firstkey ( $handle ) {}

/**
 * dba_nextkey() returns the next key of the database and advances the internal key pointer.
 *
 * @link http://php.net/manual/en/function.dba-nextkey.php
 *
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return Returns the key on success or FALSE on failure.
 */
function dba_nextkey ( $handle ) {}

/**
 *
 * @link http://php.net/manual/en/function.dba-close.php
 *
 * @param mixed $handle The database handler, returned by dba_open() or dba_popen().
 * @return No value is returned.
 */
function dba_close ( $handle ) {}