Any PHP framework using latest mongodb driver? - php

Am searching for PHP framework which supports PHP7 and latest php mongo driver (https://github.com/mongodb/mongo-php-driver) using 1.1.8 (https://pecl.php.net/package/mongodb)
I tried with codeignitor and fatfree but they seems to support old one. Any help is appreciated.
Thanks,
Zeeshan

If you are using codeignitor then you can install library through composer (you need to install composer first if you dont have)
Then go to your project directory through command line and run the following command
composer require "mongodb/mongodb=^1.0.0
It will install mongodb library in your vendor folder of your project.
Then you need to include following line where you want to use the library for eg you can include it on top of your controller or model.
require 'vendor/autoload.php';

Related

Twig template engine installation and create sample

I need to know how to install php twig template and how to create a php sample using php twing template engine. I'm a beginner to twig..The documentation given in the twig site is confusing me.I need step by step instructions to install it Windows 10
Install Composer and run the following command to get the latest version:
composer require twig/twig
It will download twig. Then you can use
require_once '/path/to/lib/Twig/Autoloader.php';
Twig_Autoloader::register();

Typo3 6 and Extbase: how to use composer files, autoload.php

What I want to do is use the elasticsearch php client in a typo3 extbase controller. Now I created a composer.json and did the composer install, now I have a vendor directory next to my typo3 directories.
But what do I do next? Can I somehow tell typo3 to use the autoload.php or is there another way to load the classes? I'm kinda helpless.
If you want composer support, then you should consider upgrading to TYPO3 7.6 LTS.
You can find some basic documentation about composer at the official website.

PHP framework AMPHP/THREAD used with SYMFONY - Where does it have to be installed?

I am looking to implement the framework amphp/thread, with Symfony3, which I ve read about in this article (https://www.mullie.eu/parallel-processing-multi-tasking-php/).
I'd looked at the setting process on the git page: https://github.com/amphp/thread.
I've followed the checklist:
PHP5.5+ = OK Php 5.5.12
pecl/pthread = OK I did install it as explained on Windows8
Now, 3rd task on the checklist, I have the installation of the framework itself (amphp/thread) left to do.
I am a bit confuse, because it is not an "official" Symfony bundle. So I don't think I can put it under [my_symfony_project]/vendor/ and refer to it in the file [my_symfony_project]/app/AppKernel.php. So how do one do in this case:
Do one put the directory of the library under the root directory [my_symfony_project]?
And afterwards, how can one refer to it in the Symphony class/file, should I write: "use amphp/thread" between the namespace declaration of my Symfony file and the class code itself?
You can simply install the library with composer, as example launching this command from the root of your project:
>php composer.phar require amphp/thread
And use it in your code directly: the composer process generate the correct autoloader for you. No necessary add to the list of the Symfony2 bundle (is not a bundle).
Hope this help
You will need to install the package by adding the following to your composer.json file:
"require": {
"amphp/thread": "0.8.1"
}
Then run "composer install" on your server.

zend framework2 installation

I am trying to installing the library of the zend framework2.I have downloaded the skeleton application of zend framework2 and run the command in command prompt as in the zend framework installation guide on zend site but i am getting an error
it shows me an error could not open input file composer.phar
I checked the library which i have downloaded from git there is no composer.phar.There is only composer.json and a lock file of composer.I google out about this problem and find that it is due to open_ssl exention is disable in php.ini file.I checked the php.ini and found enabled.I am still getting the same error.
Regards to the official documentation for the skeleton application here
Github documentation it says
The easiest way to create a new ZF2 project is to use Composer. If you don't have it already installed, then please install as per the documentation.
with the documentation here
Composer documentation
And the Composer website here
Plus, from your screen behind your cmd line we can see this line taken from the website you show :
ZendSkeletonApplication is set up to use Composer (http://getcomposer.org) to resolve its dependencies. In this case, the dependency is Zend Framework 2 itself.
Composer is a soft his name is called composer.phar. It is what your looking for
go to C:\ProgramData\ComposerSetup\bin using command prompt then run composer cammands

installing cakephp 3 manually, without composer

I need to install CakePHP 3 in an old-fashioned upload-unzip-run way.
The archive I've downloaded from cakephp/cakephp/tags does not contain the default folders like webroot, Model etc., which means it's not complete.
The official documentation does not cover this. Here's a relevant Github issue I found, but the person ends up still using Composer.
There's also cakephp/app and it seems to include those missing files, but it's not mentioned in cakephp/cakephp's composer.json, and even if I download it I've no idea how to merge the packages.
Packaged app (cakephp/app) releases that include all dependencies (framework (cakephp/cakephp), standard CakePHP plugins (cakephp/debugkit, cakephp/bake, etc), required third party libraries) can be found on GitHub.
https://github.com/cakephp/cakephp/releases
It's the download with the small package symbol, named like cake-3-x-x.zip.
However, it isn't a good idea to ditch the dependency manager, as keeping the code base and the autoloader up to date will be rather tedious, and, no offense, I have my doubts that you'll be able to handle this properly if you don't even know how to stitch the app and cake packages together.
You can install CakePhp 3 without Composer.
You need minimum requirements to install CakePhp 3 and CakePhp 3 boilerplate ( fresh copy of Cakephp 3 ).
You can download CakePhp 3 boilerplate from github.
Requirements
Server
HTTP Server. For example: Apache. Having mod_rewrite is preferred,but by no means required.
PHP 5.4.16 or greater.
mbstring extension
intl extension
Database :
MySQL (5.1.10 or greater)
PostgreSQL
Microsoft SQL Server (2008 or higher)
SQLite 3
All built-in drivers require PDO. You should make sure you have the correct PDO extensions installed.
CakePhp 3 Boilerplate:
Repository Home
https://github.com/cakephp/cakephp/releases
CakePhp 3.1.4
https://github.com/cakephp/cakephp/releases/download/3.1.4/cakephp-3-1-4.zip
CakePhp 3.0.15
https://github.com/cakephp/cakephp/releases/download/3.0.15/cakephp-3-0-15.zip
Download one repository and unzip where you wanted to install it.
You may get one error like ( you may not get error if you are lucky!)
Fatal Error
Cake\Error\FatalErrorException
Error: Class 'Cake\Mailer\Email' not found
File D:\xampp\htdocs\practice\cakephp\cakephp-3-1-4\config\bootstrap.php
Line: 138
Then you have to comment two line in config/bootstrap.php
//Email::configTransport(Configure::consume('EmailTransport'));
//Email::config(Configure::consume('Email'));
And finally you got CakePhp 3 installed.
[I am also new in CakePhp 3.So Please inform me if there are any wrong in my given process.]
Thanks
Use Composer.
Install Composer locally, follow the Cake installation instructions, then upload the created folders to the target webhost.
Easy, For CakePHP 3.x you can just download the release you want from here
https://github.com/cakephp/cakephp/releases (eg. https://github.com/cakephp/cakephp/releases/tag/3.3.16).
For a complete installation select the first download link (.zip)
the other links are just for the src
Just run this command to get a clone of CakePHP 3.10.0
git clone -b 3.x git://github.com/cakephp/cakephp.git
Try simple steps
1. Download XAMPP Server.
2. Install XAMPP server.
3. Go to ..\xampp\php\php.ini and open.
4. Add this line (extension=php_intl.dll) or if exist uncomment.
5. Download Composer setup from https://github.com/composer/windows-setup/releases/
6. Install composer and give php.exe file in path
7. Open cmd and check now php version using command php -v. if its showing php version its means its working.
8. Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
9. Finished folder created in htdocs.

Categories