PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label version. Show all posts
Showing posts with label version. Show all posts

Tuesday, December 6, 2022

[FIXED] How do I require a specific version of a ruby gem?

 December 06, 2022     gem, oci8, ruby, version     No comments   

Issue

Specifically, the ruby-oci8 gem. I have both 1.0.7 and 2.0.4 installed. I want 1.0.7.

I can just require oci8, but I don't get the version I want.

irb(main):001:0> require 'oci8'
=> true
irb(main):002:0> OCI8::VERSION
=> "2.0.4"

I can require using the full path to the file, which works, but is not going to be portable:

irb(main):001:0> require 'C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-1.0.7-x86-mswin32-60\lib\oci8'
=> true
irb(main):002:0> OCI8::VERSION
=> "1.0.7"

I can use the gem command to ask for the version I want, but it doesn't appear to actually load the library:

irb(main):001:0> gem 'ruby-oci8', :lib=>'oci8', :version=>'=1.0.7'
=> true
irb(main):002:0> OCI8::VERSION
NameError: uninitialized constant OCI8
    from (irb):2

I would definitely favor this last approach if would load the library, rather than just confirming that it's present on my system. What am I missing?


Solution

My problem was twofold:

1) confusing gem command syntax with that used in config.gem lines in a rails environment.rb configuration file.

2) failing to issue a require command after the gem command.

Proper usage in a script is:

gem 'ruby-oci8', '=1.0.7'
require 'oci8'           # example is confusing; file required (oci8.rb) is not 
                         # same name as gem, as is frequently the case

Proper usage in a rails 2.3.x environment.rb file is:

config.gem "ruby-oci8", :version=>'1.0.7'

Thanks to the folks at http://www.ruby-forum.com/topic/109100



Answered By - KenB
Answer Checked By - Mary Flores (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Sunday, July 31, 2022

[FIXED] How do I skip a carrierwave store callback when processing versions

 July 31, 2022     callback, carrierwave, file-upload, ruby-on-rails, version     No comments   

Issue

I have a callback defined in my video uploader class of carrierwave
after :store, :my_method
and I have three versions of the files. original,standard,low

my_method executes when each version is processed ie, three times, I just need the callback to execute once.


Solution

I know this is a very late response but I was just having the same problem lately so I decided to post how I solved this "problem" since it seems it isn't documented on carrierwave's github page (or I wasn't able to find it anyway).

Ok, regarding the after :store, :my_method callback if you place it in the "main body" of your uploader class, then it's going to be executed every single time a file is stored, so in your case I think it even executes not only for your 3 versions but for your original file as well.

Let's say the following code defines your carrierwave uploader:

class PhotoUploader < CarrierWave::Uploader::Base
  after :store, :my_method

  version :original do
    process :resize_to_limit => [1280,960]
  end

  version :standard, from_version: :original do
    process :resize_to_limit => [640,480]
  end

  version :low, from_version: :standard do
    process :resize_to_limit => [320,240]
  end

  protected
    def my_method
      puts self.version_name
    end
end

That way, the after :store is going to be executed for every file stored, but if you only want it to be executed, let's say, for the :low version, all you have to do is to move that line inside your version definition. Like this:

class PhotoUploader < CarrierWave::Uploader::Base

  version :original do
    process :resize_to_limit => [1280,960]
  end

  version :standard, from_version: :original do
    process :resize_to_limit => [640,480]
  end

  version :low, from_version: :standard do
    process :resize_to_limit => [320,240]
    after :store, :my_method
  end

  protected
    def my_method
      puts self.version_name
    end
end

I tested it on my code and it works... I know it's been a long time since you posted this question and probably you arrived at the same solution as me. So I decided to answer it for future reference for anyone getting the same problem.



Answered By - Abraham Milano
Answer Checked By - Timothy Miller (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, July 22, 2022

[FIXED] What is the last stable version of php 5.4

 July 22, 2022     php, php-5.4, version     No comments   

Issue

Im currently working on php 5.3.13, and im thinking to upgrade my system for woocommerce im wondering what is the stable version in php 5.4? Is it 5.4.44?


Solution

The LAST stable version of PHP 5.4 was 5.4.45, released at 09/2015.

You can get this info or download the files here.

The two CURRENT stable versions are PHP 7.0.11 and 5.6.26.



Answered By - Marcel
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, July 4, 2022

[FIXED] which fuse version in my kernel?

 July 04, 2022     fuse, kernel, linux, package, version     No comments   

Issue

I want to know which fuse version do I have, when attempting to execute:

locate -i -r /fuse

I get:

/lib/modules/3.0.0-12-generic/kernel/fs/fuse
/lib/modules/3.0.0-12-generic/kernel/fs/fuse/cuse.ko
/lib/modules/3.0.0-32-generic/kernel/fs/fuse
/lib/modules/3.0.0-32-generic/kernel/fs/fuse/cuse.ko
/usr/include/fuse
/usr/include/fuse.h
/usr/include/fuse/cuse_lowlevel.h
/usr/include/fuse/fuse.h
/usr/include/fuse/fuse_common.h
/usr/include/fuse/fuse_common_compat.h
/usr/include/fuse/fuse_compat.h
/usr/include/fuse/fuse_lowlevel.h
/usr/include/fuse/fuse_lowlevel_compat.h
/usr/include/fuse/fuse_opt.h
/usr/include/linux/fuse.h
/usr/lib/pkgconfig/fuse.pc
/usr/share/app-install/desktop/fuse-emulator-gtk:fuse-gtk.desktop
/usr/share/app-install/desktop/fuse-emulator-sdl:fuse-sdl.desktop
/usr/share/app-install/icons/fuse.png
/usr/share/doc/fuse-utils
/usr/share/doc/libfuse-dev/examples/fusexmp.c
/usr/share/doc/libfuse-dev/examples/fusexmp_fh.c
/usr/share/initramfs-tools/hooks/fuse_utils
/usr/share/lintian/overrides/fuse-utils
/usr/share/man/man1/fuser.1.gz
/usr/share/man/man1/fusermount.1.gz
/usr/src/linux-headers-3.0.0-12/fs/fuse
/usr/src/linux-headers-3.0.0-12/fs/fuse/Kconfig
/usr/src/linux-headers-3.0.0-12/fs/fuse/Makefile
/usr/src/linux-headers-3.0.0-12/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-12-generic/include/config/fuse
/usr/src/linux-headers-3.0.0-12-generic/include/config/aufs/br/fuse.h
/usr/src/linux-headers-3.0.0-12-generic/include/config/fuse/fs.h
/usr/src/linux-headers-3.0.0-12-generic/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-32/fs/fuse
/usr/src/linux-headers-3.0.0-32/fs/fuse/Kconfig
/usr/src/linux-headers-3.0.0-32/fs/fuse/Makefile
/usr/src/linux-headers-3.0.0-32/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-32-generic/include/config/fuse
/usr/src/linux-headers-3.0.0-32-generic/include/config/aufs/br/fuse.h
/usr/src/linux-headers-3.0.0-32-generic/include/config/fuse/fs.h
/usr/src/linux-headers-3.0.0-32-generic/include/linux/fuse.h
/var/lib/dpkg/info/fuse-utils.conffiles
/var/lib/dpkg/info/fuse-utils.list
/var/lib/dpkg/info/fuse-utils.md5sums
/var/lib/dpkg/info/fuse-utils.postinst
/var/lib/dpkg/info/fuse-utils.postrm
/var/lib/dpkg/info/fuse-utils.preinst

Any idea where the information I need is located ?


Solution

You can get the version of the fusermount utility like this:

fusermount -V


Answered By - jdlourenco
Answer Checked By - Katrina (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] which fuse version in my kernel?

 July 04, 2022     fuse, kernel, linux, package, version     No comments   

Issue

I want to know which fuse version do I have, when attempting to execute:

locate -i -r /fuse

I get:

/lib/modules/3.0.0-12-generic/kernel/fs/fuse
/lib/modules/3.0.0-12-generic/kernel/fs/fuse/cuse.ko
/lib/modules/3.0.0-32-generic/kernel/fs/fuse
/lib/modules/3.0.0-32-generic/kernel/fs/fuse/cuse.ko
/usr/include/fuse
/usr/include/fuse.h
/usr/include/fuse/cuse_lowlevel.h
/usr/include/fuse/fuse.h
/usr/include/fuse/fuse_common.h
/usr/include/fuse/fuse_common_compat.h
/usr/include/fuse/fuse_compat.h
/usr/include/fuse/fuse_lowlevel.h
/usr/include/fuse/fuse_lowlevel_compat.h
/usr/include/fuse/fuse_opt.h
/usr/include/linux/fuse.h
/usr/lib/pkgconfig/fuse.pc
/usr/share/app-install/desktop/fuse-emulator-gtk:fuse-gtk.desktop
/usr/share/app-install/desktop/fuse-emulator-sdl:fuse-sdl.desktop
/usr/share/app-install/icons/fuse.png
/usr/share/doc/fuse-utils
/usr/share/doc/libfuse-dev/examples/fusexmp.c
/usr/share/doc/libfuse-dev/examples/fusexmp_fh.c
/usr/share/initramfs-tools/hooks/fuse_utils
/usr/share/lintian/overrides/fuse-utils
/usr/share/man/man1/fuser.1.gz
/usr/share/man/man1/fusermount.1.gz
/usr/src/linux-headers-3.0.0-12/fs/fuse
/usr/src/linux-headers-3.0.0-12/fs/fuse/Kconfig
/usr/src/linux-headers-3.0.0-12/fs/fuse/Makefile
/usr/src/linux-headers-3.0.0-12/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-12-generic/include/config/fuse
/usr/src/linux-headers-3.0.0-12-generic/include/config/aufs/br/fuse.h
/usr/src/linux-headers-3.0.0-12-generic/include/config/fuse/fs.h
/usr/src/linux-headers-3.0.0-12-generic/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-32/fs/fuse
/usr/src/linux-headers-3.0.0-32/fs/fuse/Kconfig
/usr/src/linux-headers-3.0.0-32/fs/fuse/Makefile
/usr/src/linux-headers-3.0.0-32/include/linux/fuse.h
/usr/src/linux-headers-3.0.0-32-generic/include/config/fuse
/usr/src/linux-headers-3.0.0-32-generic/include/config/aufs/br/fuse.h
/usr/src/linux-headers-3.0.0-32-generic/include/config/fuse/fs.h
/usr/src/linux-headers-3.0.0-32-generic/include/linux/fuse.h
/var/lib/dpkg/info/fuse-utils.conffiles
/var/lib/dpkg/info/fuse-utils.list
/var/lib/dpkg/info/fuse-utils.md5sums
/var/lib/dpkg/info/fuse-utils.postinst
/var/lib/dpkg/info/fuse-utils.postrm
/var/lib/dpkg/info/fuse-utils.preinst

Any idea where the information I need is located ?


Solution

You can get the version of the fusermount utility like this:

fusermount -V


Answered By - jdlourenco
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, May 9, 2022

[FIXED] How to do version numbers?

 May 09, 2022     product, version     No comments   

Issue

My company is building a product. It's going to be versioned by SVN. It's a webapp so basically there will never be a version out which doesn't have some features in them and thus could always be labeled as beta. But since it's going to be a corporate product I really don't want the "unstable watchout" on there. So how would you go about versioning? Is 1.0 stable? Should the build date be in the version number? Tell me what you guys think!


Solution

[major].[minor].[release].[build]

major: Really a marketing decision. Are you ready to call the version 1.0? Does the company consider this a major version for which customers might have to pay more, or is it an update of the current major version which may be free? Less of an R&D decision and more a product decision.

minor: Starts from 0 whenever major is incremented. +1 for every version that goes public.

release: Every time you hit a development milestone and release the product, even internally (e.g. to QA), increment this. This is especially important for communication between teams in the organization. Needless to say, never release the same 'release' twice (even internally). Reset to 0 upon minor++ or major++.

build: Can be a SVN revision, I find that works best.

Examples
My current chrome: 83.0.4103.61



Answered By - Assaf Lavie
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, March 8, 2022

[FIXED] Can composer display git commits while in stable mode?

 March 08, 2022     composer-php, git-commit, updates, version     No comments   

Issue

When running composer update -v in a project with "minimum-stability": "dev", we can see the latest commits to the package being updated:

composer update -v
...
Extracting archive  - Updating organization/project (v1.0.0 => v1.0.1):  Checking out hash3
    Pulling in changes:
      hash3 - Contributor #1: Improve service
      hash2 - Contributor #2: Improve SQL query
      hash1 - Contributor #3: Hotfix service

This is helpful because it gives us some hints on what code was changed.

However, now that our project is in "minimum-stability": "stable" mode, when running composer update -v, we can no longer see the latest commits to the package being updated:

composer update -v
...
Updates: organization/project:v1.0.2
 - Updating organization/project (v1.0.1 => v1.0.2): Downloading (100%)

No git commits are shown. We have tried using composer update -vv and composer update -vvv to no avail.

Therefore, is it possible to still show git commits when updating a package while in stable mode?


Solution

One possible solution is to delete all installed packages in the /vendor directory, and then re-install them using:

composer install --prefer-source

All of the same packages will be installed along with their respective .git directories.

Then, the next time you run

composer update -v

since the .git directory exists for each package, you will see the latest commits that are pulled in.

However, this solution would not work in a production environment in which deleting files in the /vendor directory, even temporarily, would not be an option.



Answered By - Leo Galleguillos
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, February 18, 2022

[FIXED] Install RC1 version with composer for Drupal 8 module

 February 18, 2022     composer-php, drupal-8, installation, module, version     No comments   

Issue

I need to install a specific RC1 version for a Drupal 8 module with composer.

Example: https://www.drupal.org/project/field_group (8.x-3.0-rc1)

I've tried to use the constraint: '8.x-3.0-rc1'.

composer require drupal/field_group:8.x-3.0-rc1

The error message:

[UnexpectedValueException]
Could not parse version constraint 8.x-composer: Invalid version string "8.x-composer"

Solution

You can specify the version of the module / theme you want to download as follows:

composer require drupal/<modulename>:<version>

For example:

composer require 'drupal/token:^1.5'
composer require 'drupal/simple_fb_connect:~3.0'
composer require 'drupal/ctools:3.0.0-alpha26'
composer require 'drupal/field_group:3.0-rc1'
composer require 'drupal/token:1.x-dev'

To avoid problems on different terminals/shells, surround the version in quotes as in the examples above. In these examples, the versions map as follows:

  • ^1.5: maps to the latest stable 8.x-1.x release of the module.
  • ~3.0: maps to the latest stable 8.x-3.x release of the module.
  • 3.0.0-alpha26: maps to version 8.x-3.0-alpha26
  • 3.0-rc1: maps to version 8.x-3.0-rc1
  • 1.x-dev: maps to 8.x-1.x-dev

For more on version constraints with ~ (tilde) and ^ (caret) see Next Significant Release Operators.



Answered By - Kevin Wenger
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, February 9, 2022

[FIXED] php version mismatch with composer

 February 09, 2022     apache, composer-php, cpanel, php, version     No comments   

Issue

I want to install php dependencies in a shared-hosting server, but composer says my php version is 5.6.40 (too old for my dependencies), It was true, so I set the php version from cpanel to 7.3.23 with something called "MultiPHP manager". All right, until I retried to run composer install, composer keep saying that my php version is 5.6.40.

Then I checked the phpinfo() in a dummy page and it says my version is 7.3.23. Also I ran php -v and the output says my version is 7.3.23.

I tried

  • reload httpd
  • run composer update and composer self-update but it says allow_url_fopen is disabled, but I enabled it with a cpanel tool called "MultiPHP INI editor", and phpinfo() says that is enabled.

Someone can tell me if im doing something wrong? or how does composer can't use the updated php?


Solution

Your cli php version (the one you are using for your composer install) and the php version your apache is running in your server (the one you see in your phpinfo() page) might not match.

Try running this in your console:

$ php -v

This would output the version you are actually using when running your composer install

To run the same version in your server, you might need to locate the PHP 7 binary on your machine (maybe /usr/bin/php7.3, you could try to execute a $ whereis php), then:

/usr/bin/php7.3 /usr/local/bin/composer install

This was assuming that your composer binary is under /user/local/bin/composer, modify as need.



Answered By - Héctor Paúl Cervera-García
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Saturday, January 22, 2022

[FIXED] Version numbers with caret and tilde in composer.json

 January 22, 2022     composer-php, version     No comments   

Issue

I wonder what is the difference between caret and tilde in composer.json. Can I say it like this: caret (^) lock the first and the second version number (the 1.2 in 1.2.3) and tilde(~) lock only the first version number (the 1 in 1.2.3)?

https://getcomposer.org/doc/articles/versions.md#next-significant-release-operators


Solution

From the documentation you linked:

~1.2 is equivalent to >=1.2 <2.0.0, while ~1.2.3 is equivalent to >=1.2.3 <1.3.0

^1.2.3 is equivalent to >=1.2.3 <2.0.0

The tilde depends on how many digits in the version number are given. The last digit given can vary.

The caret is almost always the better choice because it acts similarly enough to be a direct replacement (~1.2 is the same as ^1.2 or ^1.2.0), but offer better flexibility when addressing non-zero patch versions (^1.2.3 is NOT the same as ~1.2.3, because the tilde version only allows updates below 1.3.0, the caret allows updates below 2.0.0).

The only reason why one would use the tilde as version requirement is if you have to deal with "zero" versions that get compatible updates. The tilde does not differ between ~0.1 and ~1.1, in both cases it will allow updates up to the next major version number (below 1.0 or 2.0 respectively). The caret operator will disallow minor updates in this range: ^0.1 does not allow updates to 0.2, because in semantic versioning a zero-dot-something version may introduce incompatible changes when going to zero-dot-something+1.

Summary:

  • Prefer the caret operator - it's the easiest way to force minimum patch versions.
  • Prefer versions above 0.x (start with 1.0.0) and use semantic versioning for your own code.
  • For the development phase, you can use alpha, beta or rc stability together with the intended final version, i.e. 1.0.0-alpha1 would be a rough outline of what 1.0.0 will be in the future.


Answered By - Sven
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, January 17, 2022

[FIXED] Required dependencies not updating

 January 17, 2022     composer-php, php, version, versioning     No comments   

Issue

I'm updating some packages with composer. I'm using Laravel5.6 in my project.

The one that I'm trying is PHPStan to version 0.10.7. My current version is 0.9.2.

The problem

When I try to update, it shows a success message, but when checking the outdate packages output, it is still OUTDATED.

What I've tried

Using composer why-not phpstan/phpstan 0.10.7 gave me the following output:

laravel/laravel  my-branch-test  requires (for development)  phpstan/phpstan (^0.9.2)                      
phpstan/phpstan  0.10.7          requires                    nikic/php-parser (^4.0.2)                     
laravel/laravel  my-branch-test  does not require            nikic/php-parser (but v3.1.5 is installed)    
phpstan/phpstan  0.10.7          requires                    phpstan/phpdoc-parser (^0.3)                  
laravel/laravel  my-branch-test  does not require            phpstan/phpdoc-parser (but 0.2 is installed)  

Then I tried to update nikic/php-parser and phpdoc-parser and re-run composer update phpstan/phpstan but it gave me the same result of before. (not updating)

UPDATE: running composer update phpstan/phpstan --with-dependencies gave me the following output:(but still didn't updated phpstan)

composer update phpstan/phpstan --with-dependencies
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)                              
Package operations: 0 installs, 11 updates, 0 removals
  - Updating ocramius/package-versions (1.2.0 => 1.3.0): Loading from cache
  - Updating symfony/finder (v4.1.4 => v4.2.1): Loading from cache
  - Updating symfony/polyfill-mbstring (v1.9.0 => v1.10.0): Loading from cache
  - Updating jean85/pretty-package-versions (1.1 => 1.2): Loading from cache
  - Updating nette/utils (v2.4.9 => v2.5.3): Loading from cache
  - Updating nette/php-generator (v3.0.2 => v3.0.5): Loading from cache
  - Updating nette/neon (v2.4.2 => v2.4.3): Loading from cache
  - Updating nette/di (v2.4.10 => v2.4.14): Loading from cache
  - Updating nette/bootstrap (v2.4.5 => v2.4.6): Loading from cache
  - Updating nette/finder (v2.4.1 => v2.4.2): Loading from cache
  - Updating nette/robot-loader (v3.0.3 => v3.1.0): Loading from cache
Package sebastian/git is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: caffeinated/modules
Discovered Package: fideloper/proxy
Discovered Package: jenssegers/agent
Discovered Package: laravel/tinker
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: rcrowe/twigbridge
Package manifest generated successfully.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class

Code

In my composer.json file, the package is listed as:

"require-dev": {
    "phpstan/phpstan": "^0.9.2",

Any ideas?


Solution

The problem here was that others packages that I was using were using the nikic/php-parser package too, but considering only non-breaking changes (nikic/php-parser":"^3.0"), "blocking" the upgrade to > 4.0.

Because of composer can't install two versions of the same package, my solution was not updating phpstan for now.

I will wait for the libs that require nikic/php-parser to update their requirements to 4.0 and up or will change these packages in the future.



Answered By - Lioo
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, January 11, 2022

[FIXED] How to find out the version number in cakephp v3.0?

 January 11, 2022     cakephp, cakephp-3.0, php, version     No comments   

Issue

I have a set of code using cakephp v3 but don't know exactly which version of 3 it is based on. How can I find this out?

EDIT: There is a somewhat duplicate question but not exactly the same. This question relates specifically to ver3


Solution

The version can be found in

vendor\cakephp\cakephp\VERSION.txt

OR

echo Configure::version();



Answered By - user781486
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing