All Questions
405
questions
949
votes
5
answers
470k
views
What is thread safe or non-thread safe in PHP?
I saw different binaries for PHP, like non-thread or thread safe?
What does this mean?
What is the difference between these packages?
54
votes
1
answer
16k
views
What is the difference between PEAR and Composer?
PEAR is used to install a PHP software package and Composer is used for the same thing. I believe Composer handles dependencies better but is that the only difference? Can anybody explain the ...
51
votes
8
answers
46k
views
Can't get composer "path" repository to work
I have a directory structure like so:
composer.json < Main
packages/
balunker/
testpackage/
composer.json < Package
src/
TestPackage.php
The main composer....
44
votes
2
answers
24k
views
Using a non-laravel package on Laravel 4
Is it possible to include a package that was not specifically designed for L4 in the framework?
If so, how is it done? I know I need to add the package to my composer.json which adds it to the vendor ...
39
votes
7
answers
76k
views
GPG keys issue while installing mysql-community-server
While Installing mysql-community-server getting bellow error:
Command:
sudo yum install mysql-community-server
Error:
warning: /var/cache/yum/x86_64/2/mysql57-community/packages/mysql-community-libs-...
31
votes
2
answers
45k
views
Puppet : Specifying a version of a package to install
Apparently this is not possible, but I can't believe that I'm the only one who need it.
I want to specify the version of php to install because I'm working on an old project requiring php 5.2.
...
26
votes
1
answer
10k
views
When creating a composer package, what "Package Type" should I choose
I'm creating my first PHP Composer package (following these instructions).
I've run
$ composer init
and am filling in the details, it is now asking me for
Package Type (e.g. library, project, ...
24
votes
3
answers
12k
views
How create version of a package on github and packagist? PHP Specific
I created a package for laravel 4 framework and pushed it on github and packagist.
For installing it, it require the dev-master version on my composer, but I would like have it as version 1.0 how can ...
23
votes
3
answers
2k
views
How to simulate Accept header in a test within a Laravel 5 package?
I'm currently building a Laravel package that injects a new method in Illuminate\Http\Request via Macros. The method I'm injecting has been completed and is expected to work nicely, but I also want to ...
21
votes
7
answers
59k
views
Laravel league/flysystem getting file URL with AWS S3
I am trying to build a file management system in Laravel based on league/flysystem: https://github.com/thephpleague/flysystem
I am using the S3 adapter and I have it working to save the uploaded ...
20
votes
7
answers
24k
views
Laravel 5 register middleware from in package service provider
I'm currently developing a package in/for Laravel 5.
My package contains a custom middleware and I would like to add it to the $routeMiddlewarearray of the Kernel class from in my package Service ...
20
votes
3
answers
17k
views
Package sensio/framework-extra-bundle is abandoned
when I wanted to upgrade symfony from 6.1 to 6.2, I saw this message:
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
I want to know how to do it ...
20
votes
4
answers
40k
views
How does one easily add posix support to PHP using yum?
I am running CentOS 5.2 and using yum to manage packages. I have had little luck installing php-posix but know with almost 100% certitude that it is a real and available package...somewhere. Has ...
18
votes
3
answers
13k
views
How to get the root package path using composer
I'm developing a PHP component called php-app-config using composer.
This component, once required by another project, and installed using composer install, should look for config files inside the ...
18
votes
1
answer
9k
views
List installed packages in channel
With PHP's PEAR, how can I check whether package foo in channel bar is already installed? (Assuming that the channel bar is available, and has already been "discovered".) Something like pear list ...
17
votes
10
answers
64k
views
can't install php-devel on centos
I need help with installation of php-devel (I need it, cause it has phpize, which is necessary to install eAccelerator). But when I try to install php-devel with yum install php-devel it gives me the ...
17
votes
5
answers
32k
views
Cannot Install Laravel Package - Intervention Image
So I am following the tutorial on tuts+ Premium from Jeffrey Way - Creating an Ecommerce App in Laravel 4 and I am stuck with this problem. He is installing a package by just editing the composer.json ...
15
votes
1
answer
7k
views
How to access other input attributes in Validator::extend?
As the question title states:
How can you access other input attributes when using Validator::extend?
Upon inspecting Laravel's built-in Validator class, I can see it uses $this->data to access ...
14
votes
7
answers
51k
views
Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object
I'm building a package in Laravel 4 but am getting a non-object error when attempting to access the db from which seems to be a properly instantiated object. Here's the setup:
The config and class in ...
14
votes
1
answer
12k
views
How to configure a composer package to be globally installed?
I'm trying to make a little CLI tool and package it up with composer.
Below is an extremely simplified version of the program, but it's enough to demonstrate the problem I'm encountering.
The project ...
13
votes
5
answers
20k
views
How to register console command from package in Laravel 5?
Since Laravel 5, it is interest to me - how to register and use console command from package in Laravel 5.
As in laracast discuss https://laracasts.com/discuss/channels/tips/developing-your-packages-...
13
votes
2
answers
45k
views
Installing apache 2.4 and php 5.5 on ubuntu 12.04
I'm trying to set a test enviroment with apache 2.4 and php 5.5 on a vm with ubuntu 12.04, fist thing is to add the repositories
apt-add-repository ppa:ptn107/apache
apt-add-repository ppa:ondrej/...
13
votes
2
answers
3k
views
Packing and deploying Symfony web site
I'm new to Symfony, coming from .NET world. Using Symfony (4) documentation, I managed to create simple web site. Now I want to put it to live, but I'm struggling to find any useful information what ...
12
votes
3
answers
5k
views
Zend Framework Composer Packages
I would like to add dependency to zendframework/zend-db package, so I added it to my composer.json:
"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework....
11
votes
1
answer
28k
views
How to generate laravel composer.json from a vendor directory? [duplicate]
In my Laravel project the composer.json and composer.lock files were deleted and I don't know how to rebuild the composer.json file from an existing vendor directory .
11
votes
2
answers
4k
views
PHP friend/package visibility
Is there any way to limit the visibility in PHP in the same way as "package" visibility works in Java or at least "friend" visibility in C++? What's the best practice to maintain large OOP project and ...
9
votes
5
answers
30k
views
PEAR package install fails
i try to install packages from pear.phpqatools.org/phpqatools
First of all command pear config-get php_dir returns D:\Users\xampp\php\pear
and I do not have rights to install on C drive.
Then ...
9
votes
2
answers
19k
views
"Class 'XMLWriter' not found" Error in php | php55w-xml-5.5.24-1.w6.x86_64.rpm is missing
I am getting this error in PHP in server Fatal Error (E_ERROR): Class 'XMLWriter' not found . we are using Cent OS 6
After exploring some sites, we found that we need to install php55w-xml-5.5.24-1....
8
votes
3
answers
946
views
Optimal extended class naming convention?
Which of the following naming conventions is most used/accepted, or which is most optimal for most projects? I'm having a hard time deciding.
Base class: \Model
Sub class: \Model\User
Base class: \...
7
votes
1
answer
15k
views
I am missing simplexml on my ubuntu machine but I can't download it
so I get the following error while installing Pterodactyl panel:
Problem 1
- Installation request for aws/aws-sdk-php ^3.156 -> satisfiable by aws/aws-sdk-php[3.156.0].
- aws/aws-sdk-php 3.156.0 ...
7
votes
2
answers
3k
views
PHP Packaging/Deployment [closed]
What is a good way to package a web application in PHP for easy deployment? Currently, I am using make to generate a gzipped tar file. In Java, most people use Maven and build WARs. I wonder if there ...
7
votes
3
answers
2k
views
Can php source code package a library like the java .jar?
I package my source code in Java using .jar. Is there any things like that in php?? Thank you.
7
votes
2
answers
1k
views
Laravel - Package can't recognise Auth functions?
I made a package which is counting the visitors on a webpage. Currently I have a single route, controller and view which don't do very much other than display a simple string. I have a separate ...
7
votes
1
answer
3k
views
Laravel use custom USER-Model in package
I´ve developed a package stored in LaravelRoot/packages/myname/project/ in Laravel.
Inside my package i´ll have to use an extended user-model containing a relationship not mentioned in the default ...
7
votes
1
answer
5k
views
Purpose of PHP Debug Pack
There is a debug pack listed under downloads on the official php site.
Is it intended for developers of the php core/runtime and therefore to debug php itself?
Or is it intended for the general php ...
6
votes
8
answers
22k
views
Publishing config and migrations from included package in Laravel
I'm using Laravel to build a package which will include some Admin functionality and will include some other packages.
I have included a package which has migrations and a config file, But how do I ...
6
votes
2
answers
6k
views
Laravel package reading package config file and not published config file
I have created a Laravel package, uploaded it to packagist and managed to install it using composer require.
I have now hit a problem and I don't know how to fix it and doing a search does not help.
...
6
votes
1
answer
4k
views
Laravel error Uncaught exception 'ReflectionException' with message 'Class App\Http\Kernel does not exist'
When I wanted to add form in my laravel 5.2 project I got some errors in composer.
After that My whole project got a strange error bellow :
Fatal error: Uncaught exception 'ReflectionException' ...
6
votes
1
answer
2k
views
Using other packages inside my laravel package [closed]
I created a package with the artisan workbench command.
Everything works fine, but I want to use another composer package inside my package.
What's the best/cleanest way to do that?
6
votes
2
answers
529
views
Is there a way to exclude a route from CSRF protection from within a package in Laravel 5?
I am aware of the $except property of the VerifyCsrfToken middleware (app/Http/Middleware/VerifyCsrfToken.php) but I am looking for a way to do something similar from my package (so the users who ...
4
votes
1
answer
1k
views
Why are traits sometimes grouped as "concerns" in PHP packages?
When looking through package source files, I often see a folder titled "concerns" that seems to exclusively house trait files. A few examples:
Pest PHP
Spatie Ray
Laravel Octane
While ...
4
votes
2
answers
4k
views
what is the difference between an API and a package?
We need an API for a PHP project but the API(OMDB API) is not for free so we looked for an alternative and saw this package called imdbphp(https://packagist.org/packages/imdbphp/imdbphp). Is this ...
4
votes
1
answer
12k
views
Creating a new ServiceProvider / Facade as a package in Laravel 5
Introduction
I've never worked with a framework before (Zend, CakePHP, etc) and finally decided to sit down and learn one. I'm starting with Laravel because the code looks pretty and unlike some ...
4
votes
2
answers
2k
views
How to load a PEAR package
I've just installed a PEAR package (Event_Dispatcher) and I can't use the classes in that package. When I run the command pear list I see the new package, however I see that the classes in the package ...
4
votes
2
answers
239
views
How to make vendor package classes being extendable with PSR-4 autoloading?
I'm using Laravel as framework to build an application framework which can be used to build their own application by fellow developers.
Now I'm running into a little PSR-4 namespacing problem in the ...
4
votes
1
answer
2k
views
Laravel package session variable not saving with ajax call
I'm building a package called under-construction. When this package is activated in a config
file the site will be underconstruction only people with the right code can access the
application.
...
4
votes
2
answers
4k
views
Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found Laravel passport
Hello everyone i'm using sfelix-martins/passport-multiauth Based on laravel passport
I'm getting this error
{message: "Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found",…}
...
4
votes
2
answers
3k
views
Message: Class 'Illuminate\Database\Capsule\Manager' not found in Codeigniter3.1
I have try to configuration Codeigniter3.1 with Illuminate to use ORM but finally I got this errors as below.
An uncaught Exception was encountered
Type: Error
Message: Class 'Illuminate\Database\...
4
votes
2
answers
1k
views
Laravel controllers and routes in packages?
I'm having trouble registering controllers to routes in my package.
As far as I understand from the official documentation I just need to simply prefix it and use my namespace though I always get the ...
4
votes
3
answers
530
views
How to package a PHP application\script?
I have a script that uses php and curl to auto logon to a site and perform some actions.
That bit is ok but I now want to send the script to other people so they can use it.
So I can create a batch ...