php-ews folders do not match php-ews code at all - exchange-server-2010

Installed php-ews using composer:
{
"minimum-stability": "dev",
"prefer-stable": true,
"require":
{
"php-ews/php-ews": "dev-master"
}
}
The installation passed fine.
Made this simple request in my project code:
require_once 'composer/vendor/autoload.php';
use \php-ews\php-ews\src\Client;
$host = 'my.server.co.il';
$username = 'user#server.co.il';
$password = 'myPass';
$version = Client::VERSION_2010;
$client = new Client($host, $username, $password, $version);
But the PHP doesn't accept hyphens (-) in its use command path,
I got the error:
PHP Parse error: syntax error, unexpected '-', expecting ',' or ';' in /var/www/html
Then I noticed, the paths of the use phrases in all the code files of the php-ews project, do not match the project files that where installed using the composer at all. For example, in the create.php file there are use phrases:
use \jamesiarmes\PhpEws\Client;
use \jamesiarmes\PhpEws\Request\CreateItemType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAllItemsType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAttendeesType;
use \jamesiarmes\PhpEws\Enumeration\BodyTypeType;
use \jamesiarmes\PhpEws\Enumeration\CalendarItemCreateOrDeleteOperationType;
use \jamesiarmes\PhpEws\Enumeration\ResponseClassType;
use \jamesiarmes\PhpEws\Enumeration\RoutingType;
The above paths do not even exist in the project at all....
The project files and folders that the composer installed, they do not match the code use and require phrases inside of them.
Did I make the wrong installation?
is there other way to use the composer.json file so I can install the project right, without hyphens (php-ews) in the directories?
php-ews Version installed:
"packages": [{
"name": "jamesiarmes/php-ntlm",
"version": "1.0.0-beta.1",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}]
Linux Centos 7
PHP version: 5.4.16
Microsoft Exchange version: 2010

installation seems correct.
require != use
use is a namespace, this on is defined in the Client.php, which is autoloaded.
client.php line 6:
namespace jamesiarmes\PhpEws;

Related

Ignore flake8 warning in SublimeLinter

I have installed SublimeLinter-flake8. I would like to exclude the W191 warning when I am using SublimeLinter with flake8. I have checked the SublimeLinter docs and tried adding "--ignore W191" to my user settings file and reloaded plugins but I still get warned about the usage of tabs.
The following is my Packages/User/SublimeLinter.sublime-settings file.
// SublimeLinter Settings - User
{
"linters": {
"linter_name" : {
"args" : "--ignore W191"
}
}
}
I checked this answer on StackOverflow but I would like it to be applied from the settings file.
The linter_name has to be the specific plugin you're looking to configure (in this case flake8) -- try this:
{
"linters": {
"flake8" : {
"args" : "--ignore W191"
}
}
}
though realistically, it is probably better to configure your flake8 settings in flake8's configuration such that contributors to your project can work on your project without your specific sublimetext settings. I believe sublimetext's invocation of flake8 should be compatible with those configurations if I'm reading their code correctly
disclaimer: though I'm not sure it's super relevant here, I currently maintain flake8

How to set correct root path when use Github Actions ci/cd?

I am trying to use ci/cd workflow with github Actions,
I use jest for unit test and set moduleNameMapper like below:
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/src/$1",
"^components/(.*)$": "<rootDir>/src/components/$1"
}
I can run npm test successfully in local, However github actions always get error:
Could not locate module src/components/tool-panel/Container.vue (mapped as /home/runner/work/its-me/its-me/src/components/tool-panel/Container.vue)
Please check:
"moduleNameMapper": {
"/^src\/(.*)$/": "/home/runner/work/its-me/its-me/src/$1"
},
"resolver": undefined
Seems the <rootDir> is replaced as /home/runner/work/its-me/its-me, and there no folder src in this path: /home/runner/work/its-me/its-me.
So How can i set correct root path?
I am not sure if i can ssh to github action server.
This is my github repo: It's me
Any help would be appreciated!!
I think the problem is that you are referencing the file Container.vue with an uppercase C but the actual file is all lowercase. If your local filesystem is case insensitive it may execute fine.
https://github.com/jeoy/its-me/blob/master/test/unit/toolContainer.spec.js#L8
Change the filename here to all lowercase:
import Container from 'src/components/tool-panel/Container.vue';

Sane RPM custom layout for Artifactory?

I am trying to come up with a sane layout for my RPMs that follow this path structure
<repo_name>/<module_name>/<module_name>-0.0.0-<epoch>.<arch>.rpm
For example, this is a test path:
rpm-rhel7-dev/python-opstools/python-opstools-2.7.6-1.noarch.rpm
Anyone have any hints?
Related documentation
https://www.jfrog.com/confluence/display/RTF/Repository+Layouts
Cleared all packages from 'my-repo'
Created layout 'rpm-default'
Artifact Path Pattern:
[orgPath]/[module]-baseRev-[classifier].[ext]
Folder Integration Revision RegExp
.*
File Integration Revisino RegExp
.*
Once I did this and assigned this layout to my empty repo, I pushed to this path (Jenkins):
upload_spec = """{
"files": [
{
"pattern": "$RPM_ROOT/*.rpm",
"target": "$REPO_NAME/my-module/"
}
]
}"""
Where RPM root is your path to RPM/RPMs per documentation:
https://www.jfrog.com/confluence/display/RTF/RPM+Repositories
https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins
https://www.jfrog.com/confluence/display/RTF/Using+File+Specs#UsingFileSpecs-UploadSpecSchema
The key here is to make sure you have a module ID after a push:
Module ID: python-opstools:python-opstools:2.8.0:1
After this, you should see versions to delete or manage when right click the module folder / repo root. Don't ask me yet how to fully deconstruct all the pieces fo the path pattern :P, instead, refer to the documentation:
https://www.jfrog.com/confluence/display/RTF/Repository+Layouts

How to create a JSCS config file on windows

When I try to create a JSCS config file:
C:\Blog\BlogWeb>jscs --auto-configure "C:\Blog\BlogWeb\temp.jscs"
I get the following error:
safeContextKeyword option requires string or array value
What parameter am I supposed to pass? What is a safecontextkeyword?
New to NPM and JSCS, please excuse ignorance.
JSCS was complaining that I didn't have a config file, so I was trying to figure out how to create one.
JSCS looks for a config file in these places, unless you manually specify it with the --config option:
jscs it will consequentially search for jscsConfig option in package.json file then for .jscsrc (which is a just JSON with comments) and .jscs.json files in the current working directory then in nearest ancestor until it hits the system root.
I fixed this by:
Create a new file named .jscsrc. Windows Explorer may not let you do this, so may need to use the command line.
Copy the following into it. It doesn't matter if this is the preset you want to use or not. The command will overwrite it.
{
"preset": "jquery",
"requireCurlyBraces": null // or false
}
Verify that it works by running a command such as:
run the command
jscs --auto-configure .jscsrc

Customize CFEngine3 temporary downloaded files location

I am facing a issue while trying configuring something with CFENGINE3.5, I have created a policy to install some package from source, which download tar balls from some url and then untar it and further digs it with make and make install, everything working fine except while it download tar balls it keeps at "/etc" location, I want cfengine to put this file at /tmp.
Is there any way to customize this default behavior of cfengine to keep all temporary downloaded files at "/tmp" instead of "/etc".
Here is the Policy snippet:
bundle agent install
{
vars:
"packages" slist => {
"Algorithm-Diff-1.1902",
"Apache-DB-0.13",
"Apache-DBI-1.06",
"Apache-Session-1.83",
"Apache-SessionX-2.01",
"AppConfig-1.65",
"Archive-Tar-1.32",
};
commands:
"/usr/bin/wget http://10.X.X.X/downloads/perl-modules/$(packages).tar.gz;
/usr/bin/gunzip $(packages).tar.gz;
tar -xf $(packages).tar;
cd $(packages);
/usr/bin/perl Makefile.PL;
/usr/bin/make;
/usr/bin/make install;"
contain => standard,
classes => satisfied(canonify("$(packages)-installed"));
}
body contain standard
{
useshell => "true";
exec_owner => "root";
}
Thanks in advance.
You can add the directory in which the commands should be executed to the contain body, like this:
body contain standard
{
useshell => "true";
exec_owner => "root";
chdir => "/tmp";
}
Please note there are already a few contain bodies in the standard library (lib/3.5/commands.cf), maybe one of those can be used so you don't have to write your own. Note that CFEngine already executes as root, so exec_owner => "root" is not strictly necessary.

Resources