npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mfm-data

v1.1.32

Published

This file contains utility functions for data manipulation and retrieval in a PHP project. Here are the functions defined in this file:

Downloads

355

Readme

data/utils.php Documentation

This file contains utility functions for data manipulation and retrieval in a PHP project. Here are the functions defined in this file:

dataCreateRow Function

This function is used to create a new row in the data.

Parameters

  • $data_parent_id (required): The ID of the parent data.
  • $data_key (required): The key of the data.
  • $data_type (required): The type of the data.

Return Value

The function returns the ID of the newly created data row.

dataNew Function

This function is used to create a new data or retrieve an existing one.

Parameters

  • $path (required): The path where the data is located.
  • $create (optional): A boolean indicating whether to create a new data if it does not exist. The default value is false.

Return Value

The function returns the ID of the data.

dataSet Function

This function is used to set a value to a data.

Parameters

  • $path_array (required): An array representing the path of the data.
  • $value (required): The value to set.
  • $addHistory (optional): A boolean indicating whether to add this operation to the history. The default value is true.

Return Value

The function does not return a value.

dataGet Function

This function is used to get the value of a data.

Parameters

  • $path (required): An array representing the path of the data.

Return Value

The function returns the value of the data.

dataDelete Function

This function is used to delete a data.

Parameters

  • $path (required): An array representing the path of the data.

Return Value

The function returns a boolean indicating whether the deletion was successful.

dataExist Function

This function is used to check whether a data exists.

Parameters

  • $path (required): The path where the data is located.

Return Value

The function returns a boolean indicating whether the data exists.

dataKeys Function

This function is used to get the keys of a data.

Parameters

  • $path (required): An array representing the path of the data.
  • $page (optional): The page number for the results. The default value is 1.
  • $size (optional): The number of results per page. The default value is PAGE_SIZE_DEFAULT.

Return Value

The function returns a list of keys.

dataCount Function

This function is used to count the number of data in a path.

Parameters

  • $path (required): An array representing the path of the data.

Return Value

The function returns the number of data.

dataInfo Function

This function is used to get the information of a data.

Parameters

  • $path (required): An array representing the path of the data.

Return Value

The function returns an array containing the information of the data.

dataHistory Function

This function is used to get the history of a data.

Parameters

  • $path_array (required): An array representing the path of the data.
  • $page (optional): The page number for the results. The default value is 1.
  • $size (optional): The number of results per page. The default value is PAGE_SIZE_DEFAULT.

Return Value

The function returns a list of history records.

dataInc Function

This function is used to increment the value of a data.

Parameters

  • $path (required): An array representing the path of the data.
  • $inc_val (required): The increment value.
  • $addHistory (optional): A boolean indicating whether to add this operation to the history.

Return Value

The function returns the new value of the data.

dataDec Function

This function is used to decrement the value of a data.

Parameters

  • $path (required): An array representing the path of the data.
  • $dec_val (required): The decrement value.
  • $addHistory (optional): A boolean indicating whether to add this operation to the history.

Return Value

The function returns the new value of the data.

dataSearch Function

This function is used to search for specific data.

Parameters

  • $path (required): The path where the data is located.
  • $search_text (required): The text to search for.
  • $page (optional): The page number for the results. The default value is 1.
  • $size (optional): The number of results per page. The default value is PAGE_SIZE_DEFAULT.

Return Value

The function returns a list of data keys that match the search text.

dataCommit Function

This function is used to commit the changes made to the data.

Parameters

This function does not accept any parameters.

Return Value

This function does not return a value.