using tcpdf in zend framework 2 - zend-framework2

my composer.json file look like this
.....
"require": {
"php": ">=5.5",
"zendframework/zendframework": "2.5.1",
"doctrine/doctrine-orm-module": "0.7.*",
"zendframework/zend-developer-tools": "dev-master",
"zendframework/zftool": "dev-master",
"tecnickcom/tcpdf" : "dev-master"
}...
and now updating composer updaing the tcpdf directory and download all the files but i am unable to create new instance by new tcpdf(); or with new \tcpdf();
the error says
Class '\tcpdf' not found in S:\xampp...

Related

Rollup configuring alias for semantic-ui-less #import

I have been configuring rollup for creating custom react component library on top of fomantic-ui.
I have already setup the rollup.config.js
ALthough in the configuration, I need to resolve an import:
#import (multiple) '../../theme.config';
the import is part of fomantic-ui-less library, which needs to be resovled to:
path.join(__dirname, '/themes/theme.config')
and I do have themes/theme.config at my project root.
when I run build command it throws following error:
[!] (plugin postcss) Error: '../../theme.config' wasn't found. Tried - E:\Projects\UILibrary\node_modules\fomantic-ui-less\theme.config,..\..\theme.config
and I have used the rollup-plugin-postcss plugin and #rollup/plugin-alias, and called it inside plugins array
...
plugins: [
...
alias({
entries: [
find: '../../theme.config$',
replacement: path.join(__dirname, '/themes/theme.config')
]
})
postcss(),
...
]
I have also tried changing the order of plugins.
And the worst part is, it is working when configuring the storybook, using webpack alias.
.storybook/main.js
webpackFinal: async (config) => {
config.resolve.alias = {
"../../theme.config$": path.join(__dirname, "../themes/theme.config")
}
...
}

Custom CSS not working with CSS Bundling for Rails 7

Playing around with Rails 7 and I don't understand why my custom CSS is not working.
I built new rails app with flag for Bootstrap, which is working fine (CSS and JS, tested with bootstrap modal). These are my default config files:
application.js
// Entry point for the build script in your package.json
import "#hotwired/turbo-rails"
import "./controllers"
import * as bootstrap from "bootstrap"
application.bootstrap.scss
#import 'bootstrap/scss/bootstrap';
package.json
{
"name": "app",
"private": "true",
"dependencies": {
"#hotwired/stimulus": "^3.0.1",
"#hotwired/turbo-rails": "^7.1.0",
"#popperjs/core": "^2.11.2",
"bootstrap": "^5.1.3",
"esbuild": "^0.14.23",
"jquery": "^3.6.0",
"popper.js": "^1.16.1",
"sass": "^1.49.9",
"stimulus": "^3.0.1"
},
"scripts": {
"build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds",
"build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
}
}
And I can built CSS in /builds/application.css
Now I want to add custom CSS. This is my process:
Added new file stylesheets/custom.css, with css:
.my-class {
color: #fff;
background-color: #00eb00;
}
Add import to application.bootstrap.scss
#import "custom";
yarn run build:css
And now I can see .my-class in builds/application.css
But when I try to use id in HTML, no CSS is added. Why? Should I place it somewhere else?
EDIT: I got it running, but only when I run manually rails assets:precompile and then bin/dev.
Why do I need to precompile every time I change something?
In a fresh rails 7 app (with css=bootstrap), here's what I did to get custom css styles:
Uncomment gem 'sass-rails in Gemfile, then bundle install (more info on that here)
Create a new css file in app/assets/stylesheets and name it example.css.scss
Add this line to app/assets/config/manifest.js:
//= link example.css
Wherever you need access to those styles, include this tag
<%= stylesheet_link_tag "example", "data-turbo-track": "reload" %>
Start your server with bin/dev instead of rails server
Everything should work (a nice test is to include this in your example.css.scss file and H1s should turn green)
h1 {
color: green;
}
Resource
Very helpful video here
I just encountered this problem and noticed both JavaScript and CSS are not recompiled after changes.
If you have gem jsbundling-rails included in your gemfile, check out https://github.com/rails/jsbundling-rails for more details and how-tos.
Run yarn run build:css to recompile the CSS assets.
I prefer using ./bin/dev to start my local server and monitor both JavaScript and CSS updates.
It worked for me if I added
//= link custom.css
to app/assets/config/manifest.js
And I didn't add #import "custom"; to application.bootstrap.scss

How to use the SFTP drivers in october CMS

Within octoberCMS there's a plugin called Drivers to install some third party drivers for storage; I want to use the SFTP drivers from FlySystem. I've adjusted the composer file of the driver plugin and added the flysystem;
"require": {
"php": ">=7.0",
"composer/installers": "~1.0",
"aws/aws-sdk-php": "~3.0",
"pda/pheanstalk": "~3.0",
"iron-io/iron_mq": "~1.5",
"predis/predis": "~1.0",
"phpseclib/phpseclib": "~2.0",
"league/flysystem-rackspace": "~1.0",
"league/flysystem-aws-s3-v3": "~1.0",
"guzzlehttp/guzzle": "~6.3",
"league/flysystem-sftp":"~1.0"
},
After installing the plugin the vendor folder contains also the flysystem-sftp files, but when I add an sftp record to the filesystems.php file in the config folder like
'sftp' => [
'driver' => 'sftp',
'host' => 'myftp.mydomain.com',
'username' => '########',
'password' => '########',
'port' => '21',
'passive' => 'true',
],
October gives an error: "Driver [sftp] is not supported", when I try to use it. Is there any one who can help me further?

Jackrabbit localhost server in silex

I am doing a sample project in silex to store the uploaded files into a jackrabbit server using marmelab/phpcr-api-silex-provider and my composer.json file looks like as follows
{
"require": {
"silex/silex": "~1.1",
"php": ">=5.4.0",
"doctrine/orm": "~2.2,>=2.2.3",
"twig/twig": "~1.14",
"jackalope/jackalope-jackrabbit": "~1.0",
"jackalope/jackalope-doctrine-dbal": "~1.0",
"marmelab/phpcr-api-silex-provider": "~1.1"
}
}
But i don't know how to install jackrabbit server for the file storage in my local machine.

Error installing SonataMediaBundle on Symfony CMF

I try install SonataMediaBundle with Symfony CMF Sandbox and have this exception after install
Catchable fatal error:
Argument 2 passed to Sonata\CoreBundle\Model\BaseManager::__construct()
must implement interface Doctrine\Common\Persistence\ManagerRegistry,
instance of Sonata\DoctrinePHPCRAdminBundle\Model\ModelManager given,
called in cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php on line 7986
and defined in cmf-sandbox/vendor/sonata-project/core-bundle/Model/BaseManager.php on line 41
It seems like version collision, but bundles pack was installed via composer with no conflicts, also I try to install older/newer versions, but no result.
I try phpcr and mongodb, is the same.
composer.json:
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"symfony-cmf/symfony-cmf": "1.1.*",
"symfony-cmf/simple-cms-bundle": "1.1.*",
"symfony-cmf/search-bundle": "1.0.*",
"symfony-cmf/create-bundle": "1.1.*",
"symfony-cmf/seo-bundle":"1.0.*",
"jackalope/jackalope-doctrine-dbal": "1.1.*",
"jackalope/jackalope-jackrabbit": "1.1.*",
"doctrine/doctrine-bundle": "1.2.*",
"doctrine/data-fixtures": "1.0.*",
"doctrine/doctrine-cache-bundle": "1.0.*",
"sonata-project/cache-bundle": "2.1.*",
"sonata-project/doctrine-phpcr-admin-bundle": "1.1.*",
"sonata-project/jquery-bundle": "1.8.3",
"symfony-cmf/block-bundle": "1.1.*",
"eko/feedbundle": "1.0.*",
"lunetics/locale-bundle": "2.2.*",
"liip/imagine-bundle": "0.21.*",
"wjzijderveld/check-bundles": "1.0.*",
"helios-ag/fm-elfinder-bundle": "1.4.*",
"sonata-project/media-bundle": "2.3.*#dev"
config.yml:
# cmf configuration
doctrine_phpcr:
# configure the PHPCR session
session:
backend: %phpcr_backend%
workspace: %phpcr_workspace%
username: %phpcr_user%
password: %phpcr_pass%
# enable the ODM layer
odm:
auto_mapping: true
mappings:
SonataMediaBundle:
prefix: Sonata\MediaBundle\PHPCR
auto_generate_proxy_classes: %kernel.debug%
locales:
en:
- de
- fr
sonata_media:
default_context: default
db_driver: doctrine_phpcr #doctrine_orm # or doctrine_mongodb
contexts:
default: # the default context is mandatory
providers:
- sonata.media.provider.dailymotion
- sonata.media.provider.youtube
- sonata.media.provider.image
- sonata.media.provider.file
formats:
small: { width: 100 , quality: 70}
big: { width: 500 , quality: 70}
cdn:
server:
path: /uploads/media # http://media.sonata-project.org/
filesystem:
local:
directory: %kernel.root_dir%/../web/uploads/media
create: false
Its a bit tricky to get the right versions of the Sonata Bundles, we just released 1.1 and tried to improve things a bit there by making the dependencies a bit more explicit. Can you try again?

Resources