Download the PHP package bhaswanth53/ynotphp without Composer

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

Introduction

YNOTPHP is a lightweight PHP framework which is developed to make the life of developer easier. Unlike every modern framework like Laravel, Codeigniter, etc., it doesn't contain any core to confuse the developer. That means the entire structure is completely in the hands of the developer.

Server Requirements

The YNOTPHP framework comes with few requirements as below.

Getting Started

Installation

You can directly download the framework from github url: [https://github.com/bhaswanth53/ynotphp]()

or

if GIT is installed on your system, you can install using the below command.

Once, you downloaded the framework first thing you need to install packages using composer like below.

Once the packages installed you need to generate your unique APP_KEY using below command from your command shell.

The above command will generate an hashed APP_KEY like below.

You need to add your app key in your env.php file as shown below.

If you are using the framework from the root folder then you need to set APP_PATH in your env.php like below.

or if you are using the framework from any subfolder then you need to configure that subfolder path like below.

Once you finish this, your installation will be finished and you will be redirected to homepage.

Configuration

Public Directory

After installing YNOTPHP, you should configure your web server's document / web root to be the public directory. The index.php in this directory serves as the front controller for all HTTP requests entering your application.

Environmental Variables

All the environmental variables in this framework will be configured in env.php file.

YNOTPHP defaultly comes with the below variables.

APP_NAME: This is the name of your project.

APP_PATH: This is the path of the application.

APP_KEY: This is the unique key of the application which will be used in all trasactions regarding security.

APP_DEBUG: This will debug your app and log the errors into logs folder.

Note: By default it is true, but you can turn it off by setting false in production mode.

APP_MODE: This is the mode of the app. Initially YNOTPHP supports 3 types of modes.

  1. Development
  2. Testing
  3. Production

By default the mode will set to development.

Config Directory

Config directory contains 3 different folders.

  1. development
  2. testing
  3. production

Each folder contains 3 different files.

  1. db.php
  2. mail.php
  3. env.php

You can configure different database and mail configurations in different modes.

For example, if you set APP_MODE to testing then the database and mail configuration from testing folder will be used.

Routing

All the routes in YNOTPHP will be configured in web.php. YNOTPHP used AltoRouter for routing. So you can utilize all its features. But YNOTPHP adopted latest MVC architecture along with the router, so you can define the controller method directly from your router as shown below.

To define dynamic routes and URL parameters, you can check the documentation of AltoRouter.

Controllers

Instead of defining all of your request handling logic in route files, you may wish to organize this behavior using Controller classes. Controllers can group related request handling logic into a single class. Controllers are stored in the app/Controllers directory.

Defining Controllers

Below is an example of a basic controller class. Note that the controller extends the base controller class included with YNOTPHP. The base class provides a few convenience methods which may be used controller actions:

You can define a route to this controller action like so:

Views

Views contain the HTML served by your application and separate your controller / application logic from your presentation logic. Views are stored in the Views directory. A simple view might look something like this:

A view will be rendered in the controller using the render method which is defined in the Controller.

In the above code will render home.php inside Views directory. In case if the view is inside a folder in Views directory then you can call it like below.

Then it will look into Views/site/home.php.

Passing data to views

You can pass strings and arrays to the view from the controller as shown below.

And we can echo the variable in the view normally like below.

Better Templating

You can include view files into another just like Laravel blade templates.

The above code will include Views/layouts/site/header.php in your current file.

Models

A Model is a representation of the database table. Controllers will get access to the database using Models. In YNOTPHP we can define models like below.

The model uses PDO statements to interact with database.

We can use the model in the controllers like below.

Once the model is included in the Controller, then we can use all the methods in the model.

We can use the model inside views also by directly calling the model.

Facades

Facades has been develop to optimize the code need to be done for typical functionalities just like Laravel. In default, there are 6 types of facades come up with YNOTPHP. Those are:

  1. Mail
  2. Request
  3. Validation
  4. Crypt
  5. DB
  6. File

Lets have a quick look at what these facades are used to do.

Mail

Mail facade is used to send emails. You can use this facade inside your controller to send emails. To use Mail facade, we must use it first in our controller.

Once the facade has been used, then we are free to use it. First we need to configure the mail server in mail.php in your current mode inside config directory.

If you are using the application in development mode, then you need to configure mail server at config/development/mail.php file.

once the configuration has been completed, then we are free to send emails.

We can receive the dynamic argumants using $args from the mail view.

Request

Request facade is used to get form data or url parameters. Request facade is an important to use facade when you are working with dynamic website.

Request facade will be used inside the controller as shown below.

Request facade contains following methods.

input()

This method will be used to get form data normally without using any filters.

get()

This method is used to get data which has been sent using GET method or from URL parameters.

ajax()

This method is used to get form data which is sent using ajax POST requests.

secure_input()

This method is used to get form data in secure mode by filtering malicious chars.

secure_get()

This method is used to get data from URL parameters in secure mode.

secure_ajax()

This method is used to get data from ajax POST request in secure mode.

password_check()

This method is used to validate password. It checks password for the below conditions.

  1. Min Length: 10
  2. Max: Length: 32
  3. Must contain atleast one capital letter, one small letter, one digit and one special character.
hash()

This method is used to hash the strings like password.

verify_hash()

This method is used to verify hashed string with normal string.

all()

This method is used to get all the data from request by passing request name.

Validation

Validation facade is used to validate form data. You can use the facade from controller as.

YNOTPHP has been adopted validation plugin from davidecesarano/Validation library. It provides flexible features and developer friendly functionality. Check out the complete documentation in the official repository of library.

Crypt

Crypt facade is used to encrypt and decrypt the string. Generally it will use your unique APP_KEY for encryption and decryption.

YNOTPHP has been adopted defuse/php-encryption library for better security.

We can use this facade in our controller as follows.

Once included we can start to encrypt and decrypt strings.

File

File facade is used to store files in server. It will collect the files from POST request and will be used to upload to server.

Once the facade is included, then we are free to use this facade inside our controller.

YNOTPHP will upload files into public/storage directory.

Using this facade we can validate image sizes too using validateImageSizes method.

DB

DB facade will be used to explore database connection. It will be used in Models to connect with database.

DB facade use mysqli class to open database connection. But developers are free to use any kind of connection they want in the models without using the facade.

Helpers

Helpers are functions which are developed to reduce the time of the coding of complex functionality.

Here are the helpers listed below:

Configuration

env()

This function is used to get the variables from env.php.

db()

This function is used to get the variables from db.php in the current mode configured in env.php.

This will return the values from db.php in the current mode in config directory.

If your mode is testing then it will return the values from config/testing/db.php.

email()

This function is used to get the variables from mail.php in your current mode.

modeenv()

This function is uded to retrieve the variables from env.php from the current mode.

You can use this if you want any variables to be different in multiple modes.

Path & Asset

asset()

This function is used to link scripts and stylesheets to the views. This function will point inside public directory.

request_path()

This function is used to get the exact URL path of the web page.

request_is()

This function matches the prefix of the given path with the URL paths and returns true if matched.

This will check if the url path contains masterzone/pages as prefix, if it is, then returns true.

url()

This function is used to generate URL.

This will generate the complete url with contact. This will be used in both views and controllers.

get_url()

This function is used to get the current URL of the page. This will print entire URL.

Storage

storage_asset()

This function is used to retrieve the uploaded files from storage directory inside public directory.

This will return public/storage/images/uploaded.png.


All versions of ynotphp with dependencies

PHP Build Version
Package Version
Requires altorouter/altorouter Version 1.1.0
phpmailer/phpmailer Version ^6.1
defuse/php-encryption Version ^2.2
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 bhaswanth53/ynotphp contains the following files

Loading the files please wait ....