Download the PHP package bojaghi/admin-ajax without Composer

On this page you can find all versions of the php package bojaghi/admin-ajax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package admin-ajax

Admin Ajax

WordPress wp-admin/admin-ajax.php, wp-admin/admin-post.php handler helper.

사용법

객체 생성하기

위 예처럼 생성자의 인자로 첫번째에 배열, 또는 문자열을 입력할 수 있습니다. 이 값은 필수입니다. 두번째에는 Psr/Container 패키지 Psr\Container\ContainerInterface 인터페이스를 구현한 컨테이너 객체를 입력합니다. 컨테이너가 별명으로 인스턴스를 가져오게 하기 위해 필요합니다. 컨테이너를 사용하지 않는다면 입력하지 않아도 됩니다.

설정 파일

설정 파일은 PHP 파일이며, 1개의 배열을 리턴해야 합니다. 아래 예를 참고하시기 바랍니다.

자동 NONCE 체크

위 예시의 my_action_4처럼 '_my_nonce' 이름의 NONCE 값을 폼에 삽입하려면 아래처럼 할 수 있습니다.

또는 wp_nonce_field를 사용할 수도 있습니다.

요청을 처리하면서 콜백 함수를 호출하기 전에 미리 NONCE 검증을 하여 보다 편리합니다. 액션의 이름이 고정되어 있다면 이 방법을 사용하는 것을 추천합니다.

콜백 지정 방법

설정 파일의 예에서 myClass@callback3 같은 문자열을 콜백으로 사용했습니다. 여기서는 콜백을 해석하는 방법은 설명합니다.

콜백의 입력으로 다음이 가능합니다.

직관적으로, 익명함수, 람다함수, 함수 이름의 문자열, 배열 형태의 메소드 같이 호출 가능하다면 그대로 콜백으로 사용됩니다.

만약 콜백으로 길이가 2인 배열이되 각 요소가 문자열인 배열이 입력된다면, 이 경우 정해진 방법대로 해석을 거칩니다.

  1. 0번 요소가 클래스 이름 그대로라면 해당 클래스를 인스턴스화 시킵니다.
  2. 0번 요소가 컨테이너에서 객체의 별명으로 사용된다면 해당 인스턴스를 컨테이너로부터 가져옵니다.
  3. [인스턴스, 메소드]가 호출 가능하면 해당 배열을, 아니면 null을 리턴합니다.

만약 콜백이 함수 이름이 아닌 문자열이라면, 다음 과정을 거칩니다.

  1. '@' 표시를 기준으로 문자열을 최대 길이 2짜리 배열로 변환합니다,
  2. 길이 1인 배열이 된 경우,
    1. 0번 요소는 클래스 이름이거나 컨테이너에서 사용되는 별명으로 간주합니다. 그리하여 0번 요소로부터 인스턴스를 추론할 수 있어야 합니다.
    2. 인스턴스화를 마치는 것으로 과정이 끝나고, null을 리턴합니다. 인스턴스를 생성하면서 필요한 과정이 모두 수행된 것으로 생각하기 때문입니다.
  3. 길이 2인 배열이 된 경우,
    1. 0번 요소는 클래스 이름이거나 컨터이너에서 사용되는 별명으로 간주합니다. 그리하여 0번 요소로부터 인스턴스를 추론할 수 있어야 합니다.
    2. 1번 요소는 인스턴스의 메소드 이름이어야 합니다.
    3. [인스턴스, 메소드]가 호출 가능하면 해당 배열을, 아니면 null을 리턴합니다.

All versions of admin-ajax with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
bojaghi/helper Version ^1.0
bojaghi/contract Version ^1.0
psr/container Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bojaghi/admin-ajax contains the following files

Loading the files please wait ....