auto-loader in Zend Framework 3.0.3-dev - zend-framework3

Being novice to Zend framework and after reading almost all the possible answers already posted, It did not work. I want to set up an instance of Zend Framework auto-loader and Zend_Http_Client class.
code is as:
require_once 'Zend/Loader.php';
zend_autoload::loadClass('Zend_Http_Client');
I see also that 'Zend/Loader.php' is deprecated in the previous versions and is as now: 'Zend/Loader/Autoloader.php'; Then I can not locate the class 'zend_autoload'. Any guidance would be helpful.

Related

Munit not able to recognize the Parallel For Each (Mule 4)

I have build the application using Mule Runtime 4.2.2 and anypoint studio 7.3.2 . As part of the application, I am using the parallel for each component. Application build and works fine. While Adding Munit I am seeing the below error.
org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: There was '1' parsing the given file 'implementation.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 21; columnNumber: 58; cvc-complex-type.2.4.a: Invalid cound starting with element 'parallel-foreach'. One of '{"http://www.mulesoft.org/schema/mule/core":aage-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}d.
Munit Version : 2.2.4
Could anyone able to help resolve this issue .Thanks
Though I changed Mule Run time to 4.2.2 in pom.xml. I forgot to change it in mule-artifact.json(4.1.5). Munit still runs with 4.1.5 based on mule-artifact.json. Since parallel foreach not supported in Mule 4.1.5. It caused the above error.
it works by changing the mule-artifact.json
{"minMuleVersion":"4.2.2"}
It looks that you have not fully defined xml for your app.
It usually happens when you cut&paste part of the app source without paying attention of the xml include tag which is on the beginning of the source.
It usually works fine when you already have such component already in your flows. But when it is new one then include tag should be also full in your source.
Easy fix - drag and drop similar component from the palette to your flows. Drop it anywhere - Anypoint Studio will adjust import of the components. Then just delete this unnecessary component - you have your own already and Studio already modified the source.
Include tag could be also modified manually. Actually it is tag with all necessary schema definitions in the xmlns attribute. What is missing is in your question. It is
One of '{"http://www.mulesoft.org/schema/mule/core":aage-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}d
But it could be tricky because you have to know how schema is defined in the tag. Usually it has 2 references for the schema and the xsd definition. If you are not familiar with it or cannot cat&paste from another working app - better use Studio help as described above.
-- Creating Mulesoft apps at https://simpleflatservice.com

When referencing a .Net Standard project within a Xamarin solution, does all the code from the project get compiled into the app

Apologies if this sounds like a silly question. I'm not very experienced with how things are linked/bundled/assembled under the hood.
Before I begin, I'd like to say that I've tried reading documentation (such as https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/code-sharing) to find the answer, but was unable to.
If I have a Xamarin.Forms solution and I reference a .Net Standard project:
Question 1: Does all the code from this project get compiled and included into the app such that it may be disassembled later, or is it only code from classes that I actually make use of that gets included?
Bit more elaboration:
For example, I may have a School class that expects an IStudent (inject via DI), and a Student class that implements IStudent. Both of these exist in the .Net Standard project that I reference in the Xamarin.Forms project. However, if I only actually make use of the Student class (by registering it with type IStudent in my IoC container), will the code from School get included in the built app as well?
Question 2: If all the code from the project does get included, is there a way to forcefully specify which classes to include/exclude by way of some configuration setting, attributes, 3rd-party library, or something else?
As far as i know everything in the NETStandard project get compiled and shipped with the app.
If you want to remove unused code from compiled assemblies you have to use the linker.
To link everything, you have to select "Sdk and User Assemblies".
The linker tries to dont strip away mthods and fields you are using, but often is too aggressive (for example, methods referenced only by reflection will be stripped).
Luckily there are few methods where you can fine-tune the linker behaviour and make it work. Some link to elaborate on:
Linker in iOS and Android
https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/linker
https://learn.microsoft.com/en-us/xamarin/android/deploy-test/linker
Official doc about the linker config:
https://learn.microsoft.com/en-us/xamarin/cross-platform/deploy-test/linker
Useful blogposts:
https://xamarinhelp.com/xamarin-linker/
https://medium.com/#harrycblum/reduce-your-xamarin-app-size-with-linking-26247edc87f6

IdentityServer4.Services.InMemory not working

I google a lot but not find any solution. Below is my problem :
I make a simple project where I use reference "IdentityServer4.Postgresql": "1.0.0"
where "using IdentityServer4.Services.InMemory" works perfectly.
But when I use "IdentityServer4.Postgresql": "2.0.0" then IdentityServer4.Services.InMemory always shows error.
That means version 2 of IdentityServer4.Postgresql not support IdentityServer4.Services.InMemory.
How can I use IdentityServer4.Services.InMemory for "IdentityServer4.Postgresql": "2.0.0"?
Thanks in advance.
IdentityServer4.Postgresql is not a part of the IdentityServer project, but sounds like a community contribution. You may have a better result by contacting the library creator.
Otherwise, you could try the official IdentityServer4.EntityFramework package that is maintained by the IdentityServer team in combination with an Entity Framework Core database provider for PostgreSQL.
The official quickstarts only show adding Entity Framework in the 8th quickstart. You'll have to do each one in succession up to the eighth one to fully understand / make sure to have the code you need.
After you have Entity Framework added to the configuration, you can support a Postgres database by just adding dependencies.

Best strategy for upgrading application from Symfony 2.0 to Symfony 2.4?

I need to upgrade an existing rather large application from Symfony 2.0.15 to Symfony 2.4.x (replace with current version).
I'm not quite sure what would be the best strategy to do so. Migration critical features like forms or esi are used, of course :)
Upgrade "step by step" from one major version to another (2.1, 2.2, 2.3, 2.4)
Upgrade directly from 2.0.x to 2.4
Do you have any tips / experience to share ? Would appreciate it :)
Thanks,
Stephan
Each new version comes with an update UPGRADE-2.x.md file containing all intructions to convert your application from the immediately previous version.
I had to do that on my project as well, and I found the step-by-step method more natural and easier to manage. Fact is, there is no file such file as UPGRADE-2.0-to-2.4.md that would help you out for a direct conversion to 2.4.
I shall first recommend to make sure that none of your code uses obsolete functionnalities of Symfony 2.0 (not sure if there are deprecated parts in this version, though), because these can be removed in ulterior versions and will not be included in the UPGRADE file.
If you have done indeep modifications of the core Symfony code, you may find that some undocumented modifications are needed. For instance, there is a custom error handler in my project, extending the Symfony error handler. Well, although it was not documented in the UPGRADE file, the signature of ErrorHandler::handle() was modified and needed to be updated in my custom handler.
Similarly, I had to modify some namespaces because files had been moved in the framework code.
The conversion is still ongoing and I'm currently experiencing a weird error I'm trying to get rid of: The 'request' scope on services registered on custom events generates errors in the logs.

Implement Sylius into Symfony2 Standard Edition

Hoi,
I am trying to implement the Sylius e-commerce bundles into a fresh Symfony 2.2.2 Standard Edition.
When running the sylius:install command from commandline, i keep getting the following error:
The class 'Sylius\Bundle\CartBundle\Model\CartItemInterface' was not found in
the chain configured namespaces Sylius\Bundle\CoreBundle\Entity,
Sylius\Bundle\SettingsBundle\Entity, Sylius\Bundle\CartBundle\Entity,
Sylius\Bundle\AssortmentBundle\Entity, Sylius\Bundle\TaxationBundle\Entity,
Sylius\Bundle\ShippingBundle\Entity, Sylius\Bundle\PaymentsBundle\Entity,
Sylius\Bundle\PromotionsBundle\Entity, Sylius\Bundle\AddressingBundle\Entity,
Sylius\Bundle\SalesBundle\Entity, Sylius\Bundle\InventoryBundle\Entity,
Sylius\Bundle\TaxonomiesBundle\Entity, FOS\UserBundle\Entity
The Bundles are imported via Composer, activated via AppKernel.php, I've migrated the dependencies and configuration from a plain Sylius installation and actually have no idea, where this error comes from. I just noticed, that its trying to find a Model inside an Entiy-Namespace, which can't be right.
Anyone an idea?
We had the same problem, we are working with symfony 2.1. I fixed it by reordering the bundles registration in the app Kernel.php file.
In this file I placed the syliusCart bundle register before all the other sylius bundles and the doctrine registers.
I really dont know what is causing this or why this worked for me... but I hope this works for you.
Cheers!

Resources