Welcome Guest, Not a member yet? Register   Sign In
file comparisons running app and those vendor
#1

(This post was last modified: 09-19-2024, 11:00 AM by captain-sensible. Edit Reason: more )

My understanding when running "composer update"  from the root of my web application is that new versions of files will end up in vendor. I can read the upgrading
but I can if i so wish also run commands like :
[andrew@darkstar Config]$  sdiff  /srv/http/CI4-CMS/app/Config/Email.php          /srv/http/CI4-CMS/vendor/codeigniter4/framework/app/Config/Email.php

[Image: CI4-sdiff.png]


and compare say config files being used in my web app and also those that are updated which I understand are in  vendor/codeigniter4/framework
SO in the image above i can validate yes there were some chnage but only comments. So far so good.
So it looks like I can poke around in vendor/codeigniter4/framework,and files with same name as that in my running web app should be comparable.
Now then my actual composer.json which started  quite a while back looks like :
Code:
{
    "name": "codeigniter4/appstarter",
    "description": "CodeIgniter4 starter app",
    "license": "MIT",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "support": {
        "forum": "https://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    },
    "require": {
        "php": "^8.1",
        "codeigniter4/framework": "4.5.5",
        "phpmailer/phpmailer": "^6.8"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9",
        "mikey179/vfsstream": "^1.6",
        "phpunit/phpunit": "^10.5.16"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Config\\": "app/Config/"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\Support\\": "tests/_support"
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "scripts": {
        "test": "phpunit"
    }
}







if i run composer for a new app stater eg
[andrew@darkstar Desktop]$ composer create-project codeigniter4/appstarter newApp
the composer.json file  looks like:

Code:
{
    "name": "codeigniter4/appstarter",
    "description": "CodeIgniter4 starter app",
    "license": "MIT",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "support": {
        "forum": "https://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    },
    "require": {
        "php": "^8.1",
        "codeigniter4/framework": "^4.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9",
        "mikey179/vfsstream": "^1.6",
        "phpunit/phpunit": "^10.5.16"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Config\\": "app/Config/"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\Support\\": "tests/_support"
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "scripts": {
        "test": "phpunit"
    }
}

So a new CI4 installation using composer is very close if not identical to what I have but if i go to :


/srv/http/CI4-CMS/vendor/codeigniter4/framework
composer.json looks like :

Code:
{
    "name": "codeigniter4/framework",
    "description": "The CodeIgniter framework v4",
    "license": "MIT",
    "type": "project",
    "homepage": "https://codeigniter.com",
    "support": {
        "forum": "https://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    },
    "require": {
        "php": "^8.1",
        "ext-intl": "*",
        "ext-mbstring": "*",
        "laminas/laminas-escaper": "^2.13",
        "psr/log": "^3.0"
    },
    "require-dev": {
        "codeigniter/coding-standard": "^1.7",
        "fakerphp/faker": "^1.9",
        "friendsofphp/php-cs-fixer": "^3.47.1",
        "kint-php/kint": "^5.0.4",
        "mikey179/vfsstream": "^1.6",
        "nexusphp/cs-config": "^3.6",
        "phpunit/phpunit": "^10.5.16 || ^11.2",
        "predis/predis": "^1.1 || ^2.0"
    },
    "suggest": {
        "ext-curl": "If you use CURLRequest class",
        "ext-dom": "If you use TestResponse",
        "ext-exif": "If you run Image class tests",
        "ext-fileinfo": "Improves mime type detection for files",
        "ext-gd": "If you use Image class GDHandler",
        "ext-imagick": "If you use Image class ImageMagickHandler",
        "ext-libxml": "If you use TestResponse",
        "ext-memcache": "If you use Cache class MemcachedHandler with Memcache",
        "ext-memcached": "If you use Cache class MemcachedHandler with Memcached",
        "ext-mysqli": "If you use MySQL",
        "ext-oci8": "If you use Oracle Database",
        "ext-pgsql": "If you use PostgreSQL",
        "ext-readline": "Improves CLI::input() usability",
        "ext-redis": "If you use Cache class RedisHandler",
        "ext-simplexml": "If you format XML",
        "ext-sodium": "If you use Encryption SodiumHandler",
        "ext-sqlite3": "If you use SQLite3",
        "ext-sqlsrv": "If you use SQL Server",
        "ext-xdebug": "If you use CIUnitTestCase::assertHeaderEmitted()"
    },
    "autoload": {
        "psr-4": {
            "CodeIgniter\\": "system/"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "scripts": {
        "test": "phpunit"
    }
}


doesnt look right to me, where is my slightly amended composer.json file located to look at when things change ?
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#2

Packet appstarter and framework different.
the composer for the framework will not match. You are trying to compare different -  package and project files.
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply
#3

i could now and again just create a new app starter and see if there is any significant code difference . I could also compare all files against what I have . If i did that what is the point of having
Code:
[andrew@darkstar ~]$ cd /srv/http/CI4-CMS/vendor
[andrew@darkstar vendor]$ tree -L 2 codeigniter4
codeigniter4
└── framework
    ├── LICENSE
    ├── README.md
    ├── app
    ├── composer.json
    ├── env
    ├── phpunit.xml.dist
    ├── preload.php
    ├── public
    ├── spark
    ├── system
    ├── tests
    └── writable

7 directories, 7 files
[andrew@darkstar vendor]$
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply
#4

Ok. Install CI4 as root - with system dir. git clone https://github.com/codeigniter4/framework.git ci4-root
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB