Download the PHP package cuculcan/core without Composer

On this page you can find all versions of the php package cuculcan/core. 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 core

CORE

Small simple PHP MVC RESTlike framework for training purposes

installation

Navigation

Model

Controller

View

Model

Models are objects inherited from the Entity class. The entity corresponds to the row in the database table

each entry has at least an "id" field

User class example:

Entity fields can be annotated.

extra means that this property has no relation to the table column

type = json used to pack arrays in json when saving to db

default_value = used to set the default value in case the value is undefined

the constructor should be described as in the example and have at least the data parameter used to build the object after selecting from the database

Storages

For entities, storage objects are created that implement the functionality for working with the Database Repositories inherit from the MysqlStorage base class

СRUD methods for the Entity object are implemented in the base class MysqlStorage

Controllers

Controllers are designed to handle incoming requests

Any request to the site is converted using .htaccess RewriteRule

or nginx rewrite

and sent to index.php

The sequence of request processing is as follows:

Controller Inheritance Chain

AController is abstract. Invokes methods for handling addresses described in specific controllers. Should not depend on a specific project

BaseController inherits from AController and contains common methods for all user controllers. For example, initialization of a session user.  Preparing data for menus and others.

MainController and other user controllers are inherited from BaseController and contain methods for processing specific url addresses. The project must have at least one controller named MainController, it is responsible for processing calls to the root of the site.

To process other requests to the site, request handlers must be described in the appropriate controllers. For example, addresses starting with:

Must be described in UserController

Routing

Each controller class must have a method implementation

Handlers of URL templates are registered inside. There are handlers for GET, POST, PUT, DELETE requests. Implemented as Methods with appropriate names

The URL template handler has the format

The implementation of the response to the request is described in the callback of this method. In the URL template, there may be a variable parameter which is written in curly brackets and may be available inside the callback

In this example, a request of the form http: //myexample.com/user/12345/get_name will be processed and 12345 will be displayed

Request parameters can be accessed through the request object and it methods

getQueryParameters() - will return an array of parameters

getQueryParameter($name, $default = null) - will return the value of the parameter or the value passed to default, if the parameter is missing

All methods described in setActions() are executed in turn and the one that matches the template is selected, if more than one method matches the pattern, an exception is thrown

In all objects of the controller, the variable model is present. It is used to transfer data to objects of the View class for later display.

The View object is called by the method $ this->showView("UserView"). The parameter is the name of the class to display.

View will be displayed with the class UserView

View

View classes inherit from the abstract class AView, used to display templates. PHP itself is used as a template engine.

MainView class example:


All versions of core with dependencies

PHP Build Version
Package Version
Requires apache/log4php Version ^2.3
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 cuculcan/core contains the following files

Loading the files please wait ....